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: 9116631 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 BD0F79F30C for ; Wed, 18 May 2016 07:55:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAACE202AE for ; Wed, 18 May 2016 07:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08890201ED for ; Wed, 18 May 2016 07:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752671AbcERHzK (ORCPT ); Wed, 18 May 2016 03:55:10 -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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); /*