]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Btrfs: use bigger metadata chunks on bigger filesystems
authorChris Mason <chris.mason@oracle.com>
Fri, 6 Jan 2012 20:47:38 +0000 (15:47 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 6 Jan 2012 20:47:38 +0000 (15:47 -0500)
The 256MB chunk is a little small on a huge FS.  This scales up the
chunk size.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c

index f4b839fd3c9dd5cd854cb7bada4e3831d8ea1713..ac00e3aa80a11c4752e15576c52510befb2f2dcc 100644 (file)
@@ -2441,7 +2441,11 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
                max_stripe_size = 1024 * 1024 * 1024;
                max_chunk_size = 10 * max_stripe_size;
        } else if (type & BTRFS_BLOCK_GROUP_METADATA) {
-               max_stripe_size = 256 * 1024 * 1024;
+               /* for larger filesystems, use larger metadata chunks */
+               if (fs_devices->total_rw_bytes > 50ULL * 1024 * 1024 * 1024)
+                       max_stripe_size = 1024 * 1024 * 1024;
+               else
+                       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;