Skip to content

Commit f64d9b2

Browse files
Christoph Hellwigaxboe
authored andcommitted
dm: use set_capacity_and_notify
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>
1 parent 8a6f7bb commit f64d9b2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/dm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,8 +1974,7 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
19741974
if (size != dm_get_size(md))
19751975
memset(&md->geometry, 0, sizeof(md->geometry));
19761976

1977-
set_capacity(md->disk, size);
1978-
bd_set_nr_sectors(md->bdev, size);
1977+
set_capacity_and_notify(md->disk, size);
19791978

19801979
dm_table_event_callback(t, event_callback, md);
19811980

0 commit comments

Comments
 (0)