summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-05-28 09:36:44 +0300
committerDavid Sterba <dsterba@suse.com>2018-06-07 16:37:36 +0200
commitebbcc81878bbcaf02df5e4acb7c4210489a946c1 (patch)
tree4b523b316336c057c0c5bdfd9209be46f0e1d2d7 /extent-tree.c
parent64419cbf05dcc33d2de00adb50f68443dbd8a333 (diff)
btrfs-progs: check: Make update_pinned_extents take btrfs_fs_info
This function needs btrfs_fs_info and not a root. So make it directly take btrfs_fs_info, Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 89fed5b..8e7f888 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1979,12 +1979,11 @@ static int update_block_group(struct btrfs_root *root,
return 0;
}
-static int update_pinned_extents(struct btrfs_root *root,
+static int update_pinned_extents(struct btrfs_fs_info *fs_info,
u64 bytenr, u64 num, int pin)
{
u64 len;
struct btrfs_block_group_cache *cache;
- struct btrfs_fs_info *fs_info = root->fs_info;
if (pin) {
set_extent_dirty(&fs_info->pinned_extents,
@@ -2033,7 +2032,8 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
EXTENT_DIRTY);
if (ret)
break;
- update_pinned_extents(root, start, end + 1 - start, 0);
+ update_pinned_extents(trans->fs_info, start, end + 1 - start,
+ 0);
clear_extent_dirty(unpin, start, end);
set_extent_dirty(free_space_cache, start, end);
}
@@ -2136,7 +2136,7 @@ static int pin_down_bytes(struct btrfs_trans_handle *trans,
}
free_extent_buffer(buf);
pinit:
- update_pinned_extents(root, bytenr, num_bytes, 1);
+ update_pinned_extents(trans->fs_info, bytenr, num_bytes, 1);
BUG_ON(err < 0);
return 0;
@@ -2145,13 +2145,13 @@ pinit:
void btrfs_pin_extent(struct btrfs_fs_info *fs_info,
u64 bytenr, u64 num_bytes)
{
- update_pinned_extents(fs_info->extent_root, bytenr, num_bytes, 1);
+ update_pinned_extents(fs_info, bytenr, num_bytes, 1);
}
void btrfs_unpin_extent(struct btrfs_fs_info *fs_info,
u64 bytenr, u64 num_bytes)
{
- update_pinned_extents(fs_info->extent_root, bytenr, num_bytes, 0);
+ update_pinned_extents(fs_info, bytenr, num_bytes, 0);
}
/*