mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
block/rnbd-clt: Move add_disk(dev->gd) to rnbd_clt_setup_gen_disk
It makes more sense to add gendisk in rnbd_clt_setup_gen_disk, instead of do it in rnbd_clt_map_device. Signed-off-by: Guoqing Jiang <guoqing.jiang@gmx.com> Reviewed-by: Danil Kipnis <danil.kipnis@cloud.ionos.com> Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Link: https://lore.kernel.org/r/20210419073722.15351-6-gi-oh.kim@ionos.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
8b7f05114b
commit
d0a70ab10b
1 changed files with 1 additions and 2 deletions
|
@ -1352,6 +1352,7 @@ static void rnbd_clt_setup_gen_disk(struct rnbd_clt_dev *dev, int idx)
|
|||
|
||||
if (!dev->rotational)
|
||||
blk_queue_flag_set(QUEUE_FLAG_NONROT, dev->queue);
|
||||
add_disk(dev->gd);
|
||||
}
|
||||
|
||||
static int rnbd_client_setup_device(struct rnbd_clt_dev *dev)
|
||||
|
@ -1553,8 +1554,6 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,
|
|||
dev->max_hw_sectors, dev->rotational, dev->wc, dev->fua);
|
||||
|
||||
mutex_unlock(&dev->lock);
|
||||
|
||||
add_disk(dev->gd);
|
||||
rnbd_clt_put_sess(sess);
|
||||
|
||||
return dev;
|
||||
|
|
Loading…
Reference in a new issue