Skip to content

Commit 300aa89

Browse files
committed
btrfs: replace btrfs_set_lock_blocking_rw with appropriate helpers
We can use the right helper where the lock type is a fixed parameter. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent aa12c02 commit 300aa89

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎fs/btrfs/backref.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
12891289
goto out;
12901290
}
12911291
btrfs_tree_read_lock(eb);
1292-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
1292+
btrfs_set_lock_blocking_read(eb);
12931293
ret = find_extent_in_eb(eb, bytenr,
12941294
*extent_item_pos, &eie, ignore_offset);
12951295
btrfs_tree_read_unlock_blocking(eb);
@@ -1650,7 +1650,7 @@ char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
16501650
/* make sure we can use eb after releasing the path */
16511651
if (eb != eb_in) {
16521652
if (!path->skip_locking)
1653-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
1653+
btrfs_set_lock_blocking_read(eb);
16541654
path->nodes[0] = NULL;
16551655
path->locks[0] = 0;
16561656
}

‎fs/btrfs/ctree.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
12891289
return eb;
12901290

12911291
btrfs_set_path_blocking(path);
1292-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
1292+
btrfs_set_lock_blocking_read(eb);
12931293

12941294
if (tm->op == MOD_LOG_KEY_REMOVE_WHILE_FREEING) {
12951295
BUG_ON(tm->slot != 0);
@@ -1379,7 +1379,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq)
13791379
free_extent_buffer(eb_root);
13801380
eb = alloc_dummy_extent_buffer(fs_info, logical);
13811381
} else {
1382-
btrfs_set_lock_blocking_rw(eb_root, BTRFS_READ_LOCK);
1382+
btrfs_set_lock_blocking_read(eb_root);
13831383
eb = btrfs_clone_extent_buffer(eb_root);
13841384
btrfs_tree_read_unlock_blocking(eb_root);
13851385
free_extent_buffer(eb_root);

‎fs/btrfs/disk-io.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree,
342342

343343
if (need_lock) {
344344
btrfs_tree_read_lock(eb);
345-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
345+
btrfs_set_lock_blocking_read(eb);
346346
}
347347

348348
lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1,

‎fs/btrfs/locking.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static inline void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw)
5353

5454
static inline void btrfs_set_lock_blocking(struct extent_buffer *eb)
5555
{
56-
btrfs_set_lock_blocking_rw(eb, BTRFS_WRITE_LOCK);
56+
btrfs_set_lock_blocking_write(eb);
5757
}
5858

5959
#endif

‎fs/btrfs/qgroup.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ static int qgroup_trace_extent_swap(struct btrfs_trans_handle* trans,
18321832
src_path->nodes[cur_level] = eb;
18331833

18341834
btrfs_tree_read_lock(eb);
1835-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
1835+
btrfs_set_lock_blocking_read(eb);
18361836
src_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING;
18371837
}
18381838

@@ -1973,7 +1973,7 @@ static int qgroup_trace_new_subtree_blocks(struct btrfs_trans_handle* trans,
19731973
dst_path->slots[cur_level] = 0;
19741974

19751975
btrfs_tree_read_lock(eb);
1976-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
1976+
btrfs_set_lock_blocking_read(eb);
19771977
dst_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING;
19781978
need_cleanup = true;
19791979
}
@@ -2148,7 +2148,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
21482148
path->slots[level] = 0;
21492149

21502150
btrfs_tree_read_lock(eb);
2151-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
2151+
btrfs_set_lock_blocking_read(eb);
21522152
path->locks[level] = BTRFS_READ_LOCK_BLOCKING;
21532153

21542154
ret = btrfs_qgroup_trace_extent(trans, child_bytenr,

‎fs/btrfs/ref-verify.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
583583
return -EIO;
584584
}
585585
btrfs_tree_read_lock(eb);
586-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
586+
btrfs_set_lock_blocking_read(eb);
587587
path->nodes[level-1] = eb;
588588
path->slots[level-1] = 0;
589589
path->locks[level-1] = BTRFS_READ_LOCK_BLOCKING;
@@ -987,7 +987,7 @@ int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
987987
return -ENOMEM;
988988

989989
eb = btrfs_read_lock_root_node(fs_info->extent_root);
990-
btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
990+
btrfs_set_lock_blocking_read(eb);
991991
level = btrfs_header_level(eb);
992992
path->nodes[level] = eb;
993993
path->slots[level] = 0;

0 commit comments

Comments
 (0)