diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-07-21 19:50:55 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-07-21 19:50:55 -0400 |
commit | f021bd071f06b545926b1031348873b05442139f (patch) | |
tree | bb6d3a60a3c9bcfcb1c8c5f63d63847b065b418e /fs/xfs | |
parent | 99579ccec4e271c3d4d4e7c946058766812afdab (diff) |
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: Arnd Bergmann <arnd@arndb.de>
Fixes: 16d4d43595b4 ("xfs: split direct I/O and DAX path")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index d97e8cb99a59..49fc9aca92d5 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -370,7 +370,7 @@ xfs_file_dio_aio_read( | |||
370 | return ret; | 370 | return ret; |
371 | } | 371 | } |
372 | 372 | ||
373 | STATIC ssize_t | 373 | static noinline ssize_t |
374 | xfs_file_dax_read( | 374 | xfs_file_dax_read( |
375 | struct kiocb *iocb, | 375 | struct kiocb *iocb, |
376 | struct iov_iter *to) | 376 | struct iov_iter *to) |
@@ -875,7 +875,7 @@ out: | |||
875 | return ret; | 875 | return ret; |
876 | } | 876 | } |
877 | 877 | ||
878 | STATIC ssize_t | 878 | static noinline ssize_t |
879 | xfs_file_dax_write( | 879 | xfs_file_dax_write( |
880 | struct kiocb *iocb, | 880 | struct kiocb *iocb, |
881 | struct iov_iter *from) | 881 | struct iov_iter *from) |