@@ -1486,18 +1486,16 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request)
1486
1486
}
1487
1487
1488
1488
static struct ceph_osd_request *
1489
- rbd_osd_req_create (struct rbd_obj_request * obj_req , unsigned int num_ops )
1489
+ __rbd_osd_req_create (struct rbd_obj_request * obj_req ,
1490
+ struct ceph_snap_context * snapc , unsigned int num_ops )
1490
1491
{
1491
- struct rbd_img_request * img_req = obj_req -> img_request ;
1492
- struct rbd_device * rbd_dev = img_req -> rbd_dev ;
1492
+ struct rbd_device * rbd_dev = obj_req -> img_request -> rbd_dev ;
1493
1493
struct ceph_osd_client * osdc = & rbd_dev -> rbd_client -> client -> osdc ;
1494
1494
struct ceph_osd_request * req ;
1495
1495
const char * name_format = rbd_dev -> image_format == 1 ?
1496
1496
RBD_V1_DATA_FORMAT : RBD_V2_DATA_FORMAT ;
1497
1497
1498
- req = ceph_osdc_alloc_request (osdc ,
1499
- (rbd_img_is_write (img_req ) ? img_req -> snapc : NULL ),
1500
- num_ops , false, GFP_NOIO );
1498
+ req = ceph_osdc_alloc_request (osdc , snapc , num_ops , false, GFP_NOIO );
1501
1499
if (!req )
1502
1500
return NULL ;
1503
1501
@@ -1522,6 +1520,13 @@ rbd_osd_req_create(struct rbd_obj_request *obj_req, unsigned int num_ops)
1522
1520
return NULL ;
1523
1521
}
1524
1522
1523
+ static struct ceph_osd_request *
1524
+ rbd_osd_req_create (struct rbd_obj_request * obj_req , unsigned int num_ops )
1525
+ {
1526
+ return __rbd_osd_req_create (obj_req , obj_req -> img_request -> snapc ,
1527
+ num_ops );
1528
+ }
1529
+
1525
1530
static void rbd_osd_req_destroy (struct ceph_osd_request * osd_req )
1526
1531
{
1527
1532
ceph_osdc_put_request (osd_req );
@@ -1769,7 +1774,7 @@ static void rbd_osd_req_setup_data(struct rbd_obj_request *obj_req, u32 which)
1769
1774
1770
1775
static int rbd_obj_setup_read (struct rbd_obj_request * obj_req )
1771
1776
{
1772
- obj_req -> osd_req = rbd_osd_req_create (obj_req , 1 );
1777
+ obj_req -> osd_req = __rbd_osd_req_create (obj_req , NULL , 1 );
1773
1778
if (!obj_req -> osd_req )
1774
1779
return - ENOMEM ;
1775
1780
0 commit comments