]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: try to keep a healthy ratio of metadata vs data block groups
authorJosef Bacik <jbacik@redhat.com>
Tue, 21 Apr 2009 21:40:57 +0000 (17:40 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 24 Apr 2009 19:46:02 +0000 (15:46 -0400)
commiteff75475b67a7ee2a144af2b4fc4e7b3f5b3e720
tree853d3317ff1476e4ad28921265e28b4919196304
parentd6b7cd860773e0b7479ace7de149ad117b1233ce
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>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/super.c