linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dax: try to avoid unused function warnings
@ 2016-11-28 21:12 Arnd Bergmann
  2016-11-28 21:24 ` Ross Zwisler
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2016-11-28 21:12 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: Ross Zwisler, Arnd Bergmann, Alexander Viro, Matthew Wilcox,
	Jan Kara, Andrew Morton, Dave Chinner, Dan Williams,
	linux-fsdevel, linux-kernel

Without the get_block based I/O, we get warnings when CONFIG_FS_IOMAP
is disabled:

fs/dax.c:736:12: error: ‘dax_insert_mapping’ defined but not used [-Werror=unused-function]
fs/dax.c:512:12: error: ‘copy_user_dax’ defined but not used [-Werror=unused-function]
fs/dax.c:490:12: error: ‘dax_load_hole’ defined but not used [-Werror=unused-function]
fs/dax.c:294:14: error: ‘grab_mapping_entry’ defined but not used [-Werror=unused-function]

This patch blindly marks those as __maybe_unused, which avoids the warnings.
However, I suspect that there is actually more code in this file that should
not be provided without CONFIG_FS_IOMAP even though we don't get a warning
for it, and that we actually want a different rework, so please treat this
as a bug report. I have applied the patch locally in my randconfig build
setup to avoid seeing the warnings.

Fixes: 5ac65736f740 ("dax: rip out get_block based IO support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/dax.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index b1fe228cd609..cf844e77b7b7 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -309,7 +309,7 @@ static void put_unlocked_mapping_entry(struct address_space *mapping,
  * persistent memory the benefit is doubtful. We can add that later if we can
  * show it helps.
  */
-static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index,
+static __maybe_unused void * grab_mapping_entry(struct address_space *mapping, pgoff_t index,
 		unsigned long size_flag)
 {
 	bool pmd_downgrade = false; /* splitting 2MiB entry into 4k entries? */
@@ -489,7 +489,7 @@ int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index)
  * otherwise it will simply fall out of the page cache under memory
  * pressure without ever having been dirtied.
  */
-static int dax_load_hole(struct address_space *mapping, void *entry,
+static int __maybe_unused dax_load_hole(struct address_space *mapping, void *entry,
 			 struct vm_fault *vmf)
 {
 	struct page *page;
@@ -509,7 +509,7 @@ static int dax_load_hole(struct address_space *mapping, void *entry,
 	return VM_FAULT_LOCKED;
 }
 
-static int copy_user_dax(struct block_device *bdev, sector_t sector, size_t size,
+static int __maybe_unused copy_user_dax(struct block_device *bdev, sector_t sector, size_t size,
 		struct page *to, unsigned long vaddr)
 {
 	struct blk_dax_ctl dax = {
@@ -815,7 +815,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
 }
 EXPORT_SYMBOL_GPL(dax_writeback_mapping_range);
 
-static int dax_insert_mapping(struct address_space *mapping,
+static int __maybe_unused dax_insert_mapping(struct address_space *mapping,
 		struct block_device *bdev, sector_t sector, size_t size,
 		void **entryp, struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-- 
2.9.0

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

end of thread, other threads:[~2017-01-11  9:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 21:12 [PATCH] dax: try to avoid unused function warnings Arnd Bergmann
2016-11-28 21:24 ` Ross Zwisler
2016-11-28 22:13   ` Dan Williams
2016-11-28 22:51     ` Ross Zwisler
2016-11-28 23:08       ` Dan Williams
2016-11-29  2:10         ` Dave Chinner
2017-01-10 16:15   ` Arnd Bergmann
2017-01-10 19:44     ` Ross Zwisler
2017-01-10 22:29     ` [PATCH] dax: fix build warnings with FS_DAX and !FS_IOMAP Ross Zwisler
2017-01-11  8:15       ` Jan Kara
2017-01-11  9:02       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).