Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] block: genhd: skip blk_register_region() for disk using ext-dev
@ 2019-11-11  1:49 Hou Tao
  2020-02-11 13:15 ` Hou Tao
  0 siblings, 1 reply; 2+ messages in thread
From: Hou Tao @ 2019-11-11  1:49 UTC (permalink / raw)
  To: linux-block; +Cc: Jens Axboe

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@huawei.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: genhd: skip blk_register_region() for disk using ext-dev
  2019-11-11  1:49 [PATCH] block: genhd: skip blk_register_region() for disk using ext-dev Hou Tao
@ 2020-02-11 13:15 ` Hou Tao
  0 siblings, 0 replies; 2+ messages in thread
From: Hou Tao @ 2020-02-11 13:15 UTC (permalink / raw)
  To: linux-block; +Cc: Jens Axboe

ping ?

On 2019/11/11 9:49, Hou Tao wrote:
> 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@huawei.com>
> ---
>  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)
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11  1:49 [PATCH] block: genhd: skip blk_register_region() for disk using ext-dev Hou Tao
2020-02-11 13:15 ` Hou Tao

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git