Lines Matching refs:osd_req
1359 static void rbd_osd_submit(struct ceph_osd_request *osd_req) in rbd_osd_submit() argument
1361 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_submit()
1364 __func__, osd_req, obj_req, obj_req->ex.oe_objno, in rbd_osd_submit()
1366 ceph_osdc_start_request(osd_req->r_osdc, osd_req, false); in rbd_osd_submit()
1449 static void rbd_osd_req_callback(struct ceph_osd_request *osd_req) in rbd_osd_req_callback() argument
1451 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_req_callback()
1454 dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req, in rbd_osd_req_callback()
1455 osd_req->r_result, obj_req); in rbd_osd_req_callback()
1462 if (osd_req->r_result > 0 && rbd_img_is_write(obj_req->img_request)) in rbd_osd_req_callback()
1465 result = osd_req->r_result; in rbd_osd_req_callback()
1470 static void rbd_osd_format_read(struct ceph_osd_request *osd_req) in rbd_osd_format_read() argument
1472 struct rbd_obj_request *obj_request = osd_req->r_priv; in rbd_osd_format_read()
1476 osd_req->r_flags = CEPH_OSD_FLAG_READ | opt->read_from_replica; in rbd_osd_format_read()
1477 osd_req->r_snapid = obj_request->img_request->snap_id; in rbd_osd_format_read()
1480 static void rbd_osd_format_write(struct ceph_osd_request *osd_req) in rbd_osd_format_write() argument
1482 struct rbd_obj_request *obj_request = osd_req->r_priv; in rbd_osd_format_write()
1484 osd_req->r_flags = CEPH_OSD_FLAG_WRITE; in rbd_osd_format_write()
1485 ktime_get_real_ts64(&osd_req->r_mtime); in rbd_osd_format_write()
1486 osd_req->r_data_offset = obj_request->ex.oe_off; in rbd_osd_format_write()
1552 struct ceph_osd_request *osd_req; in rbd_obj_request_destroy() local
1560 osd_req = list_first_entry(&obj_request->osd_reqs, in rbd_obj_request_destroy()
1562 list_del_init(&osd_req->r_private_item); in rbd_obj_request_destroy()
1563 ceph_osdc_put_request(osd_req); in rbd_obj_request_destroy()
2014 struct ceph_osd_request *osd_req) in rbd_object_map_update_finish() argument
2023 if (osd_req->r_result) in rbd_object_map_update_finish()
2024 return osd_req->r_result; in rbd_object_map_update_finish()
2029 if (osd_req->r_num_ops == 1) in rbd_object_map_update_finish()
2035 rbd_assert(osd_req->r_num_ops == 2); in rbd_object_map_update_finish()
2036 osd_data = osd_req_op_data(osd_req, 1, cls, request_data); in rbd_object_map_update_finish()
2058 static void rbd_object_map_callback(struct ceph_osd_request *osd_req) in rbd_object_map_callback() argument
2060 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_object_map_callback()
2063 dout("%s osd_req %p result %d for obj_req %p\n", __func__, osd_req, in rbd_object_map_callback()
2064 osd_req->r_result, obj_req); in rbd_object_map_callback()
2066 result = rbd_object_map_update_finish(obj_req, osd_req); in rbd_object_map_callback()
2221 static void rbd_osd_setup_data(struct ceph_osd_request *osd_req, int which) in rbd_osd_setup_data() argument
2223 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_data()
2227 osd_req_op_extent_osd_data_bio(osd_req, which, in rbd_osd_setup_data()
2236 osd_req_op_extent_osd_data_bvec_pos(osd_req, which, in rbd_osd_setup_data()
2244 static int rbd_osd_setup_stat(struct ceph_osd_request *osd_req, int which) in rbd_osd_setup_stat() argument
2260 osd_req_op_init(osd_req, which, CEPH_OSD_OP_STAT, 0); in rbd_osd_setup_stat()
2261 osd_req_op_raw_data_in_pages(osd_req, which, pages, in rbd_osd_setup_stat()
2267 static int rbd_osd_setup_copyup(struct ceph_osd_request *osd_req, int which, in rbd_osd_setup_copyup() argument
2270 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_copyup()
2273 ret = osd_req_op_cls_init(osd_req, which, "rbd", "copyup"); in rbd_osd_setup_copyup()
2277 osd_req_op_cls_request_data_bvecs(osd_req, which, obj_req->copyup_bvecs, in rbd_osd_setup_copyup()
2288 static void __rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_write_ops() argument
2291 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_write_ops()
2297 osd_req_op_alloc_hint_init(osd_req, which++, in __rbd_osd_setup_write_ops()
2308 osd_req_op_extent_init(osd_req, which, opcode, in __rbd_osd_setup_write_ops()
2310 rbd_osd_setup_data(osd_req, which); in __rbd_osd_setup_write_ops()
2332 static void __rbd_osd_setup_discard_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_discard_ops() argument
2335 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_discard_ops()
2339 osd_req_op_init(osd_req, which, CEPH_OSD_OP_DELETE, 0); in __rbd_osd_setup_discard_ops()
2341 osd_req_op_extent_init(osd_req, which, in __rbd_osd_setup_discard_ops()
2390 static void __rbd_osd_setup_zeroout_ops(struct ceph_osd_request *osd_req, in __rbd_osd_setup_zeroout_ops() argument
2393 struct rbd_obj_request *obj_req = osd_req->r_priv; in __rbd_osd_setup_zeroout_ops()
2399 osd_req_op_init(osd_req, which++, in __rbd_osd_setup_zeroout_ops()
2404 osd_req_op_init(osd_req, which++, in __rbd_osd_setup_zeroout_ops()
2413 osd_req_op_extent_init(osd_req, which, opcode, in __rbd_osd_setup_zeroout_ops()
2461 static void rbd_osd_setup_write_ops(struct ceph_osd_request *osd_req, in rbd_osd_setup_write_ops() argument
2464 struct rbd_obj_request *obj_req = osd_req->r_priv; in rbd_osd_setup_write_ops()
2468 __rbd_osd_setup_write_ops(osd_req, which); in rbd_osd_setup_write_ops()
2471 __rbd_osd_setup_discard_ops(osd_req, which); in rbd_osd_setup_write_ops()
2474 __rbd_osd_setup_zeroout_ops(osd_req, which); in rbd_osd_setup_write_ops()
2836 struct ceph_osd_request *osd_req; in rbd_obj_read_object() local
2839 osd_req = __rbd_obj_add_osd_request(obj_req, NULL, 1); in rbd_obj_read_object()
2840 if (IS_ERR(osd_req)) in rbd_obj_read_object()
2841 return PTR_ERR(osd_req); in rbd_obj_read_object()
2843 osd_req_op_extent_init(osd_req, 0, CEPH_OSD_OP_READ, in rbd_obj_read_object()
2845 rbd_osd_setup_data(osd_req, 0); in rbd_obj_read_object()
2846 rbd_osd_format_read(osd_req); in rbd_obj_read_object()
2848 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_read_object()
2852 rbd_osd_submit(osd_req); in rbd_obj_read_object()
3029 struct ceph_osd_request *osd_req; in rbd_obj_write_object() local
3037 osd_req = rbd_obj_add_osd_request(obj_req, num_ops); in rbd_obj_write_object()
3038 if (IS_ERR(osd_req)) in rbd_obj_write_object()
3039 return PTR_ERR(osd_req); in rbd_obj_write_object()
3042 ret = rbd_osd_setup_stat(osd_req, which++); in rbd_obj_write_object()
3047 rbd_osd_setup_write_ops(osd_req, which); in rbd_obj_write_object()
3048 rbd_osd_format_write(osd_req); in rbd_obj_write_object()
3050 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_write_object()
3054 rbd_osd_submit(osd_req); in rbd_obj_write_object()
3081 struct ceph_osd_request *osd_req; in rbd_obj_copyup_empty_snapc() local
3087 osd_req = __rbd_obj_add_osd_request(obj_req, &rbd_empty_snapc, 1); in rbd_obj_copyup_empty_snapc()
3088 if (IS_ERR(osd_req)) in rbd_obj_copyup_empty_snapc()
3089 return PTR_ERR(osd_req); in rbd_obj_copyup_empty_snapc()
3091 ret = rbd_osd_setup_copyup(osd_req, 0, bytes); in rbd_obj_copyup_empty_snapc()
3095 rbd_osd_format_write(osd_req); in rbd_obj_copyup_empty_snapc()
3097 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_copyup_empty_snapc()
3101 rbd_osd_submit(osd_req); in rbd_obj_copyup_empty_snapc()
3108 struct ceph_osd_request *osd_req; in rbd_obj_copyup_current_snapc() local
3118 osd_req = rbd_obj_add_osd_request(obj_req, num_ops); in rbd_obj_copyup_current_snapc()
3119 if (IS_ERR(osd_req)) in rbd_obj_copyup_current_snapc()
3120 return PTR_ERR(osd_req); in rbd_obj_copyup_current_snapc()
3123 ret = rbd_osd_setup_copyup(osd_req, which++, bytes); in rbd_obj_copyup_current_snapc()
3128 rbd_osd_setup_write_ops(osd_req, which); in rbd_obj_copyup_current_snapc()
3129 rbd_osd_format_write(osd_req); in rbd_obj_copyup_current_snapc()
3131 ret = ceph_osdc_alloc_messages(osd_req, GFP_NOIO); in rbd_obj_copyup_current_snapc()
3135 rbd_osd_submit(osd_req); in rbd_obj_copyup_current_snapc()