summaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-02-06 13:26:35 -0500
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 04:12:44 -0400
commitdfd9875f11008183c26fea5fdf23e6740fe8aa5a (patch)
treefb5c3436d755ab2f0d7631273355b516a5b6f44b /drivers/block/rbd.c
parent0420c5dd2ef308b69a86b44a217390f5612bab58 (diff)
rbd: get rid of img_req->{offset,length}
These are set, but no longer used. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a22d265b30df..b3e310a87fd1 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -283,8 +283,6 @@ struct rbd_img_request {
283 struct rbd_device *rbd_dev; 283 struct rbd_device *rbd_dev;
284 enum obj_operation_type op_type; 284 enum obj_operation_type op_type;
285 enum obj_request_type data_type; 285 enum obj_request_type data_type;
286 u64 offset; /* starting image byte offset */
287 u64 length; /* byte count from offset */
288 unsigned long flags; 286 unsigned long flags;
289 union { 287 union {
290 u64 snap_id; /* for reads */ 288 u64 snap_id; /* for reads */
@@ -1602,7 +1600,6 @@ static bool rbd_dev_parent_get(struct rbd_device *rbd_dev)
1602 */ 1600 */
1603static struct rbd_img_request *rbd_img_request_create( 1601static struct rbd_img_request *rbd_img_request_create(
1604 struct rbd_device *rbd_dev, 1602 struct rbd_device *rbd_dev,
1605 u64 offset, u64 length,
1606 enum obj_operation_type op_type, 1603 enum obj_operation_type op_type,
1607 struct ceph_snap_context *snapc) 1604 struct ceph_snap_context *snapc)
1608{ 1605{
@@ -1614,8 +1611,6 @@ static struct rbd_img_request *rbd_img_request_create(
1614 1611
1615 img_request->rbd_dev = rbd_dev; 1612 img_request->rbd_dev = rbd_dev;
1616 img_request->op_type = op_type; 1613 img_request->op_type = op_type;
1617 img_request->offset = offset;
1618 img_request->length = length;
1619 if (!rbd_img_is_write(img_request)) 1614 if (!rbd_img_is_write(img_request))
1620 img_request->snap_id = rbd_dev->spec->snap_id; 1615 img_request->snap_id = rbd_dev->spec->snap_id;
1621 else 1616 else
@@ -1628,9 +1623,8 @@ static struct rbd_img_request *rbd_img_request_create(
1628 INIT_LIST_HEAD(&img_request->object_extents); 1623 INIT_LIST_HEAD(&img_request->object_extents);
1629 kref_init(&img_request->kref); 1624 kref_init(&img_request->kref);
1630 1625
1631 dout("%s: rbd_dev %p %s %llu/%llu -> img %p\n", __func__, rbd_dev, 1626 dout("%s: rbd_dev %p %s -> img %p\n", __func__, rbd_dev,
1632 obj_op_name(op_type), offset, length, img_request); 1627 obj_op_name(op_type), img_request);
1633
1634 return img_request; 1628 return img_request;
1635} 1629}
1636 1630
@@ -1659,9 +1653,8 @@ static void rbd_img_request_destroy(struct kref *kref)
1659 kmem_cache_free(rbd_img_request_cache, img_request); 1653 kmem_cache_free(rbd_img_request_cache, img_request);
1660} 1654}
1661 1655
1662static struct rbd_img_request *rbd_parent_request_create( 1656static struct rbd_img_request *
1663 struct rbd_obj_request *obj_request, 1657rbd_parent_request_create(struct rbd_obj_request *obj_request)
1664 u64 img_offset, u64 length)
1665{ 1658{
1666 struct rbd_img_request *parent_request; 1659 struct rbd_img_request *parent_request;
1667 struct rbd_device *rbd_dev; 1660 struct rbd_device *rbd_dev;
@@ -1669,8 +1662,8 @@ static struct rbd_img_request *rbd_parent_request_create(
1669 rbd_assert(obj_request->img_request); 1662 rbd_assert(obj_request->img_request);
1670 rbd_dev = obj_request->img_request->rbd_dev; 1663 rbd_dev = obj_request->img_request->rbd_dev;
1671 1664
1672 parent_request = rbd_img_request_create(rbd_dev->parent, img_offset, 1665 parent_request = rbd_img_request_create(rbd_dev->parent, OBJ_OP_READ,
1673 length, OBJ_OP_READ, NULL); 1666 NULL);
1674 if (!parent_request) 1667 if (!parent_request)
1675 return NULL; 1668 return NULL;
1676 1669
@@ -2127,9 +2120,7 @@ static int rbd_obj_read_from_parent(struct rbd_obj_request *obj_req)
2127 struct rbd_img_request *child_img_req; 2120 struct rbd_img_request *child_img_req;
2128 int ret; 2121 int ret;
2129 2122
2130 child_img_req = rbd_parent_request_create(obj_req, 2123 child_img_req = rbd_parent_request_create(obj_req);
2131 obj_req->img_extents[0].fe_off,
2132 obj_req->img_extents[0].fe_len);
2133 if (!child_img_req) 2124 if (!child_img_req)
2134 return -ENOMEM; 2125 return -ENOMEM;
2135 2126
@@ -3562,8 +3553,7 @@ static void rbd_queue_workfn(struct work_struct *work)
3562 } 3553 }
3563 } 3554 }
3564 3555
3565 img_request = rbd_img_request_create(rbd_dev, offset, length, op_type, 3556 img_request = rbd_img_request_create(rbd_dev, op_type, snapc);
3566 snapc);
3567 if (!img_request) { 3557 if (!img_request) {
3568 result = -ENOMEM; 3558 result = -ENOMEM;
3569 goto err_unlock; 3559 goto err_unlock;