Re: [PATCH v2 02/18] xfs: convert iomap ops to ->iomap_next()

From: Christoph Hellwig

Date: Fri Jul 03 2026 - 08:53:21 EST


On Thu, Jul 02, 2026 at 09:48:06AM -0700, Darrick J. Wong wrote:
> 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__))

Don't go there. These variable number or argument macros are a
complete pain to undestand and generate horrible compiler warnings
whenever someone messes up their first attempt at writing some
code (guess who never gets the first pass right? :))