From patchwork Wed Nov 14 13:35:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BB3817F3 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F3D32B374 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 639A7286E6; Wed, 14 Nov 2018 13:35:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DBAD2B374 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732575AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:52888 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728085AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3FD2BB086 for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 1/6] btrfs: remove unused drop_on_err in btrfs_mkdir() Date: Wed, 14 Nov 2018 14:35:15 +0100 Message-Id: <20181114133520.16069-2-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Up to commit 32955c5422a8 (btrfs: switch to discard_new_inode()) the drop_on_err variable in btrfs_mkdir() was used to check whether the inode had to be dropped via iput(). After commit 32955c5422a8 (btrfs: switch to discard_new_inode()) discard_new_inode() is called when err is set and inode is non NULL. Therefore drop_on_err is not used anymore and thus causes a warning when building with -Wunused-but-set-variable. Signed-off-by: Johannes Thumshirn Reviewed-by: Omar Sandoval --- fs/btrfs/inode.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4a2f9f7fd96e..7d17b0a654e6 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6677,7 +6677,6 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) struct btrfs_trans_handle *trans; struct btrfs_root *root = BTRFS_I(dir)->root; int err = 0; - int drop_on_err = 0; u64 objectid = 0; u64 index = 0; @@ -6703,7 +6702,6 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) goto out_fail; } - drop_on_err = 1; /* these must be set before we unlock the inode */ inode->i_op = &btrfs_dir_inode_operations; inode->i_fop = &btrfs_dir_file_operations; @@ -6724,7 +6722,6 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) goto out_fail; d_instantiate_new(dentry, inode); - drop_on_err = 0; out_fail: btrfs_end_transaction(trans); From patchwork Wed Nov 14 13:35:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682633 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E0FC13B5 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51D23286E6 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 461E62B38F; Wed, 14 Nov 2018 13:35:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E11C5286E6 for ; Wed, 14 Nov 2018 13:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732655AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:52894 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728116AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4C959B091 for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 2/6] btrfs: remove set but not used variable err in btrfs_add_link Date: Wed, 14 Nov 2018 14:35:16 +0100 Message-Id: <20181114133520.16069-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP err holds the return value of either btrfs_del_root_ref() or btrfs_del_inode_ref() but it hasn't been checked since it's introduction with commit fe66a05a0679 (Btrfs: improve error handling for btrfs_insert_dir_item callers) in 2012. As the error value hasn't been of any interest for 6 years we can just drop it as well. Signed-off-by: Johannes Thumshirn --- fs/btrfs/inode.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7d17b0a654e6..57af243b3f59 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6427,17 +6427,16 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, fail_dir_item: if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { u64 local_index; - int err; - err = btrfs_del_root_ref(trans, key.objectid, - root->root_key.objectid, parent_ino, - &local_index, name, name_len); + + btrfs_del_root_ref(trans, key.objectid, + root->root_key.objectid, parent_ino, + &local_index, name, name_len); } else if (add_backref) { u64 local_index; - int err; - err = btrfs_del_inode_ref(trans, root, name, name_len, - ino, parent_ino, &local_index); + btrfs_del_inode_ref(trans, root, name, name_len, + ino, parent_ino, &local_index); } return ret; } From patchwork Wed Nov 14 13:35:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF68E14D6 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF821286E6 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3F922B38C; Wed, 14 Nov 2018 13:35:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6354E2B38F for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732837AbeKNXis (ORCPT ); Wed, 14 Nov 2018 18:38:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:52902 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728391AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5A16AB0C6 for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 3/6] btrfs: remove unused function btrfs_sysfs_feature_update() Date: Wed, 14 Nov 2018 14:35:17 +0100 Message-Id: <20181114133520.16069-4-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP btrfs_sysfs_feature_update() was introduced with commit 444e75169872 (btrfs: sysfs: introduce helper for syncing bits with sysfs files) to provide a helper which was used in 14e46e04958d (btrfs: synchronize incompat feature bits with sysfs files). But commit e410e34fad91 (Revert "btrfs: synchronize incompat feature bits with sysfs files") reverted 14e46e04958d so btrfs_sysfs_feature_update() ended up as an unused function. Signed-off-by: Johannes Thumshirn Reviewed-by: Omar Sandoval --- fs/btrfs/sysfs.c | 33 --------------------------------- fs/btrfs/sysfs.h | 2 -- 2 files changed, 35 deletions(-) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 3717c864ba23..a22a7c5f75eb 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -858,39 +858,6 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info) return error; } - -/* - * Change per-fs features in /sys/fs/btrfs/UUID/features to match current - * values in superblock. Call after any changes to incompat/compat_ro flags - */ -void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, - u64 bit, enum btrfs_feature_set set) -{ - struct btrfs_fs_devices *fs_devs; - struct kobject *fsid_kobj; - u64 features; - int ret; - - if (!fs_info) - return; - - features = get_features(fs_info, set); - ASSERT(bit & supported_feature_masks[set]); - - fs_devs = fs_info->fs_devices; - fsid_kobj = &fs_devs->fsid_kobj; - - if (!fsid_kobj->state_initialized) - return; - - /* - * FIXME: this is too heavy to update just one value, ideally we'd like - * to use sysfs_update_group but some refactoring is needed first. - */ - sysfs_remove_group(fsid_kobj, &btrfs_feature_attr_group); - ret = sysfs_create_group(fsid_kobj, &btrfs_feature_attr_group); -} - static int btrfs_init_debugfs(void) { #ifdef CONFIG_DEBUG_FS diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h index c6ee600aff89..93feedde8485 100644 --- a/fs/btrfs/sysfs.h +++ b/fs/btrfs/sysfs.h @@ -88,7 +88,5 @@ int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs, struct kobject *parent); int btrfs_sysfs_add_device(struct btrfs_fs_devices *fs_devs); void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs); -void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, - u64 bit, enum btrfs_feature_set set); #endif From patchwork Wed Nov 14 13:35:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4420317F3 for ; Wed, 14 Nov 2018 13:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37ACC2B374 for ; Wed, 14 Nov 2018 13:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C336286E6; Wed, 14 Nov 2018 13:35:48 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAE562B42C for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732929AbeKNXiv (ORCPT ); Wed, 14 Nov 2018 18:38:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:52908 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731585AbeKNXiq (ORCPT ); Wed, 14 Nov 2018 18:38:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 66BAEB0CE for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 4/6] btrfs: remove unused variable tree in bio_readpage_error() Date: Wed, 14 Nov 2018 14:35:18 +0100 Message-Id: <20181114133520.16069-5-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 2922040236f9 (btrfs: Remove extent_io_ops::writepage_end_io_hook) removed the indirection to extent_io_ops::writepage_end_io_hook but didn't remove the tree variable which then became unused. Remove 'tree' as well to silence the warning when -Wunused-but-set-variable is used to compile btrfs. Signed-off-by: Johannes Thumshirn Reviewed-by: Omar Sandoval --- fs/btrfs/extent_io.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 0f8f9c035812..17a15cc6b542 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2403,11 +2403,8 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset, void end_extent_writepage(struct page *page, int err, u64 start, u64 end) { int uptodate = (err == 0); - struct extent_io_tree *tree; int ret = 0; - tree = &BTRFS_I(page->mapping->host)->io_tree; - btrfs_writepage_endio_finish_ordered(page, start, end, NULL, uptodate); if (!uptodate) { From patchwork Wed Nov 14 13:35:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 294E946E4 for ; Wed, 14 Nov 2018 13:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19CCD2B374 for ; Wed, 14 Nov 2018 13:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E5C3286E6; Wed, 14 Nov 2018 13:35:48 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B96762B38B for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732927AbeKNXis (ORCPT ); Wed, 14 Nov 2018 18:38:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:52916 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732671AbeKNXis (ORCPT ); Wed, 14 Nov 2018 18:38:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 73916B0D9 for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 5/6] btrfs: remove unused variable tree in end_compressed_bio_write() Date: Wed, 14 Nov 2018 14:35:19 +0100 Message-Id: <20181114133520.16069-6-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 2922040236f9 (btrfs: Remove extent_io_ops::writepage_end_io_hook) removed the indirection to extent_io_ops::writepage_end_io_hook but didn't remove the tree variable which then became unused. Remove 'tree' as well to silence the warning when -Wunused-but-set-variable is used to compile btrfs. Signed-off-by: Johannes Thumshirn Reviewed-by: Omar Sandoval --- fs/btrfs/compression.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index bde8d0487bbb..088570c5dfb8 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -229,7 +229,6 @@ static noinline void end_compressed_writeback(struct inode *inode, */ static void end_compressed_bio_write(struct bio *bio) { - struct extent_io_tree *tree; struct compressed_bio *cb = bio->bi_private; struct inode *inode; struct page *page; @@ -248,7 +247,6 @@ static void end_compressed_bio_write(struct bio *bio) * call back into the FS and do all the end_io operations */ inode = cb->inode; - tree = &BTRFS_I(inode)->io_tree; cb->compressed_pages[0]->mapping = cb->inode->i_mapping; btrfs_writepage_endio_finish_ordered(cb->compressed_pages[0], cb->start, cb->start + cb->len - 1, NULL, From patchwork Wed Nov 14 13:35:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10682641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07B0D4B7E for ; Wed, 14 Nov 2018 13:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F04B0286E6 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E47362B38F; Wed, 14 Nov 2018 13:35:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F8CE2B374 for ; Wed, 14 Nov 2018 13:35:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732847AbeKNXis (ORCPT ); Wed, 14 Nov 2018 18:38:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:52914 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728116AbeKNXis (ORCPT ); Wed, 14 Nov 2018 18:38:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7DC35B0E2 for ; Wed, 14 Nov 2018 13:35:28 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [PATCH 6/6] btrfs: unconditionally provide function prototypes from free-space-tree.h Date: Wed, 14 Nov 2018 14:35:20 +0100 Message-Id: <20181114133520.16069-7-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181114133520.16069-1-jthumshirn@suse.de> References: <20181114133520.16069-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the function prototypes of: * search_free_space_info() * convert_free_space_to_bitmaps() * convert_free_space_to_extents() * free_space_test_bit() * __remove_from_free_space_tree() * __add_to_free_space_tree() are hidden behind CONFIG_BTRFS_FS_RUN_SANITY_TESTS. If CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set, these functions are only used within free-space-tree.c so technically there would be no need to provide the function prototypes. But when CONFIG_BTRFS_FS_RUN_SANITY_TESTS they are also used from tests/free-space-tree-tests.c which explains the need for the function prototypes and the non-static declaration of the functions. When compiling with -Wmissing-prototypes and CONFIG_BTRFS_FS_RUN_SANITY_TESTS=n gcc emits a warning for each of these functions, so remove the ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS guard to make the compiler happy when running 'make W=1'. Signed-off-by: Johannes Thumshirn --- fs/btrfs/free-space-tree.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/free-space-tree.h b/fs/btrfs/free-space-tree.h index 3133651d7d70..0f4db2ad68c8 100644 --- a/fs/btrfs/free-space-tree.h +++ b/fs/btrfs/free-space-tree.h @@ -27,7 +27,6 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans, int remove_from_free_space_tree(struct btrfs_trans_handle *trans, u64 start, u64 size); -#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS struct btrfs_free_space_info * search_free_space_info(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, @@ -47,6 +46,5 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans, struct btrfs_path *path); int free_space_test_bit(struct btrfs_block_group_cache *block_group, struct btrfs_path *path, u64 offset); -#endif #endif