diff options
author | David Sterba <dsterba@suse.com> | 2018-04-03 20:00:17 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-02-25 08:13:27 -0500 |
commit | 300aa896e1199bcd0dfb61aae86356714e017355 (patch) | |
tree | 00235669e8fac6f0f87c1293ab56cc015a9cf7c6 /fs | |
parent | aa12c02778a9719283fc3c32cfe5cffb902a7685 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/backref.c | 4 | ||||
-rw-r--r-- | fs/btrfs/ctree.c | 4 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/locking.h | 2 | ||||
-rw-r--r-- | fs/btrfs/qgroup.c | 6 | ||||
-rw-r--r-- | fs/btrfs/ref-verify.c | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 78556447e1d5..136454dbb4af 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -1289,7 +1289,7 @@ again: | |||
1289 | goto out; | 1289 | goto out; |
1290 | } | 1290 | } |
1291 | btrfs_tree_read_lock(eb); | 1291 | btrfs_tree_read_lock(eb); |
1292 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1292 | btrfs_set_lock_blocking_read(eb); |
1293 | ret = find_extent_in_eb(eb, bytenr, | 1293 | ret = find_extent_in_eb(eb, bytenr, |
1294 | *extent_item_pos, &eie, ignore_offset); | 1294 | *extent_item_pos, &eie, ignore_offset); |
1295 | btrfs_tree_read_unlock_blocking(eb); | 1295 | btrfs_tree_read_unlock_blocking(eb); |
@@ -1650,7 +1650,7 @@ char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, | |||
1650 | /* make sure we can use eb after releasing the path */ | 1650 | /* make sure we can use eb after releasing the path */ |
1651 | if (eb != eb_in) { | 1651 | if (eb != eb_in) { |
1652 | if (!path->skip_locking) | 1652 | if (!path->skip_locking) |
1653 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1653 | btrfs_set_lock_blocking_read(eb); |
1654 | path->nodes[0] = NULL; | 1654 | path->nodes[0] = NULL; |
1655 | path->locks[0] = 0; | 1655 | path->locks[0] = 0; |
1656 | } | 1656 | } |
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 0f2c20e0b108..75e0f737d7d2 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -1289,7 +1289,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct btrfs_path *path, | |||
1289 | return eb; | 1289 | return eb; |
1290 | 1290 | ||
1291 | btrfs_set_path_blocking(path); | 1291 | btrfs_set_path_blocking(path); |
1292 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1292 | btrfs_set_lock_blocking_read(eb); |
1293 | 1293 | ||
1294 | if (tm->op == MOD_LOG_KEY_REMOVE_WHILE_FREEING) { | 1294 | if (tm->op == MOD_LOG_KEY_REMOVE_WHILE_FREEING) { |
1295 | BUG_ON(tm->slot != 0); | 1295 | BUG_ON(tm->slot != 0); |
@@ -1379,7 +1379,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) | |||
1379 | free_extent_buffer(eb_root); | 1379 | free_extent_buffer(eb_root); |
1380 | eb = alloc_dummy_extent_buffer(fs_info, logical); | 1380 | eb = alloc_dummy_extent_buffer(fs_info, logical); |
1381 | } else { | 1381 | } else { |
1382 | btrfs_set_lock_blocking_rw(eb_root, BTRFS_READ_LOCK); | 1382 | btrfs_set_lock_blocking_read(eb_root); |
1383 | eb = btrfs_clone_extent_buffer(eb_root); | 1383 | eb = btrfs_clone_extent_buffer(eb_root); |
1384 | btrfs_tree_read_unlock_blocking(eb_root); | 1384 | btrfs_tree_read_unlock_blocking(eb_root); |
1385 | free_extent_buffer(eb_root); | 1385 | free_extent_buffer(eb_root); |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 3d233608fa0f..74a696d9cd68 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -342,7 +342,7 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, | |||
342 | 342 | ||
343 | if (need_lock) { | 343 | if (need_lock) { |
344 | btrfs_tree_read_lock(eb); | 344 | btrfs_tree_read_lock(eb); |
345 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 345 | btrfs_set_lock_blocking_read(eb); |
346 | } | 346 | } |
347 | 347 | ||
348 | lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, | 348 | lock_extent_bits(io_tree, eb->start, eb->start + eb->len - 1, |
diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h index 3f81d6900c71..9d9f649e35cc 100644 --- a/fs/btrfs/locking.h +++ b/fs/btrfs/locking.h | |||
@@ -53,7 +53,7 @@ static inline void btrfs_set_lock_blocking_rw(struct extent_buffer *eb, int rw) | |||
53 | 53 | ||
54 | static inline void btrfs_set_lock_blocking(struct extent_buffer *eb) | 54 | static inline void btrfs_set_lock_blocking(struct extent_buffer *eb) |
55 | { | 55 | { |
56 | btrfs_set_lock_blocking_rw(eb, BTRFS_WRITE_LOCK); | 56 | btrfs_set_lock_blocking_write(eb); |
57 | } | 57 | } |
58 | 58 | ||
59 | #endif | 59 | #endif |
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index ad041668ee3f..d316df95bec4 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -1832,7 +1832,7 @@ static int qgroup_trace_extent_swap(struct btrfs_trans_handle* trans, | |||
1832 | src_path->nodes[cur_level] = eb; | 1832 | src_path->nodes[cur_level] = eb; |
1833 | 1833 | ||
1834 | btrfs_tree_read_lock(eb); | 1834 | btrfs_tree_read_lock(eb); |
1835 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1835 | btrfs_set_lock_blocking_read(eb); |
1836 | src_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING; | 1836 | src_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING; |
1837 | } | 1837 | } |
1838 | 1838 | ||
@@ -1973,7 +1973,7 @@ static int qgroup_trace_new_subtree_blocks(struct btrfs_trans_handle* trans, | |||
1973 | dst_path->slots[cur_level] = 0; | 1973 | dst_path->slots[cur_level] = 0; |
1974 | 1974 | ||
1975 | btrfs_tree_read_lock(eb); | 1975 | btrfs_tree_read_lock(eb); |
1976 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 1976 | btrfs_set_lock_blocking_read(eb); |
1977 | dst_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING; | 1977 | dst_path->locks[cur_level] = BTRFS_READ_LOCK_BLOCKING; |
1978 | need_cleanup = true; | 1978 | need_cleanup = true; |
1979 | } | 1979 | } |
@@ -2148,7 +2148,7 @@ walk_down: | |||
2148 | path->slots[level] = 0; | 2148 | path->slots[level] = 0; |
2149 | 2149 | ||
2150 | btrfs_tree_read_lock(eb); | 2150 | btrfs_tree_read_lock(eb); |
2151 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 2151 | btrfs_set_lock_blocking_read(eb); |
2152 | path->locks[level] = BTRFS_READ_LOCK_BLOCKING; | 2152 | path->locks[level] = BTRFS_READ_LOCK_BLOCKING; |
2153 | 2153 | ||
2154 | ret = btrfs_qgroup_trace_extent(trans, child_bytenr, | 2154 | ret = btrfs_qgroup_trace_extent(trans, child_bytenr, |
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index c3557c12656b..d09b6cdb785a 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c | |||
@@ -583,7 +583,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, | |||
583 | return -EIO; | 583 | return -EIO; |
584 | } | 584 | } |
585 | btrfs_tree_read_lock(eb); | 585 | btrfs_tree_read_lock(eb); |
586 | btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | 586 | btrfs_set_lock_blocking_read(eb); |
587 | path->nodes[level-1] = eb; | 587 | path->nodes[level-1] = eb; |
588 | path->slots[level-1] = 0; | 588 | path->slots[level-1] = 0; |
589 | path->locks[level-1] = BTRFS_READ_LOCK_BLOCKING; | 589 | path->locks[level-1] = BTRFS_READ_LOCK_BLOCKING; |
@@ -987,7 +987,7 @@ int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info) | |||
987 | return -ENOMEM; | 987 | return -ENOMEM; |
988 | 988 | ||
989 | eb = btrfs_read_lock_root_node(fs_info->extent_root); | 989 | 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); |
991 | level = btrfs_header_level(eb); | 991 | level = btrfs_header_level(eb); |
992 | path->nodes[level] = eb; | 992 | path->nodes[level] = eb; |
993 | path->slots[level] = 0; | 993 | path->slots[level] = 0; |