From patchwork Wed May 18 07:54:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9116721 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2EE3D9F37F for ; Wed, 18 May 2016 08:09:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55E5F20138 for ; Wed, 18 May 2016 08:09:46 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6468F20123 for ; Wed, 18 May 2016 08:09:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 32A6D1A1F9E; Wed, 18 May 2016 01:09:50 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 179D11A1F9E for ; Wed, 18 May 2016 01:09:47 -0700 (PDT) Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0LovMS-1bWkkm1YKy-00epr6; Wed, 18 May 2016 09:54:16 +0200 From: Arnd Bergmann To: Toshi Kani Subject: [PATCH] remove unused blkdev_dax_capable() function Date: Wed, 18 May 2016 09:54:08 +0200 Message-ID: <3280835.MNk2ItMooy@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1462897437-16626-7-git-send-email-toshi.kani@hpe.com> References: <1462897437-16626-1-git-send-email-toshi.kani@hpe.com> <1462897437-16626-7-git-send-email-toshi.kani@hpe.com> MIME-Version: 1.0 X-Provags-ID: V03:K0:chVb2XrCUG9YDdUf9mvlJcLVYOP05qZKr0L0tJlJjKSOmyLAk8C XKi46mIfvLIjmH3TL6yF0L8gLBconxIn0n+t3JqJ+jngfV+NhQQGpcAesfM/D/QySvTnohc lnq4sni+si3jtsXQJ3PbqCoKvucqjTf7KYq2hAq4OKn/N3DUe0XhhKzz4B2iK8fqQlLl+2J ZDOB4Tjf9J1VlstJxfn0g== X-UI-Out-Filterresults: notjunk:1; V01:K0:Tv8z/1GQSAA=:clZwOvpuZ2J3Z3rdyOL5iW UiFDYhOsy0w8vu3mE7d/57WdehB77hCaQVeT6FQtRNaFIbhpmpy+13Su2Kdig/3qA8XPpx6KJ Y25cl0sKlMJML839U0NMttkF3GWqZEyzp8gpxyUISQHvSWfYROb1rMnIlamzJ4Golx7gxYZtZ aNee6CBWG+o5v7iY1ZTEkH8psU8nOLjDUUeTSPe9XKprdhRP2GWj4R/m8+DVfBYnBHmYY+KAN Tc9YfK1Eznjt0yFgZTpXkMVvrcSM8vn/3mbujZ8gDgK/OGlb0P3z/T0b7n2jfvrcVvVT1TVqv dpUBubVTPkyCm0D+HwTe/edbqLWsss4TQdfnh9kSiPEslNcPcvmLs5bG9QIC1sPjriLTq5CfD ZO5K8wnL4BgopA0dm0ItlAqXw5XsZX5O7IFJsoCDzviaFH0Gf3m6cWnDLhEtHv24CiyEWliLL DDeTdJDYHiAXXursNm09QkuA+W38qUVZlldR6P2Twhk750tO7TV09VFfki+uFIZZ0czzmSW26 CNsq1cbdK5Gf2S5j+XUfVA2irx5214YAcHfS2yQojA8qiCguMo9+O6YCcxjrqZEu9ksFadYrg ywGKORC11AgL2mHJavcg3OPBUGCAXA9/Z7235WuDiyXMchP4wTIRPGteW3NLao5R27sM6jsea 7KigaRznlsNydpwSAddAm1v3WHP3Mst5YVD+cWjA6qPO4q9Eu77EepMbIXP5Kw+DgXwTg8CMT MIENpu3DfWYc6IMEretUS8O6jhMcz2J/ckXSJg== X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hch@infradead.org, jack@suse.cz, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, david@fromorbit.com, linux-kernel@vger.kernel.org, micah.parrish@hpe.com, axboe@fb.com, adilger.kernel@dilger.ca, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, tytso@mit.edu Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user of the former, so we now get a build warning: fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function] static bool blkdev_dax_capable(struct block_device *bdev) This removes the now-unused function. Signed-off-by: Arnd Bergmann Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency") Acked-by: Toshi Kani --- On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote: > @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) > > if (!ret) { > bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); > - if (!blkdev_dax_capable(bdev)) > + if (!bdev_dax_capable(bdev)) > bdev->bd_inode->i_flags &= ~S_DAX; > It's not entirely from the patch description what the intention was here in keeping two slightly different implementations of the same function in one file, my best guess is that it was not intentional and we should just remove this. diff --git a/fs/block_dev.c b/fs/block_dev.c index 97f324642b5f..dad77225a721 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1241,33 +1241,6 @@ void bd_set_size(struct block_device *bdev, loff_t size) } EXPORT_SYMBOL(bd_set_size); -static bool blkdev_dax_capable(struct block_device *bdev) -{ - struct gendisk *disk = bdev->bd_disk; - - if (!disk->fops->direct_access || !IS_ENABLED(CONFIG_FS_DAX)) - return false; - - /* - * If the partition is not aligned on a page boundary, we can't - * do dax I/O to it. - */ - if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) - || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512))) - return false; - - /* - * If the device has known bad blocks, force all I/O through the - * driver / page cache. - * - * TODO: support finer grained dax error handling - */ - if (disk->bb && disk->bb->count) - return false; - - return true; -} - static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part); /*