[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 14/24] pktcdvd: 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@xxxxxx>
---
 drivers/block/pktcdvd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 467dbd06b7cdb1..4326401cede445 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -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) {
-- 
2.28.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.