summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-01-26 21:01:12 +0100
committerChris Mason <chris.mason@oracle.com>2012-01-26 21:01:12 +0100
commit9b23062840e7c685ef0a0b561285d6e3a3b6811b (patch)
tree47c00ad85dced3c4712b03de926b77c4aad99a77
parentbtrfs: mask out gfp flags in releasepage (diff)
downloadlinux-9b23062840e7c685ef0a0b561285d6e3a3b6811b.tar.xz
linux-9b23062840e7c685ef0a0b561285d6e3a3b6811b.zip
Btrfs: advance window_start if we're using a bitmap
If we span a long area in a bitmap we could end up taking a lot of time searching to the next free area if we're searching from the original window_start, so advance window_start in order to make sure we don't do any superficial searching. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/free-space-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 61447a51f645..5802b1473c3d 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2251,6 +2251,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
offset_index);
continue;
}
+ cluster->window_start += bytes;
} else {
ret = entry->offset;