Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: brauner@kernel.org, hch@lst.de, willy@infradead.org,
	hsiangkao@linux.alibaba.com, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Dan Williams <djbw@kernel.org>, Gao Xiang <xiang@kernel.org>,
	Chao Yu <chao@kernel.org>, Yue Hu <zbestahu@gmail.com>,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	Sandeep Dhavale <dhavale@google.com>,
	Hongbo Li <lihongbo22@huawei.com>,
	Chunhai Guo <guochunhai@vivo.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Sungjong Seo <sj1557.seo@samsung.com>,
	Yuezhang Mo <yuezhang.mo@sony.com>, Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Baokun Li <libaokun@linux.alibaba.com>,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	Zhang Yi <yi.zhang@huawei.com>, Jaegeuk Kim <jaegeuk@kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>,
	Hyunchul Lee <hyc.lee@gmail.com>,
	Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	Carlos Maiolino <cem@kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <jth@kernel.org>,
	"open list:BLOCK LAYER" <linux-block@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:BTRFS FILE SYSTEM" <linux-btrfs@vger.kernel.org>,
	"open list:FILESYSTEM DIRECT ACCESS (DAX)"
	<nvdimm@lists.linux.dev>,
	"open list:EROFS FILE SYSTEM" <linux-erofs@lists.ozlabs.org>,
	"open list:EXT2 FILE SYSTEM" <linux-ext4@vger.kernel.org>,
	"open list:F2FS FILE SYSTEM"
	<linux-f2fs-devel@lists.sourceforge.net>,
	"open list:FUSE FILESYSTEM [CORE]" <fuse-devel@lists.linux.dev>,
	"open list:GFS2 FILE SYSTEM" <gfs2@lists.linux.dev>,
	"open list:NTFS3 FILESYSTEM" <ntfs3@lists.linux.dev>
Subject: Re: [PATCH v2 17/18] iomap: pass iomap_next_fn directly instead of struct iomap_ops
Date: Thu, 2 Jul 2026 18:42:55 -0700	[thread overview]
Message-ID: <20260703014255.GR9392@frogsfrogsfrogs> (raw)
In-Reply-To: <CAJnrk1YW0gKRVvHRC+WeKoV2vrquzaC6UkipZkQ34Z0RAQDjtg@mail.gmail.com>

On Thu, Jul 02, 2026 at 05:17:02PM -0700, Joanne Koong wrote:
> On Thu, Jul 2, 2026 at 9:58 AM Darrick J. Wong <djwong@kernel.org> wrote:
> >
> > > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> > > index 3f0932e46fd6..0aa8abc438c1 100644
> > > --- a/fs/iomap/buffered-io.c
> > > +++ b/fs/iomap/buffered-io.c
> > > @@ -626,7 +626,7 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,
> > >       return 0;
> > >  }
> > >
> > > -void iomap_read_folio(const struct iomap_ops *ops,
> > > +void iomap_read_folio(iomap_next_fn iomap_next,
> >
> > If you took my earlier suggestion to rename the typedef to
> > iomap_iter_fn, then this parameter ought to be named iter_fn.
> 
> Hmm... maybe at that point, it's self-explanatory enough that the arg
> could just be called "iter" instead of "iter_fn"?

Dunno.  Seeing as we already have variables named "iter" that are the
actual iteration state object, I think it's clearer to leave the
iteration function as "iter_fn".

> >
> > >               struct iomap_read_folio_ctx *ctx, void *private)
> > >  {
> > >       struct folio *folio = ctx->cur_folio;
> > > @@ -650,7 +650,7 @@ void iomap_read_folio(const struct iomap_ops *ops,
> > >               fsverity_readahead(ctx->vi, folio->index,
> > >                                  folio_nr_pages(folio));
> > >
> > > -     while ((ret = iomap_iter(&iter, ops)) > 0) {
> > > +     while ((ret = iomap_iter(&iter, iomap_next)) > 0) {
> > >               iter.status = iomap_read_folio_iter(&iter, ctx,
> > >                               &bytes_submitted);
> > >               iomap_read_submit(&iter, ctx);
> > > @@ -688,22 +688,22 @@ static int iomap_readahead_iter(struct iomap_iter *iter,
> > >
> > >  /**
> > >   * iomap_readahead - Attempt to read pages from a file.
> > > - * @ops: The operations vector for the filesystem.
> > > + * @iomap_next: The iomap_next callback for the filesystem.
> >
> > "The iomap iteration function for the filesystem" ?
> >
> > Using the term "iomap_next" in the definition for iomap_next isn't that
> > helpful.
> 
> Agreed, I'll replace this with your suggestion.

<nod>

> >
> > >       return ret;
> > > @@ -824,16 +824,16 @@ xfs_file_dio_write_atomic(
> > >       unsigned int            iolock = XFS_IOLOCK_SHARED;
> > >       ssize_t                 ret, ocount = iov_iter_count(from);
> > >       unsigned int            dio_flags = 0;
> > > -     const struct iomap_ops  *dops;
> > > +     iomap_next_fn           dops;
> > >
> > >       /*
> > >        * HW offload should be faster, so try that first if it is already
> > >        * known that the write length is not too large.
> > >        */
> > >       if (ocount > xfs_inode_buftarg(ip)->bt_awu_max)
> > > -             dops = &xfs_atomic_write_cow_iomap_ops;
> > > +             dops = xfs_atomic_write_cow_iomap_next;
> > >       else
> > > -             dops = &xfs_direct_write_iomap_ops;
> > > +             dops = xfs_direct_write_iomap_next;
> >
> > Probably ought to be called iter_fn, or at least something that isn't
> > "dops".
> 
> Nice spotting, I'll rename this in the next version.

<nod>

--D

> Thanks,
> Joanne
> 

  reply	other threads:[~2026-07-03  1:42 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01  0:09 [PATCH v2 00/18] iomap: convert to in-iter iomap_next() model Joanne Koong
2026-07-01  0:09 ` [PATCH v2 01/18] iomap: add ->iomap_next() and iomap_process() helper Joanne Koong
2026-07-02 14:00   ` Christoph Hellwig
2026-07-02 23:01     ` Joanne Koong
2026-07-02 16:23   ` Darrick J. Wong
2026-07-02 22:41     ` Joanne Koong
2026-07-01  0:09 ` [PATCH v2 02/18] xfs: convert iomap ops to ->iomap_next() Joanne Koong
2026-07-02 14:03   ` Christoph Hellwig
2026-07-02 16:48     ` Darrick J. Wong
2026-07-02 16:43   ` Darrick J. Wong
2026-07-02 23:59     ` Joanne Koong
2026-07-03  1:21       ` Joanne Koong
2026-07-03  1:41         ` Darrick J. Wong
2026-07-03  1:38       ` Darrick J. Wong
2026-07-01  0:09 ` [PATCH v2 03/18] btrfs: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 04/18] ntfs3: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 05/18] ntfs: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 06/18] ext4: " Joanne Koong
2026-07-01 10:01   ` Jan Kara
2026-07-01  0:09 ` [PATCH v2 07/18] erofs: " Joanne Koong
2026-07-01  0:41   ` Gao Xiang
2026-07-01  0:09 ` [PATCH v2 08/18] zonefs: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 09/18] ext2: " Joanne Koong
2026-07-01 10:02   ` Jan Kara
2026-07-01  0:09 ` [PATCH v2 10/18] block: " Joanne Koong
2026-07-01  0:55   ` Keith Busch
2026-07-02 14:03     ` Christoph Hellwig
2026-07-03  0:06     ` Joanne Koong
2026-07-01  0:09 ` [PATCH v2 11/18] f2fs: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 12/18] gfs2: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 13/18] hpfs: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 14/18] fuse: " Joanne Koong
2026-07-01  0:09 ` [PATCH v2 15/18] exfat: " Joanne Koong
2026-07-03  1:41   ` Joanne Koong
2026-07-01  0:09 ` [PATCH v2 16/18] iomap: remove ->iomap_begin()/->iomap_end() legacy path Joanne Koong
2026-07-02 14:04   ` Christoph Hellwig
2026-07-02 16:51   ` Darrick J. Wong
2026-07-01  0:09 ` [PATCH v2 17/18] iomap: pass iomap_next_fn directly instead of struct iomap_ops Joanne Koong
2026-07-01 10:04   ` Jan Kara
2026-07-02 14:07   ` Christoph Hellwig
2026-07-02 16:51     ` Darrick J. Wong
2026-07-03  1:47       ` Joanne Koong
2026-07-03  2:01         ` Darrick J. Wong
2026-07-03 10:37         ` Christian Brauner
2026-07-02 16:58   ` Darrick J. Wong
2026-07-03  0:17     ` Joanne Koong
2026-07-03  1:42       ` Darrick J. Wong [this message]
2026-07-01  0:09 ` [PATCH v2 18/18] Documentation: iomap: update docs to reflect iomap_next model Joanne Koong
2026-07-02 14:07   ` Christoph Hellwig
2026-07-02 19:26   ` Darrick J. Wong
2026-07-03  1:36     ` Joanne Koong
2026-07-03  2:00       ` Darrick J. Wong
2026-07-02 13:49 ` [PATCH v2 00/18] iomap: convert to in-iter iomap_next() model Christoph Hellwig
2026-07-03  1:08   ` Joanne Koong

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=20260703014255.GR9392@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=agruenba@redhat.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=chao@kernel.org \
    --cc=clm@fb.com \
    --cc=dhavale@google.com \
    --cc=djbw@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=dsterba@suse.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=gfs2@lists.linux.dev \
    --cc=guochunhai@vivo.com \
    --cc=hch@lst.de \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=hyc.lee@gmail.com \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=jefflexu@linux.alibaba.com \
    --cc=joannelkoong@gmail.com \
    --cc=jth@kernel.org \
    --cc=libaokun@linux.alibaba.com \
    --cc=lihongbo22@huawei.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=naohiro.aota@wdc.com \
    --cc=ntfs3@lists.linux.dev \
    --cc=nvdimm@lists.linux.dev \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=sj1557.seo@samsung.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=xiang@kernel.org \
    --cc=yi.zhang@huawei.com \
    --cc=yuezhang.mo@sony.com \
    --cc=zbestahu@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