mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
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>
This commit is contained in:
parent
522a0cc0f0
commit
c86f86e9e7
@ -3494,6 +3494,7 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
|
||||
if (ret < sizeof (size_buf))
|
||||
return -ERANGE;
|
||||
|
||||
if (order)
|
||||
*order = size_buf.order;
|
||||
*snap_size = le64_to_cpu(size_buf.size);
|
||||
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user