[PATCH] iomap: hide iomap_sector with CONFIG_BLOCK=n

From: Arnd Bergmann
Date: Thu Jul 18 2019 - 08:56:02 EST


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@xxxxxxxx>
---
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