From: Song Liu <song@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
dm-devel@redhat.com,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
linux-block@vger.kernel.org, drbd-dev@lists.linbit.com,
linux-ide@vger.kernel.org,
linux-raid <linux-raid@vger.kernel.org>,
linux-mmc@vger.kernel.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH 4/9] md: don't detour through bd_contains for the gendisk
Date: Tue, 8 Sep 2020 17:55:48 -0700 [thread overview]
Message-ID: <CAPhsuW62Cd329s-LUR9uQVcFvn4pbOj7H0434P7zwRhbNVScgA@mail.gmail.com> (raw)
In-Reply-To: <20200903054104.228829-5-hch@lst.de>
On Wed, Sep 2, 2020 at 10:43 PM Christoph Hellwig <hch@lst.de> wrote:
>
> bd_disk is set on all block devices, including those for partitions.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Song Liu <song@kernel.org>
> ---
> drivers/md/md.c | 2 +-
> drivers/md/md.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 3f33562d10d6f5..5a0fd93769a70e 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8444,7 +8444,7 @@ static int is_mddev_idle(struct mddev *mddev, int init)
> idle = 1;
> rcu_read_lock();
> rdev_for_each_rcu(rdev, mddev) {
> - struct gendisk *disk = rdev->bdev->bd_contains->bd_disk;
> + struct gendisk *disk = rdev->bdev->bd_disk;
> curr_events = (int)part_stat_read_accum(&disk->part0, sectors) -
> atomic_read(&disk->sync_io);
> /* sync IO will cause sync_io to increase before the disk_stats
> diff --git a/drivers/md/md.h b/drivers/md/md.h
> index f9e2ccdd22c478..2175a5ac4f7c68 100644
> --- a/drivers/md/md.h
> +++ b/drivers/md/md.h
> @@ -551,7 +551,7 @@ extern void mddev_unlock(struct mddev *mddev);
>
> static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
> {
> - atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io);
> + atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
> }
>
> static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
> --
> 2.28.0
>
next prev parent reply other threads:[~2020-09-09 0:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 5:40 clean up is partition checks Christoph Hellwig
2020-09-03 5:40 ` [PATCH 1/9] Documentation/hdio: fix up obscure bd_contains references Christoph Hellwig
2020-09-03 5:40 ` [PATCH 2/9] block: add a bdev_is_partition helper Christoph Hellwig
2020-09-03 8:19 ` Ulf Hansson
2020-09-03 8:26 ` Christoph Hellwig
2020-09-03 5:40 ` [PATCH 3/9] md: compare bd_disk instead of bd_contains Christoph Hellwig
2020-09-09 0:55 ` Song Liu
2020-09-03 5:40 ` [PATCH 4/9] md: don't detour through bd_contains for the gendisk Christoph Hellwig
2020-09-09 0:55 ` Song Liu [this message]
2020-09-03 5:41 ` [PATCH 5/9] drbd: " Christoph Hellwig
2020-09-03 5:41 ` [PATCH 6/9] drbd: don't set ->bd_contains Christoph Hellwig
2020-09-03 5:41 ` [PATCH 7/9] target/iblock: fix holder printing in iblock_show_configfs_dev_params Christoph Hellwig
2020-09-03 5:41 ` [PATCH 8/9] block: use bd_partno in bdevname Christoph Hellwig
2020-09-03 5:41 ` [PATCH 9/9] vsprintf: use bd_partno in bdev_name Christoph Hellwig
2020-09-15 5:45 ` clean up is partition checks Christoph Hellwig
2020-09-25 14:19 ` Jens Axboe
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=CAPhsuW62Cd329s-LUR9uQVcFvn4pbOj7H0434P7zwRhbNVScgA@mail.gmail.com \
--to=song@kernel.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=drbd-dev@lists.linbit.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/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).