Message ID | 517A6DA1.90809@inktank.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Reviewed-by: Josh Durgin <josh.durgin@inktank.com> On 04/26/2013 05:05 AM, Alex Elder wrote: > 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> > --- > drivers/block/rbd.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c > index 28b652c..1e01f0d 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, > if (ret < sizeof (size_buf)) > return -ERANGE; > > - *order = size_buf.order; > + if (order) > + *order = size_buf.order; > *snap_size = le64_to_cpu(size_buf.size); > > 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, > u64 *snap_size, u64 *snap_features) > { > u64 snap_id; > - u8 order; > int ret; > > snap_id = rbd_dev->header.snapc->snaps[which]; > - ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, &order, snap_size); > + ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, NULL, snap_size); > if (ret) > return ERR_PTR(ret); > ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features); > -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 28b652c..1e01f0d 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, if (ret < sizeof (size_buf)) return -ERANGE; - *order = size_buf.order; + if (order) + *order = size_buf.order; *snap_size = le64_to_cpu(size_buf.size);
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> --- drivers/block/rbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, u64 *snap_size, u64 *snap_features) { u64 snap_id; - u8 order; int ret; snap_id = rbd_dev->header.snapc->snaps[which]; - ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, &order, snap_size); + ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, NULL, snap_size); if (ret) return ERR_PTR(ret); ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features);