Skip to content

Commit

Permalink
rnbd-clt: make rnbd_clt_change_capacity return void
Browse files Browse the repository at this point in the history
No need to checking the return value, make it return void.

Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20220706133152.12058-9-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Guoqing Jiang authored and Jens Axboe committed Aug 2, 2022
1 parent ae2dfd1 commit e507210
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/block/rnbd/rnbd-clt.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,18 @@ static inline bool rnbd_clt_get_dev(struct rnbd_clt_dev *dev)
return refcount_inc_not_zero(&dev->refcount);
}

static int rnbd_clt_change_capacity(struct rnbd_clt_dev *dev,
static void rnbd_clt_change_capacity(struct rnbd_clt_dev *dev,
sector_t new_nsectors)
{
if (get_capacity(dev->gd) == new_nsectors)
return 0;
return;

/*
* If the size changed, we need to revalidate it
*/
rnbd_clt_info(dev, "Device size changed from %llu to %llu sectors\n",
get_capacity(dev->gd), new_nsectors);
set_capacity_and_notify(dev->gd, new_nsectors);
return 0;
}

static int process_msg_open_rsp(struct rnbd_clt_dev *dev,
Expand Down Expand Up @@ -127,7 +126,7 @@ int rnbd_clt_resize_disk(struct rnbd_clt_dev *dev, sector_t newsize)
ret = -ENOENT;
goto out;
}
ret = rnbd_clt_change_capacity(dev, newsize);
rnbd_clt_change_capacity(dev, newsize);

out:
mutex_unlock(&dev->lock);
Expand Down

0 comments on commit e507210

Please sign in to comment.