From patchwork Thu Jul 21 12:07:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101990 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp405765qga; Thu, 21 Jul 2016 05:08:48 -0700 (PDT) X-Received: by 10.98.60.20 with SMTP id j20mr72695387pfa.114.1469102928726; Thu, 21 Jul 2016 05:08:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ud9si9458852pac.210.2016.07.21.05.08.48; Thu, 21 Jul 2016 05:08:48 -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 S1752175AbcGUMIq (ORCPT + 29 others); Thu, 21 Jul 2016 08:08:46 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:51520 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbcGUMIp (ORCPT ); Thu, 21 Jul 2016 08:08:45 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LnjcV-1aqZRB2CQp-00huU7; Thu, 21 Jul 2016 14:08:30 +0200 From: Arnd Bergmann To: Dave Chinner , xfs@oss.sgi.com Cc: Christoph Hellwig , Arnd Bergmann , Brian Foster , Al Viro , Ross Zwisler , Andrew Morton , Eric Sandeen , Matthew Wilcox , linux-kernel@vger.kernel.org Subject: [PATCH] xfs: remove dax code from object file when disabled Date: Thu, 21 Jul 2016 14:07:50 +0200 Message-Id: <20160721120824.2797655-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:274Bj9So4L3Aux6Cao7l8PVTiviPFC6u86QegB/oCYC7RFJY7v0 1hq/vwd7j/N+360zT1e22q25tWZC257SEogCY3cUbQgiDflBQs2zS4hScF1xc59Azbtl0L3 oq+BO8ns+RnLbigpmktnspMsLZ97VMvjetSHFd9KjVKWJ1s1rDqyBv1ngoHShahBNyMW9qf 1+8gzLNpsAfpxOC8h4Yjg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/i8FhNQdR1Q=:iDEHK0OLK7Tl3MB7Q0rGwh aghrkm0eBkOdXrZN9ctcoNMiZe5bjU1WJ8+K5ed/xCMW2V5B+pn0dBT0MSWfTX/kDRBeC+bWp U0hogpvgwiGkaWPowWp74JqGVykvKJOVmJKfe8CzNugp+Ac/eCythU+wefLDjV4fFUmNlBTts zU2sCNWpZfNUVfv/ySX5+1fZW2feeXEFu4/TBF+spIpcKR3M9c2aX9uv+BKEnmLTHJuJrcQAZ m3VtFWLbIhuQq+quHXad5hRr92GAZ47GRricRkEUyb2SXKnd3fHcecnAa9gMeRnWUox0vB1Rl PV/qeTdWCyDfqBm2dzaJZDSfQ08momCrHeDZkL92kXtlB0U3OxQPSYr/o0JeAb7LXc8nfAeS3 QQAf/SLeh34xVyNNjYt3UpRHB/O3nlr+Luq2vMU9rb3dwdIuT3ApY/M8kb2w5MTs1TF6nNzgk x96AHGOUHVhk3Qrx8jVHmdha+3Ti72Y37JwXZqG8uSMcCrT1PdDYD5TcU0VvcsaRYEXU8jKe+ r2o1Q7f3uII+DtEGqpQ/gnDb409Gj6DwG4QRICFmin/R7Rps+OPoqIHNH82aGMHE36j257m6s njZtAkn0NhYnvDa5Ynr3GYatGhAdJGTgJUMMmihZl4Kg+t2onhpPzP/BUsOPurWmZC5tPRg9v gvFrpu/EbmgDdQUeDvigvycHw7IdYjSzQa91+LjpsrXdxqdBSjwpwjCzWHpgg7M51sSA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We check IS_DAX(inode) before calling either xfs_file_dax_read or xfs_file_dax_write, and this will lead the call being optimized out at compile time when CONFIG_FS_DAX is disabled. However, the two functions are marked STATIC, so they become global symbols when CONFIG_XFS_DEBUG is set, leaving us with two unused global functions that call into an undefined function and a broken "allmodconfig" build: fs/built-in.o: In function `xfs_file_dax_read': fs/xfs/xfs_file.c:348: undefined reference to `dax_do_io' fs/built-in.o: In function `xfs_file_dax_write': fs/xfs/xfs_file.c:758: undefined reference to `dax_do_io' Marking the two functions 'static noinline' instead of 'STATIC' will let the compiler drop the symbols when there are no callers but avoid the implicit inlining. Signed-off-by: Arnd Bergmann Fixes: 16d4d43595b4 ("xfs: split direct I/O and DAX path") --- fs/xfs/xfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 8ffacb8bba19..ed95e5bb04e6 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -327,7 +327,7 @@ xfs_file_dio_aio_read( return ret; } -STATIC ssize_t +static noinline ssize_t xfs_file_dax_read( struct kiocb *iocb, struct iov_iter *to) @@ -706,7 +706,7 @@ out: return ret; } -STATIC ssize_t +static noinline ssize_t xfs_file_dax_write( struct kiocb *iocb, struct iov_iter *from)