From patchwork Mon May 15 13:44:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 99813 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1554589qge; Mon, 15 May 2017 06:46:55 -0700 (PDT) X-Received: by 10.84.202.12 with SMTP id w12mr8685925pld.55.1494856015029; Mon, 15 May 2017 06:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494856015; cv=none; d=google.com; s=arc-20160816; b=rM8rDQ5DsVhf0cRGeipRewwc/35GmRtMkfXFvRn29WGp1EaVXiiZX6iPc6mfc+tlr2 cO7NscqhsOjVG2HMpbvr3Mqd2tCZygxOy3R4NnsSXoXfPH0CG+8pPebpSCTxNuJh5aen OuAlYYYnHHuHDPg4JIdUCY9nngi6ZL+fMswa76DLXX3l98Ro6iQCO1RlLobhqdMLa5EC 85ioOcDUYqT61RGFGnKsBUzzSqWL6n7SDD45FW6cenr63BwoUvQVOSl7Ps8HJkzfn292 vyhtvlebs6tRU61sfi/NeLJYeeGUN5QdJo/1TkFd/qQUdp5lbdZhPzwnx9RBQj4WMCBM MJYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nK/y4Jwp6XdPK1UTl3Q0XpELM2+E3wVhlDOP6t9ZYAE=; b=HWP5IwhXWNhEqhftSy8XyTob4Mrzq4fv2cSh8uHPF38KK+vRl8/Q1jZOct8D7j8nH6 k4O4uObdHlHeSwFD7fQusUHeBpeR/8eQLlo1wA1lQR2FrNC4TJ+MIyKuqfA08sAfDXvZ 7RUDFdIRU76RI3oC2B7CPZ46YeZx6eHtfdbk9NnpT3iuJrQ4rE6LXcVS1/povjsLgo4/ onEilnJkUTpIWMphgWjl2jrvSLmX7BCwWLt3LYLtINFBR+VpPE6UtvO6jtxZ5rIsYAOd mM89XM8iYdVqQdURKzmagmpC/+oSppDZHmC2t8HATibLgtRfUM4/Ig4LYyOwJgdn9q7o EqVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si10311306pld.109.2017.05.15.06.46.54; Mon, 15 May 2017 06:46:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964897AbdEONqq (ORCPT + 25 others); Mon, 15 May 2017 09:46:46 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:60694 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933582AbdEONqo (ORCPT ); Mon, 15 May 2017 09:46:44 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MVYtf-1dVT7B3Q4t-00Z2Yf; Mon, 15 May 2017 15:45:26 +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 1/2] dax: hide block device code in #ifdef Date: Mon, 15 May 2017 15:44:00 +0200 Message-Id: <20170515134508.2713243-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:H4zknGhZlMUyz5IMg3/PBT9uWzq3CVMNhNnL9Z9xcnZi3FjWt0/ n6igmkBxDsBD4XpHLwO7dGDijz/CTdQNtbGkhplpz9VFB/aJbtf+HE/xei/QKPKc9sdDvAL ASTXqgjoNxVYGdlPCujavWob7jKJL5bXWFxaXKnb4Swo5jJXKDpMYTXKPCMgyf0wSNjTChf 1KP9sEwVsA8Z4Jtr4mLgQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:pvfv6cYJxMg=:nbYHn7A36QEIgMhddXUCfZ Bfn/gxAmJEtcy8GukkNsmoAgDFv0QJX0gZARw9ZCcPRiEuZCiPAryw31KuPgKHwcqQUyUzKno c9+Fu03CeCdKVQHGmRcTuMzqwvrz3u6FK4iS7GOl5kfan0r97Ktmr6vjyt0V0wgjVGGcHtP5b 5sf5rgktXMK0Ldc4AJKVsCseaS0cJJRVS9+HyzD8GNgsPu674nzhjOaB8yCPeCOhQ03YR0Jp7 FYB/bF3bo35ivYKSMOxr+ii+JckyC6f9nvSXQMHG+du5EvcwFHltTKSv0ZEVo7aa+gslM1MeH s0mzejS2zrdtj2I8eRjvPoYZUGouf2gavQSiUNhUT5vtFOUc/cLaRyzi/IdadvtReivcMp/Xl Vmqr7ovXny96hLdDHJ1Q+mIFXUVrK78TVqAoLnlP6jFHWdokrmt0pN3zl6Gh6NJwvyQKLoq1/ fAyKIpy677gQ5uyIR13AQKbm3bEUWMumWrVqQD9TlG9jnwks0xr+1fTMnEQoNuDaLAsnZMmpO 4XG8X3TxbYAHloob9VArafF1Pef+yaFyUiSeSnFn/ncoIzkS9pCCvV+8wBhdLcEgvddyarVPO CES3XZ0D9FsGI084octpyXs15v/CCr01rGZdlNlE2PHbj1JemBR3Ijel7biocb3EuID4oZAP/ N56Y2BuA7pl3xL0Iz7/HHFk4abMd+nFF0Q9LNnZaWO8XtnRQvq6IKDFmryorFHgIISDM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We allow configurations with CONFIG_BLOCK=n and CONFIG_DAX=y, which now results in a link error: drivers/dax/super.c: In function 'bdev_dax_pgoff': drivers/dax/super.c:50:26: error: implicit declaration of function 'get_start_sect'; did you mean 'get_task_cred'? [-Werror=implicit-function-declaration] The two obvious ways to avoid the link error are to either add an #ifdef around the code that was moved from fs/block_dev.c, or to disallow the configuration. I could not see if there is or is not a reason to support this combination of options, but in case there is, the #ifdef is the safer choice. Fixes: ef51042472f5 ("block, dax: move "select DAX" from BLOCK to FS_DAX") Signed-off-by: Arnd Bergmann --- drivers/dax/super.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 Reviewed-by: Darrick J. Wong diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ebf43f531ada..6ed32aac8bbe 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -44,6 +44,7 @@ void dax_read_unlock(int id) } EXPORT_SYMBOL_GPL(dax_read_unlock); +#ifdef CONFIG_BLOCK int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, pgoff_t *pgoff) { @@ -112,6 +113,7 @@ int __bdev_dax_supported(struct super_block *sb, int blocksize) return 0; } EXPORT_SYMBOL_GPL(__bdev_dax_supported); +#endif /** * struct dax_device - anchor object for dax services 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: 99814 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1554763qge; Mon, 15 May 2017 06:47:21 -0700 (PDT) X-Received: by 10.84.143.36 with SMTP id 33mr8571193ply.45.1494856041446; Mon, 15 May 2017 06:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494856041; cv=none; d=google.com; s=arc-20160816; b=cpb7kzXynraGWeKdmk4pemK5LsYTMom3eGZUZCzm/dUVg3u+iMyCBvdGfcBYefa97G eT0bqHdTsbPtM3uJGj1s3EBcQUY+0+Mz5Mx5IetgUk9XME1zFMvkUvTTxEcrxJJUm2xY mG+FBg3CXsiB6NIXK6CYT4bJLQZYeyfOuR5n3SF23pNPHAf1pVJmI92bAB8CoKZK1XWX TwjUOPKtikaSg/CVzz26cB2jigVKWYUDMEC9DiQusD5BKloKt8uOyT0arOMw38GVhCkj Jt4Nz4dALJLm7LnhjOp4hlwf1sbtgoss2ZBcBik565/NU/Qw7w9vy7UzcqEGDda2ksWE PfyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CG644Q3dcTj4yn62Bu5NDaqaVSeEcwkdZhwki1GELrA=; b=IuMiFyP/kAJMvwpXHDqfklDk+yxGx2Sg981vFWAGV23NrvMMtPneM3hoKwTTqB56Qb sVxmAPgzuttLLbPipOm3g5Y5ugpyL7xQaimYhYYRAcvQn38899y7q/vF2JSvXgvilASv L+F0tQrSNqNPimp80VwBfWJ18FJ0PfzanO0CZ8L4D5reroxf2nToUpB/NM2nHWm/n1Hg s3J9+Y1KOZORtLFJiTBNc8+fiisBqba/6zz7K8sOiZK9j7eIliAyFQBuxMACB/KGlBYy jWpaCGV+XT8gbS4NECmClEC+P66rjNJuUoWGmLvIqSx9ENuxMCUucAICkL9g9cTHA0eY pMlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188si10634177pgb.399.2017.05.15.06.47.21; Mon, 15 May 2017 06:47:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964976AbdEONrI (ORCPT + 25 others); Mon, 15 May 2017 09:47:08 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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);