aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2010-09-16 16:19:09 -0400
committerChris Mason <chris.mason@oracle.com>2010-10-29 09:26:36 -0400
commit67377734fd24c32cbdfeb697c2e2bd7fed519e75 (patch)
tree5b295333ab943d24b190bd3fef2486dfffa7de47 /fs/btrfs/ctree.h
parentdde5abee12327d59f968bbfc8151e1b04082a2c4 (diff)
Btrfs: add support for mixed data+metadata block groups
There are just a few things that need to be fixed in the kernel to support mixed data+metadata block groups. Mostly we just need to make sure that if we are using mixed block groups that we continue to allocate mixed block groups as we need them. Also we need to make sure __find_space_info will find our space info if we search for DATA or METADATA only. Tested this with xfstests and it works nicely. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2c06b37cda75..b155a0e49eeb 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -397,12 +397,14 @@ struct btrfs_super_block {
397 */ 397 */
398#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) 398#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
399#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1) 399#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
400#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
400 401
401#define BTRFS_FEATURE_COMPAT_SUPP 0ULL 402#define BTRFS_FEATURE_COMPAT_SUPP 0ULL
402#define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL 403#define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL
403#define BTRFS_FEATURE_INCOMPAT_SUPP \ 404#define BTRFS_FEATURE_INCOMPAT_SUPP \
404 (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \ 405 (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \
405 BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) 406 BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL | \
407 BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)
406 408
407/* 409/*
408 * A leaf is full of items. offset and size tell us where to find 410 * A leaf is full of items. offset and size tell us where to find
@@ -2046,6 +2048,12 @@ static inline struct dentry *fdentry(struct file *file)
2046 return file->f_path.dentry; 2048 return file->f_path.dentry;
2047} 2049}
2048 2050
2051static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info)
2052{
2053 return ((space_info->flags & BTRFS_BLOCK_GROUP_METADATA) &&
2054 (space_info->flags & BTRFS_BLOCK_GROUP_DATA));
2055}
2056
2049/* extent-tree.c */ 2057/* extent-tree.c */
2050void btrfs_put_block_group(struct btrfs_block_group_cache *cache); 2058void btrfs_put_block_group(struct btrfs_block_group_cache *cache);
2051int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, 2059int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,