diff options
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 8bb256667f2..09c30d37d43 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2136,10 +2136,10 @@ int prepare_to_merge(struct reloc_control *rc, int err) | |||
2136 | u64 num_bytes = 0; | 2136 | u64 num_bytes = 0; |
2137 | int ret; | 2137 | int ret; |
2138 | 2138 | ||
2139 | mutex_lock(&root->fs_info->trans_mutex); | 2139 | spin_lock(&root->fs_info->trans_lock); |
2140 | rc->merging_rsv_size += root->nodesize * (BTRFS_MAX_LEVEL - 1) * 2; | 2140 | rc->merging_rsv_size += root->nodesize * (BTRFS_MAX_LEVEL - 1) * 2; |
2141 | rc->merging_rsv_size += rc->nodes_relocated * 2; | 2141 | rc->merging_rsv_size += rc->nodes_relocated * 2; |
2142 | mutex_unlock(&root->fs_info->trans_mutex); | 2142 | spin_unlock(&root->fs_info->trans_lock); |
2143 | again: | 2143 | again: |
2144 | if (!err) { | 2144 | if (!err) { |
2145 | num_bytes = rc->merging_rsv_size; | 2145 | num_bytes = rc->merging_rsv_size; |
@@ -2208,9 +2208,9 @@ int merge_reloc_roots(struct reloc_control *rc) | |||
2208 | int ret; | 2208 | int ret; |
2209 | again: | 2209 | again: |
2210 | root = rc->extent_root; | 2210 | root = rc->extent_root; |
2211 | mutex_lock(&root->fs_info->trans_mutex); | 2211 | spin_lock(&root->fs_info->trans_lock); |
2212 | list_splice_init(&rc->reloc_roots, &reloc_roots); | 2212 | list_splice_init(&rc->reloc_roots, &reloc_roots); |
2213 | mutex_unlock(&root->fs_info->trans_mutex); | 2213 | spin_unlock(&root->fs_info->trans_lock); |
2214 | 2214 | ||
2215 | while (!list_empty(&reloc_roots)) { | 2215 | while (!list_empty(&reloc_roots)) { |
2216 | found = 1; | 2216 | found = 1; |
@@ -3583,17 +3583,17 @@ next: | |||
3583 | static void set_reloc_control(struct reloc_control *rc) | 3583 | static void set_reloc_control(struct reloc_control *rc) |
3584 | { | 3584 | { |
3585 | struct btrfs_fs_info *fs_info = rc->extent_root->fs_info; | 3585 | struct btrfs_fs_info *fs_info = rc->extent_root->fs_info; |
3586 | mutex_lock(&fs_info->trans_mutex); | 3586 | spin_lock(&fs_info->trans_lock); |
3587 | fs_info->reloc_ctl = rc; | 3587 | fs_info->reloc_ctl = rc; |
3588 | mutex_unlock(&fs_info->trans_mutex); | 3588 | spin_unlock(&fs_info->trans_lock); |
3589 | } | 3589 | } |
3590 | 3590 | ||
3591 | static void unset_reloc_control(struct reloc_control *rc) | 3591 | static void unset_reloc_control(struct reloc_control *rc) |
3592 | { | 3592 | { |
3593 | struct btrfs_fs_info *fs_info = rc->extent_root->fs_info; | 3593 | struct btrfs_fs_info *fs_info = rc->extent_root->fs_info; |
3594 | mutex_lock(&fs_info->trans_mutex); | 3594 | spin_lock(&fs_info->trans_lock); |
3595 | fs_info->reloc_ctl = NULL; | 3595 | fs_info->reloc_ctl = NULL; |
3596 | mutex_unlock(&fs_info->trans_mutex); | 3596 | spin_unlock(&fs_info->trans_lock); |
3597 | } | 3597 | } |
3598 | 3598 | ||
3599 | static int check_extent_flags(u64 flags) | 3599 | static int check_extent_flags(u64 flags) |