btrfs: qgroup: Add the ability to skip given qgroup for old/new_roots.
This is used by later qgroup fix patches for snapshot. As current snapshot accounting is done by btrfs_qgroup_inherit(), but new extent oriented quota mechanism will account extent from btrfs_copy_root() and other snapshot things, causing wrong result. So add this ability to handle snapshot accounting. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Este cometimento está contido em:

cometido por
Chris Mason

ascendente
d4b8040459
cometimento
9086db86e0
@@ -154,6 +154,29 @@ static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans,
|
||||
spin_unlock(&BTRFS_I(inode)->lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make qgroup codes to skip given qgroupid, means the old/new_roots for
|
||||
* qgroup won't contain the qgroupid in it.
|
||||
*/
|
||||
static inline void btrfs_set_skip_qgroup(struct btrfs_trans_handle *trans,
|
||||
u64 qgroupid)
|
||||
{
|
||||
struct btrfs_delayed_ref_root *delayed_refs;
|
||||
|
||||
delayed_refs = &trans->transaction->delayed_refs;
|
||||
WARN_ON(delayed_refs->qgroup_to_skip);
|
||||
delayed_refs->qgroup_to_skip = qgroupid;
|
||||
}
|
||||
|
||||
static inline void btrfs_clear_skip_qgroup(struct btrfs_trans_handle *trans)
|
||||
{
|
||||
struct btrfs_delayed_ref_root *delayed_refs;
|
||||
|
||||
delayed_refs = &trans->transaction->delayed_refs;
|
||||
WARN_ON(!delayed_refs->qgroup_to_skip);
|
||||
delayed_refs->qgroup_to_skip = 0;
|
||||
}
|
||||
|
||||
int btrfs_end_transaction(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root);
|
||||
struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador