aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-25 16:09:41 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:19:27 -0400
commitc86f86e9e75e77e4d51ded9edbad30834ff606f7 (patch)
tree634fec004ec2977a9c12aeb8f8d89698a796282e
parent522a0cc0f0ecdb1857db7795b1c17591f28f9ca0 (diff)
rbd: make snap_size order parameter optional
Only one of the two callers of _rbd_dev_v2_snap_size() needs the order value returned. So make that an optional argument--a null pointer if the caller doesn't need it. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--drivers/block/rbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 28b652c38102..1e01f0d8312a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3494,7 +3494,8 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
3494 if (ret < sizeof (size_buf)) 3494 if (ret < sizeof (size_buf))
3495 return -ERANGE; 3495 return -ERANGE;
3496 3496
3497 *order = size_buf.order; 3497 if (order)
3498 *order = size_buf.order;
3498 *snap_size = le64_to_cpu(size_buf.size); 3499 *snap_size = le64_to_cpu(size_buf.size);
3499 3500
3500 dout(" snap_id 0x%016llx order = %u, snap_size = %llu\n", 3501 dout(" snap_id 0x%016llx order = %u, snap_size = %llu\n",
@@ -3939,11 +3940,10 @@ static char *rbd_dev_v2_snap_info(struct rbd_device *rbd_dev, u32 which,
3939 u64 *snap_size, u64 *snap_features) 3940 u64 *snap_size, u64 *snap_features)
3940{ 3941{
3941 u64 snap_id; 3942 u64 snap_id;
3942 u8 order;
3943 int ret; 3943 int ret;
3944 3944
3945 snap_id = rbd_dev->header.snapc->snaps[which]; 3945 snap_id = rbd_dev->header.snapc->snaps[which];
3946 ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, &order, snap_size); 3946 ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, NULL, snap_size);
3947 if (ret) 3947 if (ret)
3948 return ERR_PTR(ret); 3948 return ERR_PTR(ret);
3949 ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features); 3949 ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features);