Commit e48dac7f authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: make should_throttle loop local in btrfs_truncate_inode_items

We reset this bool on every loop through the truncate loop, make this
variable local to the loop.
Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
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 0adbc619
...@@ -473,7 +473,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, ...@@ -473,7 +473,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
int ret; int ret;
u64 bytes_deleted = 0; u64 bytes_deleted = 0;
bool be_nice = false; bool be_nice = false;
bool should_throttle = false;
ASSERT(control->inode || !control->clear_extent_range); ASSERT(control->inode || !control->clear_extent_range);
ASSERT(new_size == 0 || control->min_type == BTRFS_EXTENT_DATA_KEY); ASSERT(new_size == 0 || control->min_type == BTRFS_EXTENT_DATA_KEY);
...@@ -523,6 +522,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, ...@@ -523,6 +522,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
while (1) { while (1) {
u64 clear_start = 0, clear_len = 0, extent_start = 0; u64 clear_start = 0, clear_len = 0, extent_start = 0;
bool should_throttle = false;
fi = NULL; fi = NULL;
leaf = path->nodes[0]; leaf = path->nodes[0];
...@@ -665,7 +665,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, ...@@ -665,7 +665,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
control->last_size = new_size; control->last_size = new_size;
break; break;
} }
should_throttle = false;
if (del_item && extent_start != 0 && !control->skip_ref_updates) { if (del_item && extent_start != 0 && !control->skip_ref_updates) {
struct btrfs_ref ref = { 0 }; struct btrfs_ref ref = { 0 };
......
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