]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Btrfs: use larger system chunks
authorChris Mason <chris.mason@oracle.com>
Mon, 16 Jan 2012 13:13:11 +0000 (08:13 -0500)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Fri, 27 Jan 2012 01:21:17 +0000 (17:21 -0800)
system chunks by default are very small.  This makes them slightly
larger and also fixes the conditional checks to make sure we don't
allocate a billion of them at once.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 96bdc7dc61fb1b1e8e858dafb13abee8482ba064)

fs/btrfs/extent-tree.c
fs/btrfs/volumes.c

index 03503c50db5605bd0302333dbdf37989b8f00478..791e5553dcb8054e65a48174c8f65fe6fc244dcd 100644 (file)
@@ -3267,6 +3267,9 @@ static int should_alloc_chunk(struct btrfs_root *root,
 
        /* 256MB or 2% of the FS */
        thresh = max_t(u64, 256 * 1024 * 1024, div_factor_fine(thresh, 2));
+       /* system chunks need a much small threshold */
+       if (sinfo->flags & BTRFS_BLOCK_GROUP_SYSTEM)
+               thresh = 32 * 1024 * 1024;
 
        if (num_bytes > thresh && sinfo->bytes_used < div_factor(num_bytes, 8))
                return 0;
index e8f434207f6d88a9b0848ae26fd3f4b3072b9395..a031201930ac1d14230a4ab5f9988229ebea93bc 100644 (file)
@@ -2444,7 +2444,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
                        max_stripe_size = 256 * 1024 * 1024;
                max_chunk_size = max_stripe_size;
        } else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
-               max_stripe_size = 8 * 1024 * 1024;
+               max_stripe_size = 32 * 1024 * 1024;
                max_chunk_size = 2 * max_stripe_size;
        } else {
                printk(KERN_ERR "btrfs: invalid chunk type 0x%llx requested\n",