Re: [PATCH v2 02/18] xfs: convert iomap ops to ->iomap_next()
From: Darrick J. Wong
Date: Thu Jul 02 2026 - 13:02:48 EST
On Thu, Jul 02, 2026 at 04:03:01PM +0200, Christoph Hellwig wrote:
> > - * The retry mechanism is based on the ->iomap_begin method returning
> > + * The retry mechanism is based on the ->iomap_next method returning
>
> Nit: Maybe the drop the "->" in preparation of the last patch that would
> make it slightly misleading with the ops struct removal?
>
> > +static int
> > +xfs_direct_write_iomap_next(
> > + const struct iomap_iter *iter,
> > + struct iomap *iomap,
> > + struct iomap *srcmap)
> > +{
> > + return iomap_process(iter, iomap, srcmap, xfs_direct_write_iomap_begin,
> > + NULL);
> > +}
>
> I wonder if we want a "simple" version of iomap_process that only takes
> a begin callback, as most current ops seems to be that way. Then again
> between needing at least one longer function name it's probably not
> helping much with readability. So not sure, just dropping it here if
> anyone has a good idea or storng opinion.
You /could/ use a bunch of fugly macros to simulate a default NULL
iomap_end_fn parameter.
#define __default_iomap_end(a,b,...) b
#define default_iomap_end(...) __default_iomap_end(,##__VA_ARGS,NULL)
#define iomap_process(iter, iomap, srcmap, iomap_begin, ...) \
__iomap_process((iter), (iomap), (srcmap), (iomap_begin),
default_iomap_end(__VA_ARGS__))
--D
>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>