ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: Josef Bacik <josef@toxicpanda.com>,
	Minchan Kim <minchan@kernel.org>,
	Stefan Haberland <sth@linux.ibm.com>,
	Jan Hoeppner <hoeppner@linux.ibm.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, nbd@other.debian.org,
	linux-ide@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-pm@vger.kernel.org, linux-mm@kvack.org,
	linux-block@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 08/14] dasd: cleanup dasd_scan_partitions
Date: Mon, 21 Sep 2020 11:45:46 +0300	[thread overview]
Message-ID: <28f7f012-2787-2959-394e-cda480786ea9@gmail.com> (raw)
In-Reply-To: <20200921071958.307589-9-hch@lst.de>

Hello!

On 21.09.2020 10:19, Christoph Hellwig wrote:

> Use blkdev_get_by_dev instead of bdget_disk + blkdev_get.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   drivers/s390/block/dasd_genhd.c | 15 ++++-----------
>   1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
> index af5b0ecb8f8923..a9698fba9b76ce 100644
> --- a/drivers/s390/block/dasd_genhd.c
> +++ b/drivers/s390/block/dasd_genhd.c
> @@ -101,18 +101,11 @@ int dasd_scan_partitions(struct dasd_block *block)
>   	struct block_device *bdev;
>   	int rc;
>   
> -	bdev = bdget_disk(block->gdp, 0);
> -	if (!bdev) {
> -		DBF_DEV_EVENT(DBF_ERR, block->base, "%s",
> -			      "scan partitions error, bdget returned NULL");
> -		return -ENODEV;
> -	}
> -
> -	rc = blkdev_get(bdev, FMODE_READ, NULL);
> -	if (rc < 0) {
> +	bdev = blkdev_get_by_dev(disk_devt(block->gdp), FMODE_READ, NULL);
> +	if (IS_ERR(bdev)) {
>   		DBF_DEV_EVENT(DBF_ERR, block->base,
> -			      "scan partitions error, blkdev_get returned %d",
> -			      rc);
> +			      "scan partitions error, blkdev_get returned %ld",

    blkdev_get_by_dev() now?

> +			      PTR_ERR(bdev));
>   		return -ENODEV;
>   	}
>   

MBR, Sergei

  reply	other threads:[~2020-09-21  8:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  7:19 [Ocfs2-devel] remove blkdev_get as a public API v2 Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 01/14] block: move the NEED_PART_SCAN flag to struct gendisk Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 02/14] block: cleanup partition scanning in register_disk Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 03/14] block: cleanup blkdev_bszset Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 04/14] pktcdvd: remove the if 0'ed pkt_start_recovery function Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 05/14] pktcdvd: use blkdev_get_by_dev instead of open coding it Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 06/14] zram: cleanup backing_dev_store Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 07/14] raw: don't keep unopened block device around Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 08/14] dasd: cleanup dasd_scan_partitions Christoph Hellwig
2020-09-21  8:45   ` Sergei Shtylyov [this message]
2020-09-22 15:18   ` Stefan Haberland
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 09/14] ocfs2: cleanup o2hb_region_dev_store Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 10/14] mm: cleanup claim_swapfile Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 11/14] PM: rewrite is_hibernate_resume_dev to not require an inode Christoph Hellwig
2020-09-21 21:46   ` Pavel Machek
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 12/14] mm: split swap_type_of Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 13/14] PM: mm: cleanup swsusp_swap_check Christoph Hellwig
2020-09-21  7:19 ` [Ocfs2-devel] [PATCH 14/14] block: mark blkdev_get static Christoph Hellwig
2020-09-23 16:43 ` [Ocfs2-devel] remove blkdev_get as a public API v2 Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2020-09-17 16:57 [Ocfs2-devel] remove blkdev_get as a public API Christoph Hellwig
2020-09-17 16:57 ` [Ocfs2-devel] [PATCH 08/14] dasd: cleanup dasd_scan_partitions Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28f7f012-2787-2959-394e-cda480786ea9@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=hoeppner@linux.ibm.com \
    --cc=josef@toxicpanda.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=len.brown@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=nbd@other.debian.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sth@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).