From patchwork Fri Dec 25 23:21:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caio Lima X-Patchwork-Id: 7921721 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F1CBBEEE5 for ; Sat, 26 Dec 2015 12:22:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24C9920380 for ; Sat, 26 Dec 2015 12:22:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7DDD2037F for ; Sat, 26 Dec 2015 12:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbbLZMVf (ORCPT ); Sat, 26 Dec 2015 07:21:35 -0500 Received: from mail-qg0-f42.google.com ([209.85.192.42]:35270 "EHLO mail-qg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbbLZMVe (ORCPT ); Sat, 26 Dec 2015 07:21:34 -0500 Received: by mail-qg0-f42.google.com with SMTP id o11so121783125qge.2 for ; Sat, 26 Dec 2015 04:21:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=lPU0A6ezUHpZdxMkIKD7f+VRLN/HbM+iw4mDhw3gA4Q=; b=hSdhxhPOEVds8MNysiFJV2Mj6/elj3oP1Kaj+XwbwgD8Tkpo6UoCCeJ5YIAX828NHj XvHKpKXBJ8yYXYXlRHBm52m65vRRPfJUdxTMscgMqIfmTizqWTO6h4DOfZdvIFCK4WU7 fJYymAeWVG+obU0+LL/DM4S/SoV+WsiNoONRDr8bM6wanvgNyo6l7R27C4Km8KI4NOsE dyB7/VCV+sS8lOhZo9iDhwQwQ0N4nW7o0N/Ge8G2wkU1gJ+id18yfFIXuagSv4Q3W3Gx yWKaQb+/GLEfJBUfimb2f5uJzzWXK6B/oX+VVR1DC9UjDrLDlSUHRBvW3/1uNnKa33M/ L6Zg== X-Received: by 10.140.92.215 with SMTP id b81mr46684079qge.44.1451132493448; Sat, 26 Dec 2015 04:21:33 -0800 (PST) Received: from localhost.localdomain (179-197-26-158.user.veloxzone.com.br. [179.197.26.158]) by smtp.gmail.com with ESMTPSA id 17sm23529341qhp.1.2015.12.26.04.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 26 Dec 2015 04:21:32 -0800 (PST) From: Caio Lima To: linux-btrfs@vger.kernel.org Cc: Caio Lima , Chris Mason , Josef Bacik , David Sterba Subject: [PATCH] btrfs: cleanup unusable parameters from ctree.h Date: Fri, 25 Dec 2015 18:21:09 -0500 Message-Id: <1451085669-5009-1-git-send-email-ticaiolima@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Cleanup of ununsed parameters in btrfs_header_chunk_tree_uuid, btrfs_leaf_data and btrfs_defrag_cancelled Signed-off-by: Caio Lima --- fs/btrfs/ctree.c | 46 +++++++++++++++++++++++----------------------- fs/btrfs/ctree.h | 10 +++++----- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/ioctl.c | 4 ++-- fs/btrfs/transaction.c | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 5b8e235..59b9bfe 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -3366,7 +3366,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, BTRFS_FSID_SIZE); write_extent_buffer(c, root->fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(c), BTRFS_UUID_SIZE); + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); btrfs_set_node_key(c, &lower_key, 0); btrfs_set_node_blockptr(c, 0, lower->start); @@ -3502,7 +3502,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, write_extent_buffer(split, root->fs_info->fsid, btrfs_header_fsid(), BTRFS_FSID_SIZE); write_extent_buffer(split, root->fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(split), + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); ret = tree_mod_log_eb_copy(root->fs_info, split, c, 0, @@ -3664,14 +3664,14 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, /* make room in the right data area */ data_end = leaf_data_end(root, right); memmove_extent_buffer(right, - btrfs_leaf_data(right) + data_end - push_space, - btrfs_leaf_data(right) + data_end, + btrfs_leaf_data() + data_end - push_space, + btrfs_leaf_data() + data_end, BTRFS_LEAF_DATA_SIZE(root) - data_end); /* copy from the left data area */ - copy_extent_buffer(right, left, btrfs_leaf_data(right) + + copy_extent_buffer(right, left, btrfs_leaf_data() + BTRFS_LEAF_DATA_SIZE(root) - push_space, - btrfs_leaf_data(left) + leaf_data_end(root, left), + btrfs_leaf_data() + leaf_data_end(root, left), push_space); memmove_extent_buffer(right, btrfs_item_nr_offset(push_items), @@ -3881,9 +3881,9 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, push_space = BTRFS_LEAF_DATA_SIZE(root) - btrfs_item_offset_nr(right, push_items - 1); - copy_extent_buffer(left, right, btrfs_leaf_data(left) + + copy_extent_buffer(left, right, btrfs_leaf_data() + leaf_data_end(root, left) - push_space, - btrfs_leaf_data(right) + + btrfs_leaf_data() + btrfs_item_offset_nr(right, push_items - 1), push_space); old_left_nritems = btrfs_header_nritems(left); @@ -3910,9 +3910,9 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, if (push_items < right_nritems) { push_space = btrfs_item_offset_nr(right, push_items - 1) - leaf_data_end(root, right); - memmove_extent_buffer(right, btrfs_leaf_data(right) + + memmove_extent_buffer(right, btrfs_leaf_data() + BTRFS_LEAF_DATA_SIZE(root) - push_space, - btrfs_leaf_data(right) + + btrfs_leaf_data() + leaf_data_end(root, right), push_space); memmove_extent_buffer(right, btrfs_item_nr_offset(0), @@ -4057,8 +4057,8 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans, nritems * sizeof(struct btrfs_item)); copy_extent_buffer(right, l, - btrfs_leaf_data(right) + BTRFS_LEAF_DATA_SIZE(root) - - data_copy_size, btrfs_leaf_data(l) + + btrfs_leaf_data() + BTRFS_LEAF_DATA_SIZE(root) - + data_copy_size, btrfs_leaf_data() + leaf_data_end(root, l), data_copy_size); rt_data_off = BTRFS_LEAF_DATA_SIZE(root) - @@ -4283,7 +4283,7 @@ again: btrfs_header_fsid(), BTRFS_FSID_SIZE); write_extent_buffer(right, fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(right), + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); if (split == 0) { @@ -4588,8 +4588,8 @@ void btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, /* shift the data */ if (from_end) { - memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + - data_end + size_diff, btrfs_leaf_data(leaf) + + memmove_extent_buffer(leaf, btrfs_leaf_data() + + data_end + size_diff, btrfs_leaf_data() + data_end, old_data_start + new_size - data_end); } else { struct btrfs_disk_key disk_key; @@ -4615,8 +4615,8 @@ void btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path, } } - memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + - data_end + size_diff, btrfs_leaf_data(leaf) + + memmove_extent_buffer(leaf, btrfs_leaf_data() + + data_end + size_diff, btrfs_leaf_data() + data_end, old_data_start - data_end); offset = btrfs_disk_key_offset(&disk_key); @@ -4688,8 +4688,8 @@ void btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path, } /* shift the data */ - memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + - data_end - data_size, btrfs_leaf_data(leaf) + + memmove_extent_buffer(leaf, btrfs_leaf_data() + + data_end - data_size, btrfs_leaf_data() + data_end, old_data - data_end); data_end = old_data; @@ -4770,8 +4770,8 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path, (nritems - slot) * sizeof(struct btrfs_item)); /* shift the data */ - memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + - data_end - total_data, btrfs_leaf_data(leaf) + + memmove_extent_buffer(leaf, btrfs_leaf_data() + + data_end - total_data, btrfs_leaf_data() + data_end, old_data - data_end); data_end = old_data; } @@ -4961,9 +4961,9 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, if (slot + nr != nritems) { int data_end = leaf_data_end(root, leaf); - memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) + + memmove_extent_buffer(leaf, btrfs_leaf_data() + data_end + dsize, - btrfs_leaf_data(leaf) + data_end, + btrfs_leaf_data() + data_end, last_off - data_end); for (i = slot + nr; i < nritems; i++) { diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 35489e7..4412cbc 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2910,7 +2910,7 @@ static inline unsigned long btrfs_header_fsid(void) return offsetof(struct btrfs_header, fsid); } -static inline unsigned long btrfs_header_chunk_tree_uuid(struct extent_buffer *eb) +static inline unsigned long btrfs_header_chunk_tree_uuid(void) { return offsetof(struct btrfs_header, chunk_tree_uuid); } @@ -3148,7 +3148,7 @@ static inline int btrfs_super_csum_size(struct btrfs_super_block *s) return btrfs_csum_sizes[t]; } -static inline unsigned long btrfs_leaf_data(struct extent_buffer *l) +static inline unsigned long btrfs_leaf_data(void) { return offsetof(struct btrfs_leaf, items); } @@ -3352,11 +3352,11 @@ static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb) /* helper function to cast into the data area of the leaf. */ #define btrfs_item_ptr(leaf, slot, type) \ - ((type *)(btrfs_leaf_data(leaf) + \ + ((type *)(btrfs_leaf_data() + \ btrfs_item_offset_nr(leaf, slot))) #define btrfs_item_ptr_offset(leaf, slot) \ - ((unsigned long)(btrfs_leaf_data(leaf) + \ + ((unsigned long)(btrfs_leaf_data() + \ btrfs_item_offset_nr(leaf, slot))) static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info) @@ -4374,7 +4374,7 @@ static inline int is_fstree(u64 rootid) return 0; } -static inline int btrfs_defrag_cancelled(struct btrfs_fs_info *fs_info) +static inline int btrfs_defrag_cancelled(void) { return signal_pending(current); } diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 974be09..80ddaaf 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1351,7 +1351,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, write_extent_buffer(leaf, fs_info->fsid, btrfs_header_fsid(), BTRFS_FSID_SIZE); write_extent_buffer(leaf, fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(leaf), + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); btrfs_mark_buffer_dirty(leaf); @@ -2859,7 +2859,7 @@ int open_ctree(struct super_block *sb, chunk_root->commit_root = btrfs_root_node(chunk_root); read_extent_buffer(chunk_root->node, fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(chunk_root->node), BTRFS_UUID_SIZE); + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); ret = btrfs_read_chunk_tree(chunk_root); if (ret) { diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index da94138..678d6ff 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -503,7 +503,7 @@ static noinline int create_subvol(struct inode *dir, write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(), BTRFS_FSID_SIZE); write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, - btrfs_header_chunk_tree_uuid(leaf), + btrfs_header_chunk_tree_uuid(), BTRFS_UUID_SIZE); btrfs_mark_buffer_dirty(leaf); @@ -1345,7 +1345,7 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, if (!(inode->i_sb->s_flags & MS_ACTIVE)) break; - if (btrfs_defrag_cancelled(root->fs_info)) { + if (btrfs_defrag_cancelled()) { btrfs_debug(root->fs_info, "defrag_file cancelled"); ret = -EAGAIN; break; diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index be8eae8..c7ae477 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1276,7 +1276,7 @@ int btrfs_defrag_root(struct btrfs_root *root) if (btrfs_fs_closing(root->fs_info) || ret != -EAGAIN) break; - if (btrfs_defrag_cancelled(root->fs_info)) { + if (btrfs_defrag_cancelled()) { pr_debug("BTRFS: defrag_root cancelled\n"); ret = -EAGAIN; break;