[PATCH] block: genhd: skip blk_register_region() for disk using ext-dev

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

 



It doesn't incur any harm now when the range parameter of
blk_register_region() is zero, but let's skip the useless call of
blk_register_region() for disk which uses ext-dev.

Signed-off-by: Hou Tao <houtao1@xxxxxxxxxx>
---
 block/genhd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 26b31fcae217..c61b59b550b0 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -739,8 +739,9 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
 		ret = bdi_register_owner(disk->queue->backing_dev_info,
 						disk_to_dev(disk));
 		WARN_ON(ret);
-		blk_register_region(disk_devt(disk), disk->minors, NULL,
-				    exact_match, exact_lock, disk);
+		if (disk->minors)
+			blk_register_region(disk_devt(disk), disk->minors, NULL,
+						exact_match, exact_lock, disk);
 	}
 	register_disk(parent, disk, groups);
 	if (register_queue)
-- 
2.22.0




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux