From patchwork Mon May 15 13:44:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9727005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A9FC6028A for ; Mon, 15 May 2017 13:47:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B833285E7 for ; Mon, 15 May 2017 13:47:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 705C7285EC; Mon, 15 May 2017 13:47:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECC74285E7 for ; Mon, 15 May 2017 13:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964901AbdEONrG (ORCPT ); Mon, 15 May 2017 09:47:06 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52027 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933582AbdEONrF (ORCPT ); Mon, 15 May 2017 09:47:05 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lvg76-1e4FhB1NyW-017YAA; Mon, 15 May 2017 15:45:49 +0200 From: Arnd Bergmann To: Dan Williams Cc: Jan Kara , Geert Uytterhoeven , linux-xfs@vger.kernel.org, "Darrick J . Wong" , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] fs: xfs: add DAX dependency Date: Mon, 15 May 2017 15:44:01 +0200 Message-Id: <20170515134508.2713243-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170515134508.2713243-1-arnd@arndb.de> References: <20170515134508.2713243-1-arnd@arndb.de> X-Provags-ID: V03:K0:5HV1YF5dz81xvLWOGAgGwf9KCYcGr+itKEANIB6NIqkGGasp3/F wuwkgdgRPK805AgJq7yyWOxEXYElyQuTFCXhXZzc0Ee3YFqeP266dwITErLjQwpGoA+rbMg 5Bhe7cPl6vAzDfl73Lcx46rOHBAmyGAb3w1p3nygP92aK+WtEH7SzQvx0zTGaoDG7svMQ8s W4jQl9Yv61d4qJcaiE3fA== X-UI-Out-Filterresults: notjunk:1; V01:K0:23K6+O/7qSc=:5LwYsg6KvDStDR95WlYvjC pRffy2hnA5b3MBIrrKfFA7MCmN0F7J+oJSVFBXnr+Hbsf74dLTWZ2ZmiBQxb7gGLs4/bXgIIE T+6xeS0zHrHPj5HEAfrkmECfQOpyJON5+8Gl0YlVJMUQ1rUiLcQfUXw5V+4nSW+gNGnekkNKv cfbKCdguQw22StH9saKxfdrO1ULDkzFL8HyyV1WxPjjxZwHCm/Eohl3EnNGCLbMQ8pWr/4D+K jirOGvqfdERWrd8GCpAM5BSnwzBtm4EJlz/vWjYGqI3rspsyEQfYR2eW6qJB3PMSgpBGyP3uf 1X01lSoOIQtrJr6hy3ozxj+/fFLp2bhNBks9Z2y1CpDD2sjmpYAMZ30xLgFr41aE2j/vl6MGA C0qUjopE62eNL6mjLfaC+M6MRLTcqu6skcIbiIAMsibz6S7qgfsp7qq0Mt4QFlExRuDMWwKYT Nu78yuaa+4I/XMMqpBFWFOv8+5Y4pVXE8GfwuaNY2F57HOmamFpbY6yFk4XED2f7ujuAqwysj eAwquPhvUwGYyRTn4ebOv4VL8awhgTA12izeO6qgkrJEgPxPRcbriDRHml6ldhrF7r0YQYVwk hARXdAaKz5Grf6/hXGgXmUNzIF3orMuCPSLOzV7f8GlBg7uuE40jApk16CUi4V3/1ffCHNAWP fmN+uw3rxsmjGNt8bXIqPjaGo63fSpfI84LwJmzK9E1YPgvOsiLM5PxNzWAaY/4RkpMM= Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We can now build xfs while CONFIG_DAX is set to 'm', resulting in a link error when xfs is built-in: fs/xfs/xfs_iomap.o: In function `xfs_file_iomap_end': fs/xfs/xfs_iomap.c:1152: undefined reference to `put_dax' fs/xfs/xfs_iomap.o: In function `xfs_file_iomap_begin': fs/xfs/xfs_iomap.c:1071: undefined reference to `dax_get_by_host' Previously, XFS could only be built with CONFIG_DAX=y because of the CONFIG_BLOCK dependency. The other users of dax handle this differently: - In ext2 and ext4, there are checks for CONFIG_FS_DAX around every API usage, and CONFIG_FS_DAX is only enabled when CONFIG_DAX is built-in. - CONFIG_BLK_DEV_MD implies 'select DAX', so it's always enabled there as well. This changes XFS to do the same as ext2/4 and only call into the API conditionally. Fixes: ef51042472f5 ("block, dax: move "select DAX" from BLOCK to FS_DAX") Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_iomap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index a63f61c256bd..b732ba6f892c 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -1067,7 +1067,7 @@ xfs_file_iomap_begin( /* optionally associate a dax device with the iomap bdev */ bdev = iomap->bdev; - if (blk_queue_dax(bdev->bd_queue)) + if (IS_ENABLED(CONFIG_FS_DAX) && blk_queue_dax(bdev->bd_queue)) iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name); else iomap->dax_dev = NULL; @@ -1149,7 +1149,9 @@ xfs_file_iomap_end( unsigned flags, struct iomap *iomap) { - put_dax(iomap->dax_dev); + if (IS_ENABLED(CONFIG_FS_DAX)) + put_dax(iomap->dax_dev); + if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC) return xfs_file_iomap_end_delalloc(XFS_I(inode), offset, length, written, iomap);