diff options
author | Josef Bacik <josef@redhat.com> | 2011-03-21 10:11:24 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-03-25 19:08:08 -0400 |
commit | 4e69b598f6cfb0940b75abf7e179d6020e94ad1e (patch) | |
tree | ae14c7078bd7540200ffe32726e33dd8ff64f5d5 /fs/btrfs/ctree.h | |
parent | 32cb0840ce8e13901fe71a9a8e834a531802ffc4 (diff) |
Btrfs: cleanup how we setup free space clusters
This patch makes the free space cluster refilling code a little easier to
understand, and fixes some things with the bitmap part of it. Currently we
either want to refill a cluster with
1) All normal extent entries (those without bitmaps)
2) A bitmap entry with enough space
The current code has this ugly jump around logic that will first try and fill up
the cluster with extent entries and then if it can't do that it will try and
find a bitmap to use. So instead split this out into two functions, one that
tries to find only normal entries, and one that tries to find bitmaps.
This also fixes a suboptimal thing we would do with bitmaps. If we used a
bitmap we would just tell the cluster that we were pointing at a bitmap and it
would do the tree search in the block group for that entry every time we tried
to make an allocation. Instead of doing that now we just add it to the clusters
group.
I tested this with my ENOSPC tests and xfstests and it survived.
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 6036fdb88c53..0ee679b6c1b7 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -783,9 +783,6 @@ struct btrfs_free_cluster { | |||
783 | /* first extent starting offset */ | 783 | /* first extent starting offset */ |
784 | u64 window_start; | 784 | u64 window_start; |
785 | 785 | ||
786 | /* if this cluster simply points at a bitmap in the block group */ | ||
787 | bool points_to_bitmap; | ||
788 | |||
789 | struct btrfs_block_group_cache *block_group; | 786 | struct btrfs_block_group_cache *block_group; |
790 | /* | 787 | /* |
791 | * when a cluster is allocated from a block group, we put the | 788 | * when a cluster is allocated from a block group, we put the |