]> www.infradead.org Git - users/hch/block.git/commitdiff
pktcdvd: use set_capacity_and_notify
authorChristoph Hellwig <hch@lst.de>
Wed, 4 Nov 2020 14:51:11 +0000 (15:51 +0100)
committerChristoph Hellwig <hch@lst.de>
Sat, 14 Nov 2020 17:22:22 +0000 (18:22 +0100)
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>
drivers/block/pktcdvd.c

index 467dbd06b7cdb13a860a7b717dbd4320e92002f2..4326401cede445d1c1256b89943d09347fecddc3 100644 (file)
@@ -2130,8 +2130,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write)
        }
 
        set_capacity(pd->disk, lba << 2);
-       set_capacity(pd->bdev->bd_disk, lba << 2);
-       bd_set_nr_sectors(pd->bdev, lba << 2);
+       set_capacity_and_notify(pd->bdev->bd_disk, lba << 2);
 
        q = bdev_get_queue(pd->bdev);
        if (write) {