public inbox for linux-xfs@vger.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
Subject: Re: [PATCH] iomap: replace folio_batch allocation with stack allocation
Date: Wed, 12 Nov 2025 07:35:33 -0500	[thread overview]
Message-ID: <aRR_FdE96gzkskqP@bfoster> (raw)
In-Reply-To: <aRRHzBlw6pc3cQjr@infradead.org>

On Wed, Nov 12, 2025 at 12:39:40AM -0800, Christoph Hellwig wrote:
> On Tue, Nov 11, 2025 at 12:50:47PM -0500, Brian Foster wrote:
> >  		if (imap.br_state == XFS_EXT_UNWRITTEN &&
> >  		    offset_fsb < eof_fsb) {
> > -			loff_t len = min(count,
> > -					 XFS_FSB_TO_B(mp, imap.br_blockcount));
> > +			loff_t foffset = offset, fend;
> >  
> > -			end = iomap_fill_dirty_folios(iter, offset, len);
> > +			fend = offset +
> > +			       min(count, XFS_FSB_TO_B(mp, imap.br_blockcount));
> > +			iomap_flags |= iomap_fill_dirty_folios(iter, &foffset,
> > +							       fend);
> >  			end_fsb = min_t(xfs_fileoff_t, end_fsb,
> > -					XFS_B_TO_FSB(mp, end));
> > +					XFS_B_TO_FSB(mp, foffset));
> 
> Maybe it's just me, but I found the old calling convention a lot more
> logic.  Why not keep it and extend it for passing the flags as an
> in/out argument?  That would also keep the churn down a bit.
> 

Hmm.. well I never really loved the flag return (or the end return), but
I wanted to make the iomap helper more consistent with the underlying
filemap helper because I think that reduces unnecessary complexity. I
suppose we could also make the flags an out param and either return void
or just pass through the filemap helper return (i.e. folio count)...

Brian

> Otherwise the change looks good.
> 


  reply	other threads:[~2025-11-12 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 17:50 [PATCH] iomap: replace folio_batch allocation with stack allocation Brian Foster
2025-11-12  8:39 ` Christoph Hellwig
2025-11-12 12:35   ` Brian Foster [this message]
2025-11-12 12:53     ` 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=aRR_FdE96gzkskqP@bfoster \
    --to=bfoster@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox