Skip to content

Commit

Permalink
btrfs: skip LOOP_NO_EMPTY_SIZE if not clustered allocation
Browse files Browse the repository at this point in the history
LOOP_NO_EMPTY_SIZE is solely dedicated for clustered allocation. So, we
can skip this stage and give up the allocation.

Signed-off-by: Naohiro Aota <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
naota authored and kdave committed Mar 23, 2020
1 parent c70e213 commit 45d8e03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3835,6 +3835,9 @@ static int find_free_extent_update_loop(struct btrfs_fs_info *fs_info,
}

if (ffe_ctl->loop == LOOP_NO_EMPTY_SIZE) {
if (ffe_ctl->policy != BTRFS_EXTENT_ALLOC_CLUSTERED)
return -ENOSPC;

/*
* Don't loop again if we already have no empty_size and
* no empty_cluster.
Expand Down

0 comments on commit 45d8e03

Please sign in to comment.