Re: [PATCH v4 20/21] iomap: pass iomap_iter_next_fn directly instead of struct iomap_ops
Joanne Koong <[email protected]> Wed, 29 Jul 2026 11:57:32 -0700
| Newsgroups | org.kernel.vger.linux-xfs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <CAJnrk1Z7Z3F3_Gee0Ej0n_0-2LPxJq=4rxmw=xg+e2ryoa6MNQ@mail.gmail.com> |
On Mon, Jul 27, 2026 at 3:33 PM Darrick J. Wong <[email protected]> wrote: > > > diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h > > index cffcec532ea6..d2d3c84d93f9 100644 > > --- a/fs/xfs/xfs_iomap.h > > +++ b/fs/xfs/xfs_iomap.h > > @@ -53,14 +53,22 @@ int xfs_read_iomap_begin(struct inode *inode, loff_t offset, > > loff_t length, unsigned flags, struct iomap *iomap, > > struct iomap *srcmap); > > > > -extern const struct iomap_ops xfs_buffered_write_iomap_ops; > > -extern const struct iomap_ops xfs_direct_write_iomap_ops; > > -extern const struct iomap_ops xfs_zoned_direct_write_iomap_ops; > > -extern const struct iomap_ops xfs_read_iomap_ops; > > -extern const struct iomap_ops xfs_seek_iomap_ops; > > -extern const struct iomap_ops xfs_xattr_iomap_ops; > > -extern const struct iomap_ops xfs_dax_write_iomap_ops; > > -extern const struct iomap_ops xfs_atomic_write_cow_iomap_ops; > > +int xfs_buffered_write_iomap_next(const struct iomap_iter *iter, > > + struct iomap *iomap, struct iomap *srcmap); > > I wonder, would it make more sense to have a macro to define the forward > declaration? e.g. > > #define DECLARE_IOMAP_NEXT(name) \ > int name(...) > > DECLARE_IOMAP_NEXT(xfs_buffered_write_iomap_next); > > Hm? > > Though feel free to say "declaration macros suck!" because they do. > Reviewed-by: "Darrick J. Wong" <[email protected]> > I think this makes sense given that the definitions are generated with macros. I'll include this change in v5. Thanks, Joanne