mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xfs: remove dax code from object file when disabled
@ 2016-07-21 12:07 Arnd Bergmann
  2016-07-21 12:15 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-07-21 12:07 UTC (permalink / raw)
  To: Dave Chinner, xfs
  Cc: Christoph Hellwig, Arnd Bergmann, Brian Foster, Al Viro,
	Ross Zwisler, Andrew Morton, Eric Sandeen, Matthew Wilcox,
	linux-kernel

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")
---
 fs/xfs/xfs_file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 8ffacb8bba19..ed95e5bb04e6 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -327,7 +327,7 @@ xfs_file_dio_aio_read(
 	return ret;
 }
 
-STATIC ssize_t
+static noinline ssize_t
 xfs_file_dax_read(
 	struct kiocb		*iocb,
 	struct iov_iter		*to)
@@ -706,7 +706,7 @@ out:
 	return ret;
 }
 
-STATIC ssize_t
+static noinline ssize_t
 xfs_file_dax_write(
 	struct kiocb		*iocb,
 	struct iov_iter		*from)
-- 
2.9.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: remove dax code from object file when disabled
  2016-07-21 12:07 [PATCH] xfs: remove dax code from object file when disabled Arnd Bergmann
@ 2016-07-21 12:15 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-07-21 12:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Dave Chinner, xfs, Christoph Hellwig, Brian Foster, Al Viro,
	Ross Zwisler, Andrew Morton, Eric Sandeen, Matthew Wilcox,
	linux-kernel

Thanks Arnd,

this looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-21 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21 12:07 [PATCH] xfs: remove dax code from object file when disabled Arnd Bergmann
2016-07-21 12:15 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®