Lines Matching refs:qg
1571 struct btrfs_qgroup *qg; in qgroup_calc_old_refcnt() local
1579 qg = find_qgroup_rb(fs_info, unode->val); in qgroup_calc_old_refcnt()
1580 if (!qg) in qgroup_calc_old_refcnt()
1594 ret = ulist_add(qgroups, qg->qgroupid, ptr_to_u64(qg), in qgroup_calc_old_refcnt()
1598 ret = ulist_add(tmp, qg->qgroupid, ptr_to_u64(qg), GFP_ATOMIC); in qgroup_calc_old_refcnt()
1605 qg = u64_to_ptr(tmp_unode->aux); in qgroup_calc_old_refcnt()
1619 qg->old_refcnt = seq; in qgroup_calc_old_refcnt()
1620 else if (qg->old_refcnt < seq) in qgroup_calc_old_refcnt()
1621 qg->old_refcnt = seq + 1; in qgroup_calc_old_refcnt()
1623 qg->old_refcnt++; in qgroup_calc_old_refcnt()
1625 if (qg->new_refcnt < seq) in qgroup_calc_old_refcnt()
1626 qg->new_refcnt = seq + 1; in qgroup_calc_old_refcnt()
1628 qg->new_refcnt++; in qgroup_calc_old_refcnt()
1629 list_for_each_entry(glist, &qg->groups, next_group) { in qgroup_calc_old_refcnt()
1658 struct btrfs_qgroup *qg; in qgroup_account_deleted_refs() local
1683 qg = find_qgroup_rb(fs_info, tmp_oper->ref_root); in qgroup_account_deleted_refs()
1684 if (!qg) in qgroup_account_deleted_refs()
1686 ret = ulist_add(qgroups, qg->qgroupid, ptr_to_u64(qg), in qgroup_account_deleted_refs()
1702 ret = ulist_add(tmp, qg->qgroupid, ptr_to_u64(qg), in qgroup_account_deleted_refs()
1721 qg = u64_to_ptr(unode->aux); in qgroup_account_deleted_refs()
1722 if (qg->old_refcnt < seq) in qgroup_account_deleted_refs()
1723 qg->old_refcnt = seq + 1; in qgroup_account_deleted_refs()
1725 qg->old_refcnt++; in qgroup_account_deleted_refs()
1726 if (qg->new_refcnt < seq) in qgroup_account_deleted_refs()
1727 qg->new_refcnt = seq + 1; in qgroup_account_deleted_refs()
1729 qg->new_refcnt++; in qgroup_account_deleted_refs()
1730 list_for_each_entry(glist, &qg->groups, next_group) { in qgroup_account_deleted_refs()
1753 struct btrfs_qgroup *qg; in qgroup_calc_new_refcnt() local
1769 qg = u64_to_ptr(unode->aux); in qgroup_calc_new_refcnt()
1771 if (qg->new_refcnt < seq) in qgroup_calc_new_refcnt()
1772 qg->new_refcnt = seq + 1; in qgroup_calc_new_refcnt()
1774 qg->new_refcnt++; in qgroup_calc_new_refcnt()
1776 if (qg->old_refcnt < seq) in qgroup_calc_new_refcnt()
1777 qg->old_refcnt = seq + 1; in qgroup_calc_new_refcnt()
1779 qg->old_refcnt++; in qgroup_calc_new_refcnt()
1781 list_for_each_entry(glist, &qg->groups, next_group) { in qgroup_calc_new_refcnt()
1805 struct btrfs_qgroup *qg; in qgroup_adjust_counters() local
1812 qg = u64_to_ptr(unode->aux); in qgroup_adjust_counters()
1817 if (qg->old_refcnt <= seq && qg->new_refcnt > seq) { in qgroup_adjust_counters()
1818 qg->rfer += num_bytes; in qgroup_adjust_counters()
1819 qg->rfer_cmpr += num_bytes; in qgroup_adjust_counters()
1827 if (qg->old_refcnt > seq && qg->new_refcnt <= seq) { in qgroup_adjust_counters()
1828 qg->rfer -= num_bytes; in qgroup_adjust_counters()
1829 qg->rfer_cmpr -= num_bytes; in qgroup_adjust_counters()
1833 if (qg->old_refcnt < seq) in qgroup_adjust_counters()
1836 cur_old_count = qg->old_refcnt - seq; in qgroup_adjust_counters()
1837 if (qg->new_refcnt < seq) in qgroup_adjust_counters()
1840 cur_new_count = qg->new_refcnt - seq; in qgroup_adjust_counters()
1850 qg->excl -= num_bytes; in qgroup_adjust_counters()
1851 qg->excl_cmpr -= num_bytes; in qgroup_adjust_counters()
1861 qg->excl += num_bytes; in qgroup_adjust_counters()
1862 qg->excl_cmpr += num_bytes; in qgroup_adjust_counters()
1867 qgroup_dirty(fs_info, qg); in qgroup_adjust_counters()
2072 struct btrfs_qgroup *qg; in qgroup_subtree_accounting() local
2112 qg = find_qgroup_rb(fs_info, root_obj); in qgroup_subtree_accounting()
2113 if (!qg) in qgroup_subtree_accounting()
2116 qg->excl += oper->num_bytes; in qgroup_subtree_accounting()
2117 qg->excl_cmpr += oper->num_bytes; in qgroup_subtree_accounting()
2118 qgroup_dirty(fs_info, qg); in qgroup_subtree_accounting()
2125 list_for_each_entry(glist, &qg->groups, next_group) { in qgroup_subtree_accounting()
2136 qg = u64_to_ptr(unode->aux); in qgroup_subtree_accounting()
2137 qg->excl += oper->num_bytes; in qgroup_subtree_accounting()
2138 qg->excl_cmpr += oper->num_bytes; in qgroup_subtree_accounting()
2139 qgroup_dirty(fs_info, qg); in qgroup_subtree_accounting()
2142 list_for_each_entry(glist, &qg->groups, next_group) { in qgroup_subtree_accounting()
2523 struct btrfs_qgroup *qg; in btrfs_qgroup_reserve() local
2526 qg = u64_to_ptr(unode->aux); in btrfs_qgroup_reserve()
2528 if ((qg->lim_flags & BTRFS_QGROUP_LIMIT_MAX_RFER) && in btrfs_qgroup_reserve()
2529 qg->reserved + (s64)qg->rfer + num_bytes > in btrfs_qgroup_reserve()
2530 qg->max_rfer) { in btrfs_qgroup_reserve()
2535 if ((qg->lim_flags & BTRFS_QGROUP_LIMIT_MAX_EXCL) && in btrfs_qgroup_reserve()
2536 qg->reserved + (s64)qg->excl + num_bytes > in btrfs_qgroup_reserve()
2537 qg->max_excl) { in btrfs_qgroup_reserve()
2542 list_for_each_entry(glist, &qg->groups, next_group) { in btrfs_qgroup_reserve()
2556 struct btrfs_qgroup *qg; in btrfs_qgroup_reserve() local
2558 qg = u64_to_ptr(unode->aux); in btrfs_qgroup_reserve()
2560 qg->reserved += num_bytes; in btrfs_qgroup_reserve()
2601 struct btrfs_qgroup *qg; in btrfs_qgroup_free() local
2604 qg = u64_to_ptr(unode->aux); in btrfs_qgroup_free()
2606 qg->reserved -= num_bytes; in btrfs_qgroup_free()
2608 list_for_each_entry(glist, &qg->groups, next_group) { in btrfs_qgroup_free()