Commit 190a8339 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: rename btrfs_clean_tree_block to btrfs_clear_buffer_dirty

btrfs_clean_tree_block is a misnomer, it's just
clear_extent_buffer_dirty with some extra accounting around it.  Rename
this to btrfs_clear_buffer_dirty to make it more clear it belongs with
it's setter, btrfs_mark_buffer_dirty.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f88fd650
...@@ -484,7 +484,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, ...@@ -484,7 +484,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
if (ret) if (ret)
return ret; return ret;
} }
btrfs_clean_tree_block(trans, buf); btrfs_clear_buffer_dirty(trans, buf);
*last_ref = 1; *last_ref = 1;
} }
return 0; return 0;
...@@ -1054,7 +1054,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ...@@ -1054,7 +1054,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
path->locks[level] = 0; path->locks[level] = 0;
path->nodes[level] = NULL; path->nodes[level] = NULL;
btrfs_clean_tree_block(trans, mid); btrfs_clear_buffer_dirty(trans, mid);
btrfs_tree_unlock(mid); btrfs_tree_unlock(mid);
/* once for the path */ /* once for the path */
free_extent_buffer(mid); free_extent_buffer(mid);
...@@ -1115,7 +1115,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ...@@ -1115,7 +1115,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
if (wret < 0 && wret != -ENOSPC) if (wret < 0 && wret != -ENOSPC)
ret = wret; ret = wret;
if (btrfs_header_nritems(right) == 0) { if (btrfs_header_nritems(right) == 0) {
btrfs_clean_tree_block(trans, right); btrfs_clear_buffer_dirty(trans, right);
btrfs_tree_unlock(right); btrfs_tree_unlock(right);
del_ptr(root, path, level + 1, pslot + 1); del_ptr(root, path, level + 1, pslot + 1);
root_sub_used(root, right->len); root_sub_used(root, right->len);
...@@ -1161,7 +1161,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ...@@ -1161,7 +1161,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
BUG_ON(wret == 1); BUG_ON(wret == 1);
} }
if (btrfs_header_nritems(mid) == 0) { if (btrfs_header_nritems(mid) == 0) {
btrfs_clean_tree_block(trans, mid); btrfs_clear_buffer_dirty(trans, mid);
btrfs_tree_unlock(mid); btrfs_tree_unlock(mid);
del_ptr(root, path, level + 1, pslot); del_ptr(root, path, level + 1, pslot);
root_sub_used(root, mid->len); root_sub_used(root, mid->len);
...@@ -3140,7 +3140,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, ...@@ -3140,7 +3140,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
if (left_nritems) if (left_nritems)
btrfs_mark_buffer_dirty(left); btrfs_mark_buffer_dirty(left);
else else
btrfs_clean_tree_block(trans, left); btrfs_clear_buffer_dirty(trans, left);
btrfs_mark_buffer_dirty(right); btrfs_mark_buffer_dirty(right);
...@@ -3152,7 +3152,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, ...@@ -3152,7 +3152,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
if (path->slots[0] >= left_nritems) { if (path->slots[0] >= left_nritems) {
path->slots[0] -= left_nritems; path->slots[0] -= left_nritems;
if (btrfs_header_nritems(path->nodes[0]) == 0) if (btrfs_header_nritems(path->nodes[0]) == 0)
btrfs_clean_tree_block(trans, path->nodes[0]); btrfs_clear_buffer_dirty(trans, path->nodes[0]);
btrfs_tree_unlock(path->nodes[0]); btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]); free_extent_buffer(path->nodes[0]);
path->nodes[0] = right; path->nodes[0] = right;
...@@ -3365,7 +3365,7 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, ...@@ -3365,7 +3365,7 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
if (right_nritems) if (right_nritems)
btrfs_mark_buffer_dirty(right); btrfs_mark_buffer_dirty(right);
else else
btrfs_clean_tree_block(trans, right); btrfs_clear_buffer_dirty(trans, right);
btrfs_item_key(right, &disk_key, 0); btrfs_item_key(right, &disk_key, 0);
fixup_low_keys(path, &disk_key, 1); fixup_low_keys(path, &disk_key, 1);
...@@ -4401,7 +4401,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, ...@@ -4401,7 +4401,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
if (leaf == root->node) { if (leaf == root->node) {
btrfs_set_header_level(leaf, 0); btrfs_set_header_level(leaf, 0);
} else { } else {
btrfs_clean_tree_block(trans, leaf); btrfs_clear_buffer_dirty(trans, leaf);
btrfs_del_leaf(trans, root, path, leaf); btrfs_del_leaf(trans, root, path, leaf);
} }
} else { } else {
......
...@@ -868,8 +868,8 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, ...@@ -868,8 +868,8 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
} }
void btrfs_clean_tree_block(struct btrfs_trans_handle *trans, void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
struct extent_buffer *buf) struct extent_buffer *buf)
{ {
struct btrfs_fs_info *fs_info = buf->fs_info; struct btrfs_fs_info *fs_info = buf->fs_info;
if (!trans || btrfs_header_generation(buf) == trans->transid) { if (!trans || btrfs_header_generation(buf) == trans->transid) {
...@@ -4998,7 +4998,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_fs_info *fs_info, ...@@ -4998,7 +4998,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_fs_info *fs_info,
btrfs_tree_lock(eb); btrfs_tree_lock(eb);
wait_on_extent_buffer_writeback(eb); wait_on_extent_buffer_writeback(eb);
btrfs_clean_tree_block(NULL, eb); btrfs_clear_buffer_dirty(NULL, eb);
btrfs_tree_unlock(eb); btrfs_tree_unlock(eb);
free_extent_buffer_stale(eb); free_extent_buffer_stale(eb);
......
...@@ -39,8 +39,8 @@ struct extent_buffer *btrfs_find_create_tree_block( ...@@ -39,8 +39,8 @@ struct extent_buffer *btrfs_find_create_tree_block(
struct btrfs_fs_info *fs_info, struct btrfs_fs_info *fs_info,
u64 bytenr, u64 owner_root, u64 bytenr, u64 owner_root,
int level); int level);
void btrfs_clean_tree_block(struct btrfs_trans_handle *trans, void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
struct extent_buffer *buf); struct extent_buffer *buf);
void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info); void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info);
int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info); int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info);
int btrfs_check_super_csum(struct btrfs_fs_info *fs_info, int btrfs_check_super_csum(struct btrfs_fs_info *fs_info,
......
...@@ -4838,7 +4838,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root, ...@@ -4838,7 +4838,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
btrfs_set_buffer_lockdep_class(lockdep_owner, buf, level); btrfs_set_buffer_lockdep_class(lockdep_owner, buf, level);
__btrfs_tree_lock(buf, nest); __btrfs_tree_lock(buf, nest);
btrfs_clean_tree_block(trans, buf); btrfs_clear_buffer_dirty(trans, buf);
clear_bit(EXTENT_BUFFER_STALE, &buf->bflags); clear_bit(EXTENT_BUFFER_STALE, &buf->bflags);
clear_bit(EXTENT_BUFFER_NO_CHECK, &buf->bflags); clear_bit(EXTENT_BUFFER_NO_CHECK, &buf->bflags);
...@@ -5468,12 +5468,12 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans, ...@@ -5468,12 +5468,12 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
} }
} }
} }
/* make block locked assertion in btrfs_clean_tree_block happy */ /* Make block locked assertion in btrfs_clear_buffer_dirty happy. */
if (!path->locks[level]) { if (!path->locks[level]) {
btrfs_tree_lock(eb); btrfs_tree_lock(eb);
path->locks[level] = BTRFS_WRITE_LOCK; path->locks[level] = BTRFS_WRITE_LOCK;
} }
btrfs_clean_tree_block(trans, eb); btrfs_clear_buffer_dirty(trans, eb);
} }
if (eb == root->node) { if (eb == root->node) {
......
...@@ -1283,7 +1283,7 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info) ...@@ -1283,7 +1283,7 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info)
list_del(&free_space_root->dirty_list); list_del(&free_space_root->dirty_list);
btrfs_tree_lock(free_space_root->node); btrfs_tree_lock(free_space_root->node);
btrfs_clean_tree_block(trans, free_space_root->node); btrfs_clear_buffer_dirty(trans, free_space_root->node);
btrfs_tree_unlock(free_space_root->node); btrfs_tree_unlock(free_space_root->node);
btrfs_free_tree_block(trans, btrfs_root_id(free_space_root), btrfs_free_tree_block(trans, btrfs_root_id(free_space_root),
free_space_root->node, 0, 1); free_space_root->node, 0, 1);
......
...@@ -707,7 +707,7 @@ static noinline int create_subvol(struct user_namespace *mnt_userns, ...@@ -707,7 +707,7 @@ static noinline int create_subvol(struct user_namespace *mnt_userns,
* exists). * exists).
*/ */
btrfs_tree_lock(leaf); btrfs_tree_lock(leaf);
btrfs_clean_tree_block(trans, leaf); btrfs_clear_buffer_dirty(trans, leaf);
btrfs_tree_unlock(leaf); btrfs_tree_unlock(leaf);
btrfs_free_tree_block(trans, objectid, leaf, 0, 1); btrfs_free_tree_block(trans, objectid, leaf, 0, 1);
free_extent_buffer(leaf); free_extent_buffer(leaf);
......
...@@ -1304,7 +1304,7 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info) ...@@ -1304,7 +1304,7 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
list_del(&quota_root->dirty_list); list_del(&quota_root->dirty_list);
btrfs_tree_lock(quota_root->node); btrfs_tree_lock(quota_root->node);
btrfs_clean_tree_block(trans, quota_root->node); btrfs_clear_buffer_dirty(trans, quota_root->node);
btrfs_tree_unlock(quota_root->node); btrfs_tree_unlock(quota_root->node);
btrfs_free_tree_block(trans, btrfs_root_id(quota_root), btrfs_free_tree_block(trans, btrfs_root_id(quota_root),
quota_root->node, 0, 1); quota_root->node, 0, 1);
......
...@@ -2624,7 +2624,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, ...@@ -2624,7 +2624,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
} }
btrfs_tree_lock(next); btrfs_tree_lock(next);
btrfs_clean_tree_block(trans, next); btrfs_clear_buffer_dirty(trans, next);
btrfs_wait_tree_block_writeback(next); btrfs_wait_tree_block_writeback(next);
btrfs_tree_unlock(next); btrfs_tree_unlock(next);
...@@ -2693,7 +2693,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, ...@@ -2693,7 +2693,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
next = path->nodes[*level]; next = path->nodes[*level];
btrfs_tree_lock(next); btrfs_tree_lock(next);
btrfs_clean_tree_block(trans, next); btrfs_clear_buffer_dirty(trans, next);
btrfs_wait_tree_block_writeback(next); btrfs_wait_tree_block_writeback(next);
btrfs_tree_unlock(next); btrfs_tree_unlock(next);
...@@ -2774,7 +2774,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans, ...@@ -2774,7 +2774,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,
next = path->nodes[orig_level]; next = path->nodes[orig_level];
btrfs_tree_lock(next); btrfs_tree_lock(next);
btrfs_clean_tree_block(trans, next); btrfs_clear_buffer_dirty(trans, next);
btrfs_wait_tree_block_writeback(next); btrfs_wait_tree_block_writeback(next);
btrfs_tree_unlock(next); btrfs_tree_unlock(next);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment