summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-07-21 10:22:29 -0400
committerDavid Sterba <dsterba@suse.com>2020-10-07 12:06:53 +0200
commit028270013586681b02db49be20e05b56e662dc55 (patch)
tree7a93ff82aeacec14786f51a86b80ca4179791fc8 /fs
parentf3bda421c16fe2f67cb3ff81b65ce8de331dd8e2 (diff)
downloadlinux-028270013586681b02db49be20e05b56e662dc55.tar.bz2
btrfs: drop the commit_cycles stuff for data reservations
This was an old wart left over from how we previously did data reservations. Before we could have people race in and take a reservation while we were flushing space, so we needed to make sure we looped a few times before giving up. Now that we're using the ticketing infrastructure we don't have to worry about this and can drop the logic altogether. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Tested-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/space-info.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 87f92fc67542..244cd2a61386 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -1077,7 +1077,6 @@ static void priority_reclaim_data_space(struct btrfs_fs_info *fs_info,
int states_nr)
{
int flush_state = 0;
- int commit_cycles = 2;
while (!space_info->full) {
flush_space(fs_info, space_info, U64_MAX, ALLOC_CHUNK_FORCE);
@@ -1088,20 +1087,9 @@ static void priority_reclaim_data_space(struct btrfs_fs_info *fs_info,
}
spin_unlock(&space_info->lock);
}
-again:
- while (flush_state < states_nr) {
- u64 flush_bytes = U64_MAX;
-
- if (!commit_cycles) {
- if (states[flush_state] == FLUSH_DELALLOC_WAIT) {
- flush_state++;
- continue;
- }
- if (states[flush_state] == COMMIT_TRANS)
- flush_bytes = ticket->bytes;
- }
- flush_space(fs_info, space_info, flush_bytes, states[flush_state]);
+ while (flush_state < states_nr) {
+ flush_space(fs_info, space_info, U64_MAX, states[flush_state]);
spin_lock(&space_info->lock);
if (ticket->bytes == 0) {
spin_unlock(&space_info->lock);
@@ -1110,11 +1098,6 @@ again:
spin_unlock(&space_info->lock);
flush_state++;
}
- if (commit_cycles) {
- commit_cycles--;
- flush_state = 0;
- goto again;
- }
}
static void wait_reserve_ticket(struct btrfs_fs_info *fs_info,