Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f021bd07 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Dave Chinner
Browse files

xfs: remove dax code from object file when disabled



We check IS_DAX(inode) before calling either xfs_file_dax_read or
xfs_file_dax_write, and this will lead the call being optimized out at
compile time when CONFIG_FS_DAX is disabled.

However, the two functions are marked STATIC, so they become global
symbols when CONFIG_XFS_DEBUG is set, leaving us with two unused global
functions that call into an undefined function and a broken "allmodconfig"
build:

fs/built-in.o: In function `xfs_file_dax_read':
fs/xfs/xfs_file.c:348: undefined reference to `dax_do_io'
fs/built-in.o: In function `xfs_file_dax_write':
fs/xfs/xfs_file.c:758: undefined reference to `dax_do_io'

Marking the two functions 'static noinline' instead of 'STATIC' will let
the compiler drop the symbols when there are no callers but avoid the
implicit inlining.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 16d4d435 ("xfs: split direct I/O and DAX path")
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 99579cce
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -370,7 +370,7 @@ xfs_file_dio_aio_read(
	return ret;
	return ret;
}
}


STATIC ssize_t
static noinline ssize_t
xfs_file_dax_read(
xfs_file_dax_read(
	struct kiocb		*iocb,
	struct kiocb		*iocb,
	struct iov_iter		*to)
	struct iov_iter		*to)
@@ -875,7 +875,7 @@ xfs_file_dio_aio_write(
	return ret;
	return ret;
}
}


STATIC ssize_t
static noinline ssize_t
xfs_file_dax_write(
xfs_file_dax_write(
	struct kiocb		*iocb,
	struct kiocb		*iocb,
	struct iov_iter		*from)
	struct iov_iter		*from)