summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik2015-10-02 21:25:10 +0200
committerChris Mason2015-10-22 03:55:39 +0200
commitc759c4e16179e47e099f491011e6acd7858f8625 (patch)
tree1b97ad895f5546f867d0b12df3910848e69f1016 /fs/btrfs/ctree.h
parentBtrfs: cut down on loops through the allocator (diff)
downloadkernel-qcow2-linux-c759c4e16179e47e099f491011e6acd7858f8625.tar.gz
kernel-qcow2-linux-c759c4e16179e47e099f491011e6acd7858f8625.tar.xz
kernel-qcow2-linux-c759c4e16179e47e099f491011e6acd7858f8625.zip
Btrfs: don't keep trying to build clusters if we are fragmented
If we are extremely fragmented then we won't be able to create a free_cluster. So if this happens set last_ptr->fragmented so that all future allcations will give up trying to create a cluster. When we unpin extents we will unset ->fragmented if we free up a sufficient amount of space in a block group. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 78a8f56c7e88..ced08c9608e2 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1232,6 +1232,9 @@ struct btrfs_free_cluster {
/* first extent starting offset */
u64 window_start;
+ /* We did a full search and couldn't create a cluster */
+ bool fragmented;
+
struct btrfs_block_group_cache *block_group;
/*
* when a cluster is allocated from a block group, we put the