public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iomap: hide iomap_sector with CONFIG_BLOCK=n
@ 2019-07-18 12:55 Arnd Bergmann
  2019-07-18 12:57 ` Christoph Hellwig
  0 siblings, 1 reply; 12+ messages in thread
From: Arnd Bergmann @ 2019-07-18 12:55 UTC (permalink / raw)
  To: Christoph Hellwig, Darrick J. Wong, linux-xfs, linux-fsdevel
  Cc: Arnd Bergmann, Christoph Hellwig, Andreas Gruenbacher,
	Hannes Reinecke, Souptick Joarder, linux-kernel

When CONFIG_BLOCK is disabled, SECTOR_SHIFT is unknown:

In file included from <built-in>:3:
include/linux/iomap.h:76:48: error: use of undeclared identifier 'SECTOR_SHIFT'
        return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT;

Since there are no callers in this case, just hide the function in
the same ifdef.

Fixes: db074436f421 ("iomap: move the direct IO code into a separate file")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/iomap.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index bc499ceae392..bb07f31e3b6f 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -70,11 +70,13 @@ struct iomap {
 	const struct iomap_page_ops *page_ops;
 };
 
+#ifdef CONFIG_BLOCK
 static inline sector_t
 iomap_sector(struct iomap *iomap, loff_t pos)
 {
 	return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT;
 }
+#endif
 
 /*
  * When a filesystem sets page_ops in an iomap mapping it returns, page_prepare
-- 
2.20.0

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

end of thread, other threads:[~2019-07-19  6:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-18 12:55 [PATCH] iomap: hide iomap_sector with CONFIG_BLOCK=n Arnd Bergmann
2019-07-18 12:57 ` Christoph Hellwig
2019-07-18 13:03   ` Arnd Bergmann
2019-07-18 13:08     ` Christoph Hellwig
2019-07-18 14:25       ` Darrick J. Wong
2019-07-19  2:19         ` Masahiro Yamada
2019-07-19  2:24           ` Randy Dunlap
2019-07-19  2:32             ` Masahiro Yamada
2019-07-19  5:58           ` Christoph Hellwig
2019-07-19  6:16             ` Masahiro Yamada
2019-07-19  6:19               ` Christoph Hellwig
2019-07-18 14:48       ` Arnd Bergmann

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