From 6f3a2f0327d8fe016e14899a7a6c331e6e34c853 Mon Sep 17 00:00:00 2001 From: Arne Jansen Date: Tue, 13 Sep 2011 12:56:09 +0200 Subject: [PATCH] --- yaml --- r: 318875 b: refs/heads/master c: 416ac51da90e98daaac17e1f359a6c5591f7f5bd h: refs/heads/master i: 318873: 246440f0d475bc5f1300280122dc270a536a70e0 318871: 26f5d55b70517ffdb7bc027130c32fbde3dcfd67 v: v3 --- [refs] | 2 +- trunk/fs/btrfs/ctree.h | 24 ++++++++++++++++++++++++ trunk/fs/btrfs/disk-io.c | 7 +++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d90abc3ed73a..4512f35d3215 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 20897f5c86b9d2b77baea1d48eda7fa4ac217279 +refs/heads/master: 416ac51da90e98daaac17e1f359a6c5591f7f5bd diff --git a/trunk/fs/btrfs/ctree.h b/trunk/fs/btrfs/ctree.h index 27cf995564ed..a5269d4a164f 100644 --- a/trunk/fs/btrfs/ctree.h +++ b/trunk/fs/btrfs/ctree.h @@ -1120,6 +1120,7 @@ struct btrfs_fs_info { struct btrfs_root *dev_root; struct btrfs_root *fs_root; struct btrfs_root *csum_root; + struct btrfs_root *quota_root; /* the log root tree is a directory of all the other log roots */ struct btrfs_root *log_root_tree; @@ -1374,6 +1375,29 @@ struct btrfs_fs_info { #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY u32 check_integrity_print_mask; #endif + /* + * quota information + */ + unsigned int quota_enabled:1; + + /* + * quota_enabled only changes state after a commit. This holds the + * next state. + */ + unsigned int pending_quota_state:1; + + /* is qgroup tracking in a consistent state? */ + u64 qgroup_flags; + + /* holds configuration and tracking. Protected by qgroup_lock */ + struct rb_root qgroup_tree; + spinlock_t qgroup_lock; + + /* list of dirty qgroups to be written at next commit */ + struct list_head dirty_qgroups; + + /* used by btrfs_qgroup_record_ref for an efficient tree traversal */ + u64 qgroup_seq; /* filesystem state */ u64 fs_state; diff --git a/trunk/fs/btrfs/disk-io.c b/trunk/fs/btrfs/disk-io.c index 6fc243eccffa..eca054974425 100644 --- a/trunk/fs/btrfs/disk-io.c +++ b/trunk/fs/btrfs/disk-io.c @@ -2110,6 +2110,13 @@ int open_ctree(struct super_block *sb, init_rwsem(&fs_info->cleanup_work_sem); init_rwsem(&fs_info->subvol_sem); + spin_lock_init(&fs_info->qgroup_lock); + fs_info->qgroup_tree = RB_ROOT; + INIT_LIST_HEAD(&fs_info->dirty_qgroups); + fs_info->qgroup_seq = 1; + fs_info->quota_enabled = 0; + fs_info->pending_quota_state = 0; + btrfs_init_free_cluster(&fs_info->meta_alloc_cluster); btrfs_init_free_cluster(&fs_info->data_alloc_cluster);