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: 102338 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2495654qge; Wed, 18 May 2016 00:55:32 -0700 (PDT) X-Received: by 10.66.81.136 with SMTP id a8mr8750045pay.113.1463558132635; Wed, 18 May 2016 00:55:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t78si10514870pfi.253.2016.05.18.00.55.32; Wed, 18 May 2016 00:55:32 -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 S1752706AbcERHzL (ORCPT + 29 others); Wed, 18 May 2016 03:55:11 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:60845 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbcERHzH (ORCPT ); Wed, 18 May 2016 03:55:07 -0400 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 Cc: dan.j.williams@intel.com, jack@suse.cz, david@fromorbit.com, viro@zeniv.linux.org.uk, axboe@fb.com, hch@infradead.org, boaz@plexistor.com, tytso@mit.edu, adilger.kernel@dilger.ca, ross.zwisler@linux.intel.com, micah.parrish@hpe.com, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org 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:2bpPh44RSgo=:bzLyQ30kze+fh4qIxb1H+N CBlwJDrAxuKOIDbR3auVk/9EQOPBay06M+FgUSSTgqcirFrXIxOc3sCVd7F2L0/d6ttaE7Bcn 2e4VIwC+kwR8dZ0WsGvo/UCX2V/xq19+abHjzlK1hWS+H7DAkkZe3RloiUesiwaIG/x9cAFro U4p6YlTiwf37FsGK8zeyrY6MJ03WfZaWHSLlT1VQZaTBDjVE0NZi8q9R232SGN8rWza1C5g1I shB/RuA2LVesYSuo37sYuUIRuXYUcJC3JemMMuKlUVPCqqN3+Yx22c9sromRzq1hfKLWOqHqL YKVSBD+Qi4rDUy7INWgPB4tpGW0TVrSMTxFkoPdr58UK/yCuKXGXzK+/kOOLTv/WTnM7SOXX9 Lk/oREeuN6KVhmSFsLD2kIPA83g5nFZTsnQeE6IeT4w8XW4mtH3Ovx55oaRXltDOno7nuW9dk 6Le6cvIcexTl2MT64DyquU+WCQ+M0PQesCLUSPnMooacd3ewOmrUfbG/aDjb1ClYuQEV2ZA0D 5dsi/lugMjGhyB5dGWZKSGswFopD/KsXGXj8twJLGfTkqBq9UQ6wwEPqm4bUABGw8GnqbDOoe PoZ0deQRj3NJh86YYvKt/c5N5ZR9HewnWB3WkSeXVdShlDdPPOvkfA0EWkZzv8Ay/XUc4vtNi 9pO/HBeryO3RHsJiBLDBkFhkGs5Pd4q6mdmEw80hRZhWDlLaLKg4WIjsW0MEj+EhIDWBrPUv/ eYdp8lAyakWF4BgC0bdOWEQ3tyY4AizsnwbWXA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") --- 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); /*