]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - fs/btrfs/volumes.c
Merge branch 'restriper' of git://github.com/idryomov/btrfs-unstable into integration
[can-eth-gw-linux.git] / fs / btrfs / volumes.c
index d73439b4d7da18f6a644a5f7c97d2a1a0efa759a..9489a2aca47b04bef55c159dcd5e56615ba3ee86 100644 (file)
@@ -3162,7 +3162,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;