Return-Path: Received: from mout.kundenserver.de ([212.227.126.130]:38777 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbfGRM4A (ORCPT ); Thu, 18 Jul 2019 08:56:00 -0400 From: Arnd Bergmann Subject: [PATCH] iomap: hide iomap_sector with CONFIG_BLOCK=n Date: Thu, 18 Jul 2019 14:55:01 +0200 Message-Id: <20190718125509.775525-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Arnd Bergmann , Christoph Hellwig , Andreas Gruenbacher , Hannes Reinecke , Souptick Joarder , linux-kernel@vger.kernel.org When CONFIG_BLOCK is disabled, SECTOR_SHIFT is unknown: In file included from :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 --- 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