Skip to content

Commit

Permalink
dm: use set_capacity_and_notify
Browse files Browse the repository at this point in the history
Use set_capacity_and_notify to set the size of both the disk and block
device.  This also gets the uevent notifications for the resize for free.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 16, 2020
1 parent 8a6f7bb commit f64d9b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,8 +1974,7 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
if (size != dm_get_size(md))
memset(&md->geometry, 0, sizeof(md->geometry));

set_capacity(md->disk, size);
bd_set_nr_sectors(md->bdev, size);
set_capacity_and_notify(md->disk, size);

dm_table_event_callback(t, event_callback, md);

Expand Down

0 comments on commit f64d9b2

Please sign in to comment.