From: Chris Mason Date: Fri, 6 Jan 2012 20:47:38 +0000 (-0500) Subject: Btrfs: use bigger metadata chunks on bigger filesystems X-Git-Tag: upstream/snapshot3+hdmi~8007^2~50^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1100373f8aa69e377386499350496e3d8565605f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Btrfs: use bigger metadata chunks on bigger filesystems The 256MB chunk is a little small on a huge FS. This scales up the chunk size. Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f4b839f..ac00e3a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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;