]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: skip block groups without enough space for a cluster
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Wed, 30 Nov 2011 18:43:00 +0000 (13:43 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:41:34 +0000 (14:41 -0500)
commit480704b8e105a947c8d7b49eb4cb13ff289c60cd
tree2739d51a071c208511b555a39223b5805a6e5963
parent768e4edd707c17d1e9837c567b05ab3ae9c17270
Btrfs: skip block groups without enough space for a cluster

We test whether a block group has enough free space to hold the
requested block, but when we're doing clustered allocation, we can
save some cycles by testing whether it has enough room for the cluster
upfront, otherwise we end up attempting to set up a cluster and
failing.  Only in the NO_EMPTY_SIZE loop do we attempt an unclustered
allocation, and by then we'll have zeroed the cluster size, so this
patch won't stop us from using the block group as a last resort.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 425d83156ca27f74e2cc3f370138038c3c8947f8)
fs/btrfs/extent-tree.c