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: 9241537 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 D0C63602F0 for ; Thu, 21 Jul 2016 12:08:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C163A20649 for ; Thu, 21 Jul 2016 12:08:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B517527E66; Thu, 21 Jul 2016 12:08:51 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4F3AC20649 for ; Thu, 21 Jul 2016 12:08:50 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 5F6F67CA1; Thu, 21 Jul 2016 07:08:49 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 10A057CA0 for ; Thu, 21 Jul 2016 07:08:47 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id C62AF8F804B for ; Thu, 21 Jul 2016 05:08:43 -0700 (PDT) X-ASG-Debug-ID: 1469102920-04cbb057463a410001-NocioJ Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by cuda.sgi.com with ESMTP id WS6nPWkWh5BFWSt8 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 21 Jul 2016 05:08:41 -0700 (PDT) X-Barracuda-Envelope-From: arnd@arndb.de X-Barracuda-Effective-Source-IP: mout.kundenserver.de[217.72.192.75] X-Barracuda-Apparent-Source-IP: 217.72.192.75 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 Subject: [PATCH] xfs: remove dax code from object file when disabled Date: Thu, 21 Jul 2016 14:07:50 +0200 X-ASG-Orig-Subj: [PATCH] xfs: remove dax code from object file when disabled 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= X-Barracuda-Connect: mout.kundenserver.de[217.72.192.75] X-Barracuda-Start-Time: 1469102921 X-Barracuda-Encrypted: DHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1493 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31422 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Cc: Eric Sandeen , Arnd Bergmann , Brian Foster , linux-kernel@vger.kernel.org, Christoph Hellwig , Al Viro , Matthew Wilcox , Andrew Morton , Ross Zwisler X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP 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") Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)