From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@redhat.com>,
Jens Axboe <axboe@kernel.dk>,
linux-block <linux-block@vger.kernel.org>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH] block: don't use for-inside-for in bio_for_each_segment_all
Date: Sun, 7 Apr 2019 09:58:00 +0200 [thread overview]
Message-ID: <20190407075800.GA9925@lst.de> (raw)
In-Reply-To: <CACVXFVO9EAFtnspU0H4BNr4UCTry3q6icuHcXDB=c6Ura6BtMw@mail.gmail.com>
On Sun, Apr 07, 2019 at 03:54:16PM +0800, Ming Lei wrote:
> > OK, will move index check into mp_bvec_advance.
>
> oops, I recall the above line, because:
>
> 1) the index check expression is quite straight-forward
>
> 2) it has been in my todo list to re-use bvec_advance() to re-write
> iterate_bvec()
> given bvec_advance() is much light-weight than for_each_bvec(). If we
> move the index check into bvec_advance(), the helper has to be moved
> to bio.h, then we can't use that for iterate_bvec().
You can always create a tiny wrapper around bvec_advance() that sits
in bio.h. Which in general is much better style than complex
expressions inside of loops inside of macros..
next prev parent reply other threads:[~2019-04-07 7:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-06 21:54 [PATCH] block: don't use for-inside-for in bio_for_each_segment_all Ming Lei
2019-04-07 6:52 ` Christoph Hellwig
2019-04-07 7:37 ` Ming Lei
2019-04-07 7:38 ` Christoph Hellwig
2019-04-07 7:54 ` Ming Lei
2019-04-07 7:58 ` Christoph Hellwig [this message]
2019-04-07 8:13 ` Ming Lei
2019-04-08 6:07 ` Hannes Reinecke
2019-04-08 14:12 ` Matthew Wilcox
2019-04-09 9:48 ` Christoph Hellwig
2019-04-09 10:25 ` Johannes Thumshirn
2019-04-09 11:38 ` Matthew Wilcox
2019-04-09 15:36 ` David Sterba
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=20190407075800.GA9925@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=tom.leiming@gmail.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).