All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
	"Darrick J . Wong" <djwong@kernel.org>
Subject: Re: [PATCH 03/10] iomap: convert misc simple ops to incremental advance
Date: Thu, 13 Feb 2025 10:26:57 -0500	[thread overview]
Message-ID: <Z64PQasyLmDeze5n@bfoster> (raw)
In-Reply-To: <Z62XMuDSLOhF2DD7@infradead.org>

On Wed, Feb 12, 2025 at 10:54:42PM -0800, Christoph Hellwig wrote:
> > +	u64 length = iomap_length(iter);
> > +
> >  	switch (iomap->type) {
> >  	case IOMAP_MAPPED:
> >  	case IOMAP_UNWRITTEN:
> > @@ -132,7 +134,8 @@ static loff_t iomap_swapfile_iter(const struct iomap_iter *iter,
> >  			return error;
> >  		memcpy(&isi->iomap, iomap, sizeof(isi->iomap));
> >  	}
> > -	return iomap_length(iter);
> > +
> > +	return iomap_iter_advance(iter, &length);
> 
> I notice that for many of these callers passing in the length as in/out
> argument isn't all that great.  Not sure that's worth changing now (or
> adding another helper?).  The conversion itself looks good.
> 

Yes, I noticed the same when I changed it to an in/out param in the
previous series. Several callers end up needing a dummy local to
represent iomap_length(). I left it as is because I think this is the
lesser of two evils compared to the overloaded return situation, at
least for now, but I could also tack on a patch to introduce an
iomap_iter_advance_full(iter) (name?) or some such inline helper to
clean up these cases..

Brian


  reply	other threads:[~2025-02-13 15:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 13:57 [PATCH 00/10] iomap: incremental advance conversion -- phase 2 Brian Foster
2025-02-12 13:57 ` [PATCH 01/10] iomap: advance the iter directly on buffered read Brian Foster
2025-02-13  6:50   ` Christoph Hellwig
2025-02-13 15:24     ` Brian Foster
2025-02-12 13:57 ` [PATCH 02/10] iomap: advance the iter on direct I/O Brian Foster
2025-02-13  6:51   ` Christoph Hellwig
2025-02-13 15:25     ` Brian Foster
2025-02-12 13:57 ` [PATCH 03/10] iomap: convert misc simple ops to incremental advance Brian Foster
2025-02-13  6:54   ` Christoph Hellwig
2025-02-13 15:26     ` Brian Foster [this message]
2025-02-12 13:57 ` [PATCH 04/10] dax: advance the iomap_iter in the read/write path Brian Foster
2025-02-13  6:55   ` Christoph Hellwig
2025-02-13 15:27     ` Brian Foster
2025-02-12 13:57 ` [PATCH 05/10] dax: advance the iomap_iter on zero range Brian Foster
2025-02-13  6:57   ` Christoph Hellwig
2025-02-13 15:27     ` Brian Foster
2025-02-12 13:57 ` [PATCH 06/10] dax: advance the iomap_iter on unshare range Brian Foster
2025-02-12 13:57 ` [PATCH 07/10] dax: advance the iomap_iter on dedupe range Brian Foster
2025-02-12 13:57 ` [PATCH 08/10] dax: advance the iomap_iter on pte and pmd faults Brian Foster
2025-02-12 13:57 ` [PATCH 09/10] iomap: remove unnecessary advance from iomap_iter() Brian Foster
2025-02-13  6:59   ` Christoph Hellwig
2025-02-13 15:27     ` Brian Foster
2025-02-12 13:57 ` [PATCH 10/10] iomap: rename iomap_iter processed field to status Brian Foster
2025-02-13  7:00   ` Christoph Hellwig

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=Z64PQasyLmDeze5n@bfoster \
    --to=bfoster@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@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 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.