Lines Matching refs:osd_req

1293 static void rbd_osd_submit(struct ceph_osd_request *osd_req)  in rbd_osd_submit()  argument
1295 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_submit()
1298 __func__, osd_req, obj_req, obj_req->ex.oe_objno, in rbd_osd_submit()
1300 ceph_osdc_start_request(osd_req->r_osdc, osd_req); in rbd_osd_submit()
1367 static void rbd_osd_req_callback(struct ceph_osd_request *osd_req) in rbd_osd_req_callback() argument
1369 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_req_callback()
1372 dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req, in rbd_osd_req_callback()
1373 osd_req->r_result, obj_req); in rbd_osd_req_callback()
1380 if (osd_req->r_result > 0 && rbd_img_is_write(obj_req->img_request)) in rbd_osd_req_callback()
1383 result = osd_req->r_result; in rbd_osd_req_callback()
1388 static void rbd_osd_format_read(struct ceph_osd_request *osd_req) in rbd_osd_format_read() argument
1390 struct rbd_obj_request *obj_request = osd_req->r_priv; in rbd_osd_format_read()
1394 osd_req->r_flags = CEPH_OSD_FLAG_READ | opt->read_from_replica; in rbd_osd_format_read()
1395 osd_req->r_snapid = obj_request->img_request->snap_id; in rbd_osd_format_read()
1398 static void rbd_osd_format_write(struct ceph_osd_request *osd_req) in rbd_osd_format_write() argument
1400 struct rbd_obj_request *obj_request = osd_req->r_priv; in rbd_osd_format_write()
1402 osd_req->r_flags = CEPH_OSD_FLAG_WRITE; in rbd_osd_format_write()
1403 ktime_get_real_ts64(&osd_req->r_mtime); in rbd_osd_format_write()
1404 osd_req->r_data_offset = obj_request->ex.oe_off; in rbd_osd_format_write()
1469 struct ceph_osd_request *osd_req; in rbd_obj_request_destroy() local
1477 osd_req = list_first_entry(&obj_request->osd_reqs, in rbd_obj_request_destroy()
1479 list_del_init(&osd_req->r_private_item); in rbd_obj_request_destroy()
1480 ceph_osdc_put_request(osd_req); in rbd_obj_request_destroy()
1928 struct ceph_osd_request *osd_req) in rbd_object_map_update_finish() argument
1937 if (osd_req->r_result) in rbd_object_map_update_finish()
1938 return osd_req->r_result; in rbd_object_map_update_finish()
1943 if (osd_req->r_num_ops == 1) in rbd_object_map_update_finish()
1949 rbd_assert(osd_req->r_num_ops == 2); in rbd_object_map_update_finish()
1950 osd_data = osd_req_op_data(osd_req, 1, cls, request_data); in rbd_object_map_update_finish()
1972 static void rbd_object_map_callback(struct ceph_osd_request *osd_req) in rbd_object_map_callback() argument
1974 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_object_map_callback()
1977 dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req, in rbd_object_map_callback()
1978 osd_req->r_result, obj_req); in rbd_object_map_callback()
1980 result = rbd_object_map_update_finish(obj_req, osd_req); in rbd_object_map_callback()
2135 static void rbd_osd_setup_data(struct ceph_osd_request *osd_req, int which) in rbd_osd_setup_data() argument
2137 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_data()
2141 osd_req_op_extent_osd_data_bio(osd_req, which, in rbd_osd_setup_data()
2150 osd_req_op_extent_osd_data_bvec_pos(osd_req, which, in rbd_osd_setup_data()
2158 static int rbd_osd_setup_stat(struct ceph_osd_request *osd_req, int which) in rbd_osd_setup_stat() argument
2174 osd_req_op_init(osd_req, which, CEPH_OSD_OP_STAT, 0); in rbd_osd_setup_stat()
2175 osd_req_op_raw_data_in_pages(osd_req, which, pages, in rbd_osd_setup_stat()
2181 static int rbd_osd_setup_copyup(struct ceph_osd_request *osd_req, int which, in rbd_osd_setup_copyup() argument
2184 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_copyup()
2187 ret = osd_req_op_cls_init(osd_req, which, "rbd", "copyup"); in rbd_osd_setup_copyup()
2191 osd_req_op_cls_request_data_bvecs(osd_req, which, obj_req->copyup_bvecs, in rbd_osd_setup_copyup()
2202 static void __rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_write_ops() argument
2205 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_write_ops()
2211 osd_req_op_alloc_hint_init(osd_req, which++, in __rbd_osd_setup_write_ops()
2222 osd_req_op_extent_init(osd_req, which, opcode, in __rbd_osd_setup_write_ops()
2224 rbd_osd_setup_data(osd_req, which); in __rbd_osd_setup_write_ops()
2249 static void __rbd_osd_setup_discard_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_discard_ops() argument
2252 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_discard_ops()
2256 osd_req_op_init(osd_req, which, CEPH_OSD_OP_DELETE, 0); in __rbd_osd_setup_discard_ops()
2258 osd_req_op_extent_init(osd_req, which, in __rbd_osd_setup_discard_ops()
2307 static void __rbd_osd_setup_zeroout_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_zeroout_ops() argument
2310 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_zeroout_ops()
2316 osd_req_op_init(osd_req, which++, in __rbd_osd_setup_zeroout_ops()
2321 osd_req_op_init(osd_req, which++, in __rbd_osd_setup_zeroout_ops()
2330 osd_req_op_extent_init(osd_req, which, opcode, in __rbd_osd_setup_zeroout_ops()
2380 static void rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req, in rbd_osd_setup_write_ops() argument
2383 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_write_ops()
2387 __rbd_osd_setup_write_ops(osd_req, which); in rbd_osd_setup_write_ops()
2390 __rbd_osd_setup_discard_ops(osd_req, which); in rbd_osd_setup_write_ops()
2393 __rbd_osd_setup_zeroout_ops(osd_req, which); in rbd_osd_setup_write_ops()
2755 struct ceph_osd_request *osd_req; in rbd_obj_read_object() local
2758 osd_req = __rbd_obj_add_osd_request(obj_req, NULL, 1); in rbd_obj_read_object()
2759 if (IS_ERR(osd_req)) in rbd_obj_read_object()
2760 return PTR_ERR(osd_req); in rbd_obj_read_object()
2762 osd_req_op_extent_init(osd_req, 0, CEPH_OSD_OP_READ, in rbd_obj_read_object()
2764 rbd_osd_setup_data(osd_req, 0); in rbd_obj_read_object()
2765 rbd_osd_format_read(osd_req); in rbd_obj_read_object()
2767 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_read_object()
2771 rbd_osd_submit(osd_req); in rbd_obj_read_object()
2948 struct ceph_osd_request *osd_req; in rbd_obj_write_object() local
2956 osd_req = rbd_obj_add_osd_request(obj_req, num_ops); in rbd_obj_write_object()
2957 if (IS_ERR(osd_req)) in rbd_obj_write_object()
2958 return PTR_ERR(osd_req); in rbd_obj_write_object()
2961 ret = rbd_osd_setup_stat(osd_req, which++); in rbd_obj_write_object()
2966 rbd_osd_setup_write_ops(osd_req, which); in rbd_obj_write_object()
2967 rbd_osd_format_write(osd_req); in rbd_obj_write_object()
2969 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_write_object()
2973 rbd_osd_submit(osd_req); in rbd_obj_write_object()
2999 struct ceph_osd_request *osd_req; in rbd_obj_copyup_empty_snapc() local
3005 osd_req = __rbd_obj_add_osd_request(obj_req, &rbd_empty_snapc, 1); in rbd_obj_copyup_empty_snapc()
3006 if (IS_ERR(osd_req)) in rbd_obj_copyup_empty_snapc()
3007 return PTR_ERR(osd_req); in rbd_obj_copyup_empty_snapc()
3009 ret = rbd_osd_setup_copyup(osd_req, 0, bytes); in rbd_obj_copyup_empty_snapc()
3013 rbd_osd_format_write(osd_req); in rbd_obj_copyup_empty_snapc()
3015 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_copyup_empty_snapc()
3019 rbd_osd_submit(osd_req); in rbd_obj_copyup_empty_snapc()
3026 struct ceph_osd_request *osd_req; in rbd_obj_copyup_current_snapc() local
3036 osd_req = rbd_obj_add_osd_request(obj_req, num_ops); in rbd_obj_copyup_current_snapc()
3037 if (IS_ERR(osd_req)) in rbd_obj_copyup_current_snapc()
3038 return PTR_ERR(osd_req); in rbd_obj_copyup_current_snapc()
3041 ret = rbd_osd_setup_copyup(osd_req, which++, bytes); in rbd_obj_copyup_current_snapc()
3046 rbd_osd_setup_write_ops(osd_req, which); in rbd_obj_copyup_current_snapc()
3047 rbd_osd_format_write(osd_req); in rbd_obj_copyup_current_snapc()
3049 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_copyup_current_snapc()
3053 rbd_osd_submit(osd_req); in rbd_obj_copyup_current_snapc()