All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Mikulas Patocka <mpatocka@redhat.com>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	Dave Chinner <dchinner@redhat.com>,
	linux-fsdevel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V5 1/6] loop: add helper lo_cmd_nr_bvec()
Date: Thu, 16 Oct 2025 10:19:07 +0800	[thread overview]
Message-ID: <aPBWGzcuqENGqwAJ@fedora> (raw)
In-Reply-To: <5692dd74-ab1c-4451-9d28-b436ee658f6e@acm.org>

On Wed, Oct 15, 2025 at 08:49:45AM -0700, Bart Van Assche wrote:
> On 10/15/25 4:07 AM, Ming Lei wrote:
> > +static inline unsigned lo_cmd_nr_bvec(struct loop_cmd *cmd)
> > +{
> > +	struct request *rq = blk_mq_rq_from_pdu(cmd);
> > +	struct req_iterator rq_iter;
> > +	struct bio_vec tmp;
> > +	int nr_bvec = 0;
> > +
> > +	rq_for_each_bvec(tmp, rq, rq_iter)
> > +		nr_bvec++;
> > +
> > +	return nr_bvec;
> > +}
> 
> 'cmd' is not used in this function other than in the conversion to a
> struct request. Has it been considered to change the argument type of
> this function from 'struct loop_cmd *' into 'struct request *'? That
> will allow to leave out the blk_mq_rq_from_pdu() from this function.
> Otherwise this patch looks good to me.

It isn't one big deal, I can switch to `request *` if respin is needed,
otherwise I'd leave it as it is. 


Thanks,
Ming


  reply	other threads:[~2025-10-16  2:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 11:07 [PATCH V5 0/6] loop: improve loop aio perf by IOCB_NOWAIT Ming Lei
2025-10-15 11:07 ` [PATCH V5 1/6] loop: add helper lo_cmd_nr_bvec() Ming Lei
2025-10-15 15:49   ` Bart Van Assche
2025-10-16  2:19     ` Ming Lei [this message]
2025-10-15 11:07 ` [PATCH V5 2/6] loop: add helper lo_rw_aio_prep() Ming Lei
2025-10-15 11:07 ` [PATCH V5 3/6] loop: add lo_submit_rw_aio() Ming Lei
2025-10-15 11:07 ` [PATCH V5 4/6] loop: move command blkcg/memcg initialization into loop_queue_work Ming Lei
2025-10-15 11:07 ` [PATCH V5 5/6] loop: try to handle loop aio command via NOWAIT IO first Ming Lei
2025-10-15 11:07 ` [PATCH V5 6/6] loop: add hint for handling aio via IOCB_NOWAIT Ming Lei
2025-11-18 12:55 ` [PATCH V5 0/6] loop: improve loop aio perf by IOCB_NOWAIT Ming Lei
2025-11-18 15:38 ` Jens Axboe
2025-11-24  6:12 ` calling into file systems directly from ->queue_rq, was " Christoph Hellwig
2025-11-24  9:02   ` Ming Lei
2025-11-24  9:05     ` Christoph Hellwig
2025-11-25  3:00       ` Ming Lei
2025-11-25  3:56         ` Jens Axboe
2025-11-25  7:26         ` Gao Xiang
2025-11-25  9:19           ` Ming Lei
2025-11-25  9:39             ` Gao Xiang
2025-11-25 10:13               ` Gao Xiang
2025-11-25 10:41               ` Ming Lei
2025-11-25 10:57                 ` Gao Xiang
2025-11-25 11:10                   ` Christoph Hellwig
2025-11-25 11:48                   ` Ming Lei
2025-11-25 11:58                     ` Gao Xiang
2025-11-25 12:18                       ` Ming Lei
2025-11-25 15:16                         ` Gao Xiang

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=aPBWGzcuqENGqwAJ@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=zhaoyang.huang@unisoc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.