diff options
author | 2020-11-16 15:56:57 +0100 | |
---|---|---|
committer | 2020-11-16 08:34:14 -0700 | |
commit | ee4bf648635055d2b76afadaf34236c8b2d852a7 (patch) | |
tree | 8c6d061e0f23e5daa2553233f43e7857d91b8201 /drivers/block/nbd.c | |
parent | block: remove the update_bdev parameter to set_capacity_revalidate_and_notify (diff) | |
download | linux-ee4bf648635055d2b76afadaf34236c8b2d852a7.tar.gz linux-ee4bf648635055d2b76afadaf34236c8b2d852a7.tar.bz2 linux-ee4bf648635055d2b76afadaf34236c8b2d852a7.zip |
nbd: remove the call to set_blocksize
Block driver have no business setting the file system concept of a
block size.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index aaae9220f3a0..a9a0b49ff161 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -296,7 +296,7 @@ static void nbd_size_clear(struct nbd_device *nbd) } } -static void nbd_size_update(struct nbd_device *nbd, bool start) +static void nbd_size_update(struct nbd_device *nbd) { struct nbd_config *config = nbd->config; struct block_device *bdev = bdget_disk(nbd->disk, 0); @@ -311,11 +311,9 @@ static void nbd_size_update(struct nbd_device *nbd, bool start) blk_queue_physical_block_size(nbd->disk->queue, config->blksize); set_capacity(nbd->disk, nr_sectors); if (bdev) { - if (bdev->bd_disk) { + if (bdev->bd_disk) bd_set_nr_sectors(bdev, nr_sectors); - if (start) - set_blocksize(bdev, config->blksize); - } else + else set_bit(GD_NEED_PART_SCAN, &nbd->disk->state); bdput(bdev); } @@ -329,7 +327,7 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize, config->blksize = blocksize; config->bytesize = blocksize * nr_blocks; if (nbd->task_recv != NULL) - nbd_size_update(nbd, false); + nbd_size_update(nbd); } static void nbd_complete_rq(struct request *req) @@ -1309,7 +1307,7 @@ static int nbd_start_device(struct nbd_device *nbd) args->index = i; queue_work(nbd->recv_workq, &args->work); } - nbd_size_update(nbd, true); + nbd_size_update(nbd); return error; } |