aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-11-11 10:16:57 -0500
committerChris Mason <chris.mason@oracle.com>2009-11-11 14:20:20 -0500
commit33b258086441dd07e00133c79fcd8cbc6a76d737 (patch)
treebeab74a12b7650576dbe2f97301f0905699d4292 /fs/btrfs/extent-tree.c
parentf5a84ee3cdd88d96b7bcede10af58598ad8d52a7 (diff)
Btrfs: allow more metadata chunk preallocation
On an FS where all of the space has not been allocated into chunks yet, the enospc can return enospc just because the existing metadata chunks are full. We get around this by allowing more metadata chunks to be allocated up to a certain limit, and finding the right limit is a little fuzzy. The problem is the reservations for delalloc would preallocate way too much of the FS as metadata. We need to start saying no and just force some IO to happen. But we also need to let a reasonable amount of the FS become metadata. This bumps the hard limit up, later releases will have a better system. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2a4cdceeb575..8d1fd6dc22ac 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2976,10 +2976,10 @@ static int maybe_allocate_chunk(struct btrfs_root *root,
2976 2976
2977 free_space = btrfs_super_total_bytes(disk_super); 2977 free_space = btrfs_super_total_bytes(disk_super);
2978 /* 2978 /*
2979 * we allow the metadata to grow to a max of either 5gb or 5% of the 2979 * we allow the metadata to grow to a max of either 10gb or 5% of the
2980 * space in the volume. 2980 * space in the volume.
2981 */ 2981 */
2982 min_metadata = min((u64)5 * 1024 * 1024 * 1024, 2982 min_metadata = min((u64)10 * 1024 * 1024 * 1024,
2983 div64_u64(free_space * 5, 100)); 2983 div64_u64(free_space * 5, 100));
2984 if (info->total_bytes >= min_metadata) { 2984 if (info->total_bytes >= min_metadata) {
2985 spin_unlock(&info->lock); 2985 spin_unlock(&info->lock);