Skip to content

Commit

Permalink
btrfs: remove unused btrfs_root::defrag_trans_start
Browse files Browse the repository at this point in the history
Last touched in 2013 by commit de78b51 ("btrfs: remove cache only
arguments from defrag path") that was the only code that used the value.
Now it's only set but never used for anything, so we can remove it.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Jul 27, 2020
1 parent bab16e2 commit a2570ef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ struct btrfs_root {

u64 highest_objectid;

u64 defrag_trans_start;
struct btrfs_key defrag_progress;
struct btrfs_key defrag_max;

Expand Down
4 changes: 0 additions & 4 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,6 @@ static void __setup_root(struct btrfs_root *root, struct btrfs_fs_info *fs_info,
memset(&root->root_key, 0, sizeof(root->root_key));
memset(&root->root_item, 0, sizeof(root->root_item));
memset(&root->defrag_progress, 0, sizeof(root->defrag_progress));
if (!dummy)
root->defrag_trans_start = fs_info->generation;
else
root->defrag_trans_start = 0;
root->root_key.objectid = objectid;
root->anon_dev = 0;

Expand Down
5 changes: 2 additions & 3 deletions fs/btrfs/tree-defrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
ret = 0;
}
done:
if (ret != -EAGAIN) {
if (ret != -EAGAIN)
memset(&root->defrag_progress, 0,
sizeof(root->defrag_progress));
root->defrag_trans_start = trans->transid;
}

return ret;
}

0 comments on commit a2570ef

Please sign in to comment.