[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <091931b1-eb9c-e45e-c9e8-501554618508@gmail.com>
Date: Fri, 18 Sep 2020 11:52:39 +0300
From: Sergei Shtylyov <sergei.shtylyov@...il.com>
To: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>
Cc: Josef Bacik <josef@...icpanda.com>,
Minchan Kim <minchan@...nel.org>,
Stefan Haberland <sth@...ux.ibm.com>,
Jan Hoeppner <hoeppner@...ux.ibm.com>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, nbd@...er.debian.org,
linux-ide@...r.kernel.org, linux-s390@...r.kernel.org,
linux-fsdevel@...r.kernel.org, ocfs2-devel@....oracle.com,
linux-pm@...r.kernel.org, linux-mm@...ck.org,
linux-block@...r.kernel.org
Subject: Re: [PATCH 02/14] block: switch register_disk to use
blkdev_get_by_dev
Hello!
On 17.09.2020 19:57, Christoph Hellwig wrote:
> Use blkdev_get_by_dev instead of open coding it using bdget_disk +
> blkdev_get.
I don't see where you are removing bdget_disk() call (situated just before
the below code?)...
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> block/genhd.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index 7b56203c90a303..f778716fac6cde 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -732,10 +732,9 @@ static void register_disk(struct device *parent, struct gendisk *disk,
> goto exit;
>
> set_bit(GD_NEED_PART_SCAN, &disk->state);
> - err = blkdev_get(bdev, FMODE_READ, NULL);
> - if (err < 0)
> - goto exit;
> - blkdev_put(bdev, FMODE_READ);
> + bdev = blkdev_get_by_dev(disk_devt(disk), FMODE_READ, NULL);
> + if (!IS_ERR(bdev))
> + blkdev_put(bdev, FMODE_READ);
>
> exit:
> /* announce disk after possible partitions are created */
MBR, Sergei
Powered by blists - more mailing lists