From: Song Liu <song-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Cc: Mike Snitzer <snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Linux-MM <linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org,
Naohiro Aota <naohiro.aota-Sjgp3cTcYWE@public.gmane.org>,
linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Chao Yu <chao-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Josef Bacik <josef-DigfWCa+lFGyeJad7bwFQA@public.gmane.org>,
Coly Li <colyli-l3A5Bk7waGM@public.gmane.org>,
linux-raid <linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Sterba <dsterba-IBi9RG/b67k@public.gmane.org>,
Jaegeuk Kim <jaegeuk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Ryusuke Konishi
<konishi.ryusuke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Damien Le Moal <damien.lemoal-Sjgp3cTcYWE@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Philipp Reisner
<philipp.reisner-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org>,
linux-f2fs-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Linux-Fsdevel
<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Lars Ellenberg
<lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org>,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 13/17] md: remove md_bio_alloc_sync
Date: Tue, 26 Jan 2021 23:22:46 -0800 [thread overview]
Message-ID: <CAPhsuW4AViTNjq1mp6zvbEJ8zKdK7__BfXEsvATTBWraK2u1Jg@mail.gmail.com> (raw)
In-Reply-To: <20210126145247.1964410-14-hch-jcswGhMUV9g@public.gmane.org>
On Tue, Jan 26, 2021 at 7:17 AM Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org> wrote:
>
> md_bio_alloc_sync is never called with a NULL mddev, and ->sync_set is
> initialized in md_run, so it always must be initialized as well. Just
> open code the remaining call to bio_alloc_bioset.
>
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Acked-by: Song Liu <song-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> drivers/md/md.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 6a27f52007c871..399c81bddc1ae1 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -340,14 +340,6 @@ static int start_readonly;
> */
> static bool create_on_open = true;
>
> -static struct bio *md_bio_alloc_sync(struct mddev *mddev)
> -{
> - if (!mddev || !bioset_initialized(&mddev->sync_set))
> - return bio_alloc(GFP_NOIO, 1);
> -
> - return bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set);
> -}
> -
> /*
> * We have a system wide 'event count' that is incremented
> * on any 'interesting' event, and readers of /proc/mdstat
> @@ -989,7 +981,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
> if (test_bit(Faulty, &rdev->flags))
> return;
>
> - bio = md_bio_alloc_sync(mddev);
> + bio = bio_alloc_bioset(GFP_NOIO, 1, &mddev->sync_set);
>
> atomic_inc(&rdev->nr_pending);
>
> --
> 2.29.2
>
next prev parent reply other threads:[~2021-01-27 7:22 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 14:52 misc bio allocation cleanups Christoph Hellwig
2021-01-26 14:52 ` [PATCH 01/17] zonefs: use bio_alloc in zonefs_file_dio_append Christoph Hellwig
2021-01-26 15:08 ` Johannes Thumshirn
2021-01-26 19:09 ` Chaitanya Kulkarni
2021-01-26 23:23 ` [dm-devel] " Damien Le Moal
2021-01-26 14:52 ` [PATCH 02/17] btrfs: use bio_kmalloc in __alloc_device Christoph Hellwig
[not found] ` <20210126145247.1964410-3-hch-jcswGhMUV9g@public.gmane.org>
2021-01-26 15:01 ` Josef Bacik
2021-01-26 19:11 ` Chaitanya Kulkarni
2021-01-26 14:52 ` [PATCH 03/17] blk-crypto: use bio_kmalloc in blk_crypto_clone_bio Christoph Hellwig
2021-01-26 21:51 ` Eric Biggers
2021-01-26 14:52 ` [PATCH 04/17] block: split bio_kmalloc from bio_alloc_bioset Christoph Hellwig
[not found] ` <20210126145247.1964410-5-hch-jcswGhMUV9g@public.gmane.org>
2021-01-30 3:56 ` Matthew Wilcox
2021-02-01 12:22 ` Christoph Hellwig
2021-01-26 14:52 ` [PATCH 05/17] block: use an on-stack bio in blkdev_issue_flush Christoph Hellwig
2021-01-26 19:15 ` Chaitanya Kulkarni
2021-01-26 14:52 ` [PATCH 06/17] dm-clone: use blkdev_issue_flush in commit_metadata Christoph Hellwig
2021-01-26 14:52 ` [PATCH 07/17] f2fs: use blkdev_issue_flush in __submit_flush_wait Christoph Hellwig
2021-01-29 1:03 ` Chao Yu
2021-01-26 14:52 ` [PATCH 08/17] f2fs: remove FAULT_ALLOC_BIO Christoph Hellwig
2021-01-28 16:11 ` Jaegeuk Kim
2021-01-29 1:04 ` Chao Yu
2021-01-26 14:52 ` [PATCH 09/17] drbd: remove bio_alloc_drbd Christoph Hellwig
2021-01-26 14:52 ` [PATCH 10/17] drbd: remove drbd_req_make_private_bio Christoph Hellwig
2021-01-26 14:52 ` [PATCH 11/17] md: remove bio_alloc_mddev Christoph Hellwig
[not found] ` <20210126145247.1964410-12-hch-jcswGhMUV9g@public.gmane.org>
2021-01-27 7:21 ` Song Liu
2021-01-26 14:52 ` [PATCH 12/17] md: simplify sync_page_io Christoph Hellwig
[not found] ` <20210126145247.1964410-13-hch-jcswGhMUV9g@public.gmane.org>
2021-01-27 7:22 ` Song Liu
2021-01-26 14:52 ` [PATCH 13/17] md: remove md_bio_alloc_sync Christoph Hellwig
[not found] ` <20210126145247.1964410-14-hch-jcswGhMUV9g@public.gmane.org>
2021-01-27 7:22 ` Song Liu [this message]
2021-01-26 14:52 ` [PATCH 14/17] md/raid6: refactor raid5_read_one_chunk Christoph Hellwig
2021-01-27 7:15 ` Song Liu
2021-01-26 14:52 ` [PATCH 15/17] nfs/blocklayout: remove cruft in bl_alloc_init_bio Christoph Hellwig
2021-01-26 14:52 ` [PATCH 16/17] nilfs2: remove cruft in nilfs_alloc_seg_bio Christoph Hellwig
2021-01-26 19:17 ` Chaitanya Kulkarni
[not found] ` <20210126145247.1964410-1-hch-jcswGhMUV9g@public.gmane.org>
2021-01-26 14:52 ` [PATCH 17/17] mm: remove get_swap_bio Christoph Hellwig
2021-01-27 16:52 ` misc bio allocation cleanups Jens Axboe
2021-02-01 1:16 ` Guoqing Jiang
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=CAPhsuW4AViTNjq1mp6zvbEJ8zKdK7__BfXEsvATTBWraK2u1Jg@mail.gmail.com \
--to=song-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=chao-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=colyli-l3A5Bk7waGM@public.gmane.org \
--cc=damien.lemoal-Sjgp3cTcYWE@public.gmane.org \
--cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org \
--cc=dsterba-IBi9RG/b67k@public.gmane.org \
--cc=hch-jcswGhMUV9g@public.gmane.org \
--cc=jaegeuk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=josef-DigfWCa+lFGyeJad7bwFQA@public.gmane.org \
--cc=konishi.ryusuke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=lars.ellenberg-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org \
--cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-f2fs-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=naohiro.aota-Sjgp3cTcYWE@public.gmane.org \
--cc=philipp.reisner-63ez5xqkn6DQT0dZR+AlfA@public.gmane.org \
--cc=snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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).