From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752137AbcGUMIq (ORCPT ); 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 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 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(-) 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) -- 2.9.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) 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) From: Arnd Bergmann 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> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner , xfs@oss.sgi.com Cc: Eric Sandeen , Arnd Bergmann , Brian Foster , linux-kernel@vger.kernel.org, Christoph Hellwig , Al Viro , Matthew Wilcox , Andrew Morton , Ross Zwisler 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(-) 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) -- 2.9.0 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs