From 6029a06c88b925467cb43e4b57dcede88f0457eb Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Wed, 6 May 2015 12:26:26 +0800 Subject: block: dasd_genhd: convert to blkdev_reread_part Also remove the obsolete comment. Reviewed-by: Christoph Hellwig Tested-by: Jarod Wilson Acked-by: Jarod Wilson Acked-by: Sebastian Ott Signed-off-by: Ming Lei Signed-off-by: Jens Axboe --- drivers/s390/block/dasd_genhd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 90f39f79f5d7..2af461923683 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -116,14 +116,11 @@ int dasd_scan_partitions(struct dasd_block *block) rc); return -ENODEV; } - /* - * See fs/partition/check.c:register_disk,rescan_partitions - * Can't call rescan_partitions directly. Use ioctl. - */ - rc = ioctl_by_bdev(bdev, BLKRRPART, 0); + + rc = blkdev_reread_part(bdev); while (rc == -EBUSY && retry > 0) { schedule(); - rc = ioctl_by_bdev(bdev, BLKRRPART, 0); + rc = blkdev_reread_part(bdev); retry--; DBF_DEV_EVENT(DBF_ERR, block->base, "scan partitions error, retry %d rc %d", -- cgit v1.2.1 From a05e578055d7f9ec2d5c4465933eb424c4e8e25b Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Wed, 6 May 2015 12:26:28 +0800 Subject: s390/block/dasd: remove obsolete while -EBUSY loop With the mutex_trylock bit gone from blkdev_reread_part(), the retry logic in dasd_scan_partitions() shouldn't be necessary. CC: Christoph Hellwig CC: Jens Axboe CC: Tejun Heo CC: Alexander Viro CC: Markus Pargmann CC: Stefan Weinhuber CC: Stefan Haberland CC: Sebastian Ott CC: Fabian Frederick CC: Ming Lei CC: David Herrmann CC: Andrew Morton CC: Peter Zijlstra CC: nbd-general@lists.sourceforge.net CC: linux-s390@vger.kernel.org Reviewed-by: Christoph Hellwig Acked-by: Sebastian Ott Signed-off-by: Ming Lei Signed-off-by: Jarod Wilson Signed-off-by: Jens Axboe --- drivers/s390/block/dasd_genhd.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 2af461923683..ef1d9fb06cab 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -99,9 +99,8 @@ void dasd_gendisk_free(struct dasd_block *block) int dasd_scan_partitions(struct dasd_block *block) { struct block_device *bdev; - int retry, rc; + int rc; - retry = 5; bdev = bdget_disk(block->gdp, 0); if (!bdev) { DBF_DEV_EVENT(DBF_ERR, block->base, "%s", @@ -118,14 +117,9 @@ int dasd_scan_partitions(struct dasd_block *block) } rc = blkdev_reread_part(bdev); - while (rc == -EBUSY && retry > 0) { - schedule(); - rc = blkdev_reread_part(bdev); - retry--; + if (rc) DBF_DEV_EVENT(DBF_ERR, block->base, - "scan partitions error, retry %d rc %d", - retry, rc); - } + "scan partitions error, rc %d", rc); /* * Since the matching blkdev_put call to the blkdev_get in -- cgit v1.2.1