Re: [PATCH 3/6] xfs: simplify xfs_dax_fault

Darrick J. Wong
2024-06-21T17:43:58Z

On Fri, Jun 21, 2024 at 07:05:58AM +0200, Christoph Hellwig wrote:
> On Thu, Jun 20, 2024 at 11:50:26AM -0700, Darrick J. Wong wrote:
> > > + if (!IS_ENABLED(CONFIG_FS_DAX)) {
> > > + ASSERT(0);
> > > + return VM_FAULT_SIGBUS;
> >
> > Does this actually work if FS_DAX=n? AFAICT there's no !DAX stub for
> > dax_iomap_fault, so won't that cause a linker error?
>
> IS_ENABLED expands to a compile time constant, so the compiler eliminates
> the call and no stub is needed.

Huh, that actually links. I am astonished.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D