On 2/12/20 2:20 AM, Naohiro Aota wrote:
LOOP_NO_EMPTY_SIZE is solely dedicated for clustered allocation. So,
we can skip this stage and go to LOOP_GIVEUP stage to indicate we gave
up the allocation. This commit also moves the scope of the "clustered"
variable.
Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx>
---
fs/btrfs/extent-tree.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 8f0d489f76fa..3ab0d2f5d718 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3373,6 +3373,7 @@ enum btrfs_loop_type {
LOOP_CACHING_WAIT,
LOOP_ALLOC_CHUNK,
LOOP_NO_EMPTY_SIZE,
+ LOOP_GIVEUP,
Why do we need a new loop definition here? Can we just return ENOSPC and be
done? You don't appear to use it anywhere, so it doesn't seem like it's needed.
Thanks,
Josef