summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik2009-04-21 23:40:57 +0200
committerChris Mason2009-04-24 21:46:02 +0200
commit97e728d4353f38c87bf0804cdfd79a9b13fc2c3e (patch)
tree853d3317ff1476e4ad28921265e28b4919196304 /fs/btrfs/ctree.h
parentBtrfs: fix btrfs fallocate oops and deadlock (diff)
downloadkernel-qcow2-linux-97e728d4353f38c87bf0804cdfd79a9b13fc2c3e.tar.gz
kernel-qcow2-linux-97e728d4353f38c87bf0804cdfd79a9b13fc2c3e.tar.xz
kernel-qcow2-linux-97e728d4353f38c87bf0804cdfd79a9b13fc2c3e.zip
Btrfs: try to keep a healthy ratio of metadata vs data block groups
This patch makes the chunk allocator keep a good ratio of metadata vs data block groups. By default for every 8 data block groups, we'll allocate 1 metadata chunk, or about 12% of the disk will be allocated for metadata. This can be changed by specifying the metadata_ratio mount option. This is simply the number of data block groups that have to be allocated to force a metadata chunk allocation. By making sure we allocate metadata chunks more often, we are less likely to get into situations where the whole disk has been allocated as data block groups. Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index ad96495dedc5..213535f45da2 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -881,6 +881,9 @@ struct btrfs_fs_info {
u64 metadata_alloc_profile;
u64 system_alloc_profile;
+ unsigned data_chunk_allocations;
+ unsigned metadata_ratio;
+
void *bdev_holder;
};