From: Christoph Hellwig <hch@infradead.org>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PoC PATCH 05/11] btrfs: scrub: add a writeback helper for scrub2_stripe
Date: Tue, 6 Dec 2022 00:45:12 -0800 [thread overview]
Message-ID: <Y48BGK3BDxSvsqiV@infradead.org> (raw)
In-Reply-To: <1e92cdad3b60464ed6f1cf4c0a24cac7d270e3ef.1670314744.git.wqu@suse.com>
> +static void scrub2_write_endio(struct btrfs_bio *bbio)
> +{
> + struct scrub2_stripe *stripe = bbio->private;
> + struct btrfs_fs_info *fs_info = stripe->bg->fs_info;
> + struct bio_vec *first_bvec = bio_first_bvec_all(&bbio->bio);
> + struct bio_vec *bvec;
> + struct bvec_iter_all iter_all;
> + unsigned long flags;
> + int bio_size = 0;
> + int first_sector_nr;
> + int i;
> +
> + bio_for_each_segment_all(bvec, &bbio->bio, iter_all)
> + bio_size += bvec->bv_len;
If you use bio_for_each_bvec_all instead the loop will be significantly
cheaper.
next prev parent reply other threads:[~2022-12-06 8:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 8:23 [PoC PATCH 00/11] btrfs: scrub: rework to get rid of the complex bio formshaping Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 01/11] btrfs: scrub: introduce the structure for new BTRFS_STRIPE_LEN based interface Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 02/11] btrfs: scrub: introduce a helper to find and fill the sector info for a scrub2_stripe Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 03/11] btrfs: scrub: introduce a helper to verify one scrub2_stripe Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 04/11] btrfs: scrub: add the repair function for scrub2_stripe Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 05/11] btrfs: scrub: add a writeback helper " Qu Wenruo
2022-12-06 8:45 ` Christoph Hellwig [this message]
2022-12-06 8:23 ` [PoC PATCH 06/11] btrfs: scrub: add the error reporting " Qu Wenruo
2022-12-06 18:48 ` kernel test robot
2022-12-06 8:23 ` [PoC PATCH 07/11] btrfs: scrub: add raid56 P/Q scrubbing support Qu Wenruo
2022-12-27 10:45 ` kernel test robot
2022-12-06 8:23 ` [PoC PATCH 08/11] btrfs: scrub: use dedicated super block verification function to scrub one super block Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 09/11] btrfs: scrub: switch to the new scrub2_stripe based infrastructure Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 10/11] btrfs: scrub: cleanup the old scrub_parity infrastructure Qu Wenruo
2022-12-06 8:23 ` [PoC PATCH 11/11] btrfs: scrub: cleanup scrub_extent() and its related functions Qu Wenruo
2022-12-06 8:40 ` [PoC PATCH 00/11] btrfs: scrub: rework to get rid of the complex bio formshaping Christoph Hellwig
2022-12-06 9:29 ` Qu Wenruo
2022-12-13 22:08 ` Josef Bacik
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=Y48BGK3BDxSvsqiV@infradead.org \
--to=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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