qgroup             44 fs/btrfs/qgroup.c static u64 qgroup_rsv_total(const struct btrfs_qgroup *qgroup)
qgroup             50 fs/btrfs/qgroup.c 		ret += qgroup->rsv.values[i];
qgroup             69 fs/btrfs/qgroup.c 			   struct btrfs_qgroup *qgroup, u64 num_bytes,
qgroup             72 fs/btrfs/qgroup.c 	trace_qgroup_update_reserve(fs_info, qgroup, num_bytes, type);
qgroup             73 fs/btrfs/qgroup.c 	qgroup->rsv.values[type] += num_bytes;
qgroup             77 fs/btrfs/qgroup.c 			       struct btrfs_qgroup *qgroup, u64 num_bytes,
qgroup             80 fs/btrfs/qgroup.c 	trace_qgroup_update_reserve(fs_info, qgroup, -(s64)num_bytes, type);
qgroup             81 fs/btrfs/qgroup.c 	if (qgroup->rsv.values[type] >= num_bytes) {
qgroup             82 fs/btrfs/qgroup.c 		qgroup->rsv.values[type] -= num_bytes;
qgroup             88 fs/btrfs/qgroup.c 		qgroup->qgroupid, qgroup_rsv_type_str(type),
qgroup             89 fs/btrfs/qgroup.c 		qgroup->rsv.values[type], num_bytes);
qgroup             91 fs/btrfs/qgroup.c 	qgroup->rsv.values[type] = 0;
qgroup            174 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup            177 fs/btrfs/qgroup.c 		qgroup = rb_entry(n, struct btrfs_qgroup, node);
qgroup            178 fs/btrfs/qgroup.c 		if (qgroup->qgroupid < qgroupid)
qgroup            180 fs/btrfs/qgroup.c 		else if (qgroup->qgroupid > qgroupid)
qgroup            183 fs/btrfs/qgroup.c 			return qgroup;
qgroup            194 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup            198 fs/btrfs/qgroup.c 		qgroup = rb_entry(parent, struct btrfs_qgroup, node);
qgroup            200 fs/btrfs/qgroup.c 		if (qgroup->qgroupid < qgroupid)
qgroup            202 fs/btrfs/qgroup.c 		else if (qgroup->qgroupid > qgroupid)
qgroup            205 fs/btrfs/qgroup.c 			return qgroup;
qgroup            208 fs/btrfs/qgroup.c 	qgroup = kzalloc(sizeof(*qgroup), GFP_ATOMIC);
qgroup            209 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup            212 fs/btrfs/qgroup.c 	qgroup->qgroupid = qgroupid;
qgroup            213 fs/btrfs/qgroup.c 	INIT_LIST_HEAD(&qgroup->groups);
qgroup            214 fs/btrfs/qgroup.c 	INIT_LIST_HEAD(&qgroup->members);
qgroup            215 fs/btrfs/qgroup.c 	INIT_LIST_HEAD(&qgroup->dirty);
qgroup            217 fs/btrfs/qgroup.c 	rb_link_node(&qgroup->node, parent, p);
qgroup            218 fs/btrfs/qgroup.c 	rb_insert_color(&qgroup->node, &fs_info->qgroup_tree);
qgroup            220 fs/btrfs/qgroup.c 	return qgroup;
qgroup            223 fs/btrfs/qgroup.c static void __del_qgroup_rb(struct btrfs_qgroup *qgroup)
qgroup            227 fs/btrfs/qgroup.c 	list_del(&qgroup->dirty);
qgroup            228 fs/btrfs/qgroup.c 	while (!list_empty(&qgroup->groups)) {
qgroup            229 fs/btrfs/qgroup.c 		list = list_first_entry(&qgroup->groups,
qgroup            236 fs/btrfs/qgroup.c 	while (!list_empty(&qgroup->members)) {
qgroup            237 fs/btrfs/qgroup.c 		list = list_first_entry(&qgroup->members,
qgroup            243 fs/btrfs/qgroup.c 	kfree(qgroup);
qgroup            249 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup = find_qgroup_rb(fs_info, qgroupid);
qgroup            251 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup            254 fs/btrfs/qgroup.c 	rb_erase(&qgroup->node, &fs_info->qgroup_tree);
qgroup            255 fs/btrfs/qgroup.c 	__del_qgroup_rb(qgroup);
qgroup            312 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup            314 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, qgroupid);
qgroup            315 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup            317 fs/btrfs/qgroup.c 	if (qgroup->rfer != rfer || qgroup->excl != excl)
qgroup            368 fs/btrfs/qgroup.c 		struct btrfs_qgroup *qgroup;
qgroup            402 fs/btrfs/qgroup.c 		qgroup = find_qgroup_rb(fs_info, found_key.offset);
qgroup            403 fs/btrfs/qgroup.c 		if ((qgroup && found_key.type == BTRFS_QGROUP_INFO_KEY) ||
qgroup            404 fs/btrfs/qgroup.c 		    (!qgroup && found_key.type == BTRFS_QGROUP_LIMIT_KEY)) {
qgroup            408 fs/btrfs/qgroup.c 		if (!qgroup) {
qgroup            409 fs/btrfs/qgroup.c 			qgroup = add_qgroup_rb(fs_info, found_key.offset);
qgroup            410 fs/btrfs/qgroup.c 			if (IS_ERR(qgroup)) {
qgroup            411 fs/btrfs/qgroup.c 				ret = PTR_ERR(qgroup);
qgroup            421 fs/btrfs/qgroup.c 			qgroup->rfer = btrfs_qgroup_info_rfer(l, ptr);
qgroup            422 fs/btrfs/qgroup.c 			qgroup->rfer_cmpr = btrfs_qgroup_info_rfer_cmpr(l, ptr);
qgroup            423 fs/btrfs/qgroup.c 			qgroup->excl = btrfs_qgroup_info_excl(l, ptr);
qgroup            424 fs/btrfs/qgroup.c 			qgroup->excl_cmpr = btrfs_qgroup_info_excl_cmpr(l, ptr);
qgroup            433 fs/btrfs/qgroup.c 			qgroup->lim_flags = btrfs_qgroup_limit_flags(l, ptr);
qgroup            434 fs/btrfs/qgroup.c 			qgroup->max_rfer = btrfs_qgroup_limit_max_rfer(l, ptr);
qgroup            435 fs/btrfs/qgroup.c 			qgroup->max_excl = btrfs_qgroup_limit_max_excl(l, ptr);
qgroup            436 fs/btrfs/qgroup.c 			qgroup->rsv_rfer = btrfs_qgroup_limit_rsv_rfer(l, ptr);
qgroup            437 fs/btrfs/qgroup.c 			qgroup->rsv_excl = btrfs_qgroup_limit_rsv_excl(l, ptr);
qgroup            517 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup            520 fs/btrfs/qgroup.c 		qgroup = rb_entry(n, struct btrfs_qgroup, node);
qgroup            522 fs/btrfs/qgroup.c 		__del_qgroup_rb(qgroup);
qgroup            703 fs/btrfs/qgroup.c 				    struct btrfs_qgroup *qgroup)
qgroup            715 fs/btrfs/qgroup.c 	key.offset = qgroup->qgroupid;
qgroup            731 fs/btrfs/qgroup.c 	btrfs_set_qgroup_limit_flags(l, qgroup_limit, qgroup->lim_flags);
qgroup            732 fs/btrfs/qgroup.c 	btrfs_set_qgroup_limit_max_rfer(l, qgroup_limit, qgroup->max_rfer);
qgroup            733 fs/btrfs/qgroup.c 	btrfs_set_qgroup_limit_max_excl(l, qgroup_limit, qgroup->max_excl);
qgroup            734 fs/btrfs/qgroup.c 	btrfs_set_qgroup_limit_rsv_rfer(l, qgroup_limit, qgroup->rsv_rfer);
qgroup            735 fs/btrfs/qgroup.c 	btrfs_set_qgroup_limit_rsv_excl(l, qgroup_limit, qgroup->rsv_excl);
qgroup            745 fs/btrfs/qgroup.c 				   struct btrfs_qgroup *qgroup)
qgroup            761 fs/btrfs/qgroup.c 	key.offset = qgroup->qgroupid;
qgroup            778 fs/btrfs/qgroup.c 	btrfs_set_qgroup_info_rfer(l, qgroup_info, qgroup->rfer);
qgroup            779 fs/btrfs/qgroup.c 	btrfs_set_qgroup_info_rfer_cmpr(l, qgroup_info, qgroup->rfer_cmpr);
qgroup            780 fs/btrfs/qgroup.c 	btrfs_set_qgroup_info_excl(l, qgroup_info, qgroup->excl);
qgroup            781 fs/btrfs/qgroup.c 	btrfs_set_qgroup_info_excl_cmpr(l, qgroup_info, qgroup->excl_cmpr);
qgroup            888 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup = NULL;
qgroup            984 fs/btrfs/qgroup.c 			qgroup = add_qgroup_rb(fs_info, found_key.offset);
qgroup            985 fs/btrfs/qgroup.c 			if (IS_ERR(qgroup)) {
qgroup            986 fs/btrfs/qgroup.c 				ret = PTR_ERR(qgroup);
qgroup           1008 fs/btrfs/qgroup.c 	qgroup = add_qgroup_rb(fs_info, BTRFS_FS_TREE_OBJECTID);
qgroup           1009 fs/btrfs/qgroup.c 	if (IS_ERR(qgroup)) {
qgroup           1010 fs/btrfs/qgroup.c 		ret = PTR_ERR(qgroup);
qgroup           1120 fs/btrfs/qgroup.c 			 struct btrfs_qgroup *qgroup)
qgroup           1122 fs/btrfs/qgroup.c 	if (list_empty(&qgroup->dirty))
qgroup           1123 fs/btrfs/qgroup.c 		list_add(&qgroup->dirty, &fs_info->dirty_qgroups);
qgroup           1144 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           1151 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, ref_root);
qgroup           1152 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup           1155 fs/btrfs/qgroup.c 	qgroup->rfer += sign * num_bytes;
qgroup           1156 fs/btrfs/qgroup.c 	qgroup->rfer_cmpr += sign * num_bytes;
qgroup           1158 fs/btrfs/qgroup.c 	WARN_ON(sign < 0 && qgroup->excl < num_bytes);
qgroup           1159 fs/btrfs/qgroup.c 	qgroup->excl += sign * num_bytes;
qgroup           1160 fs/btrfs/qgroup.c 	qgroup->excl_cmpr += sign * num_bytes;
qgroup           1163 fs/btrfs/qgroup.c 		qgroup_rsv_add_by_qgroup(fs_info, qgroup, src);
qgroup           1165 fs/btrfs/qgroup.c 		qgroup_rsv_release_by_qgroup(fs_info, qgroup, src);
qgroup           1167 fs/btrfs/qgroup.c 	qgroup_dirty(fs_info, qgroup);
qgroup           1170 fs/btrfs/qgroup.c 	list_for_each_entry(glist, &qgroup->groups, next_group) {
qgroup           1180 fs/btrfs/qgroup.c 		qgroup = unode_aux_to_qgroup(unode);
qgroup           1181 fs/btrfs/qgroup.c 		qgroup->rfer += sign * num_bytes;
qgroup           1182 fs/btrfs/qgroup.c 		qgroup->rfer_cmpr += sign * num_bytes;
qgroup           1183 fs/btrfs/qgroup.c 		WARN_ON(sign < 0 && qgroup->excl < num_bytes);
qgroup           1184 fs/btrfs/qgroup.c 		qgroup->excl += sign * num_bytes;
qgroup           1186 fs/btrfs/qgroup.c 			qgroup_rsv_add_by_qgroup(fs_info, qgroup, src);
qgroup           1188 fs/btrfs/qgroup.c 			qgroup_rsv_release_by_qgroup(fs_info, qgroup, src);
qgroup           1189 fs/btrfs/qgroup.c 		qgroup->excl_cmpr += sign * num_bytes;
qgroup           1190 fs/btrfs/qgroup.c 		qgroup_dirty(fs_info, qgroup);
qgroup           1193 fs/btrfs/qgroup.c 		list_for_each_entry(glist, &qgroup->groups, next_group) {
qgroup           1221 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           1225 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, src);
qgroup           1226 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup           1228 fs/btrfs/qgroup.c 	if (qgroup->excl == qgroup->rfer) {
qgroup           1231 fs/btrfs/qgroup.c 					       qgroup, sign);
qgroup           1387 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           1396 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, qgroupid);
qgroup           1397 fs/btrfs/qgroup.c 	if (qgroup) {
qgroup           1407 fs/btrfs/qgroup.c 	qgroup = add_qgroup_rb(fs_info, qgroupid);
qgroup           1410 fs/btrfs/qgroup.c 	if (IS_ERR(qgroup))
qgroup           1411 fs/btrfs/qgroup.c 		ret = PTR_ERR(qgroup);
qgroup           1421 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           1432 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, qgroupid);
qgroup           1433 fs/btrfs/qgroup.c 	if (!qgroup) {
qgroup           1439 fs/btrfs/qgroup.c 	if (!list_empty(&qgroup->members)) {
qgroup           1448 fs/btrfs/qgroup.c 	while (!list_empty(&qgroup->groups)) {
qgroup           1449 fs/btrfs/qgroup.c 		list = list_first_entry(&qgroup->groups,
qgroup           1470 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           1485 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, qgroupid);
qgroup           1486 fs/btrfs/qgroup.c 	if (!qgroup) {
qgroup           1494 fs/btrfs/qgroup.c 			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_MAX_RFER;
qgroup           1496 fs/btrfs/qgroup.c 			qgroup->max_rfer = 0;
qgroup           1498 fs/btrfs/qgroup.c 			qgroup->max_rfer = limit->max_rfer;
qgroup           1503 fs/btrfs/qgroup.c 			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_MAX_EXCL;
qgroup           1505 fs/btrfs/qgroup.c 			qgroup->max_excl = 0;
qgroup           1507 fs/btrfs/qgroup.c 			qgroup->max_excl = limit->max_excl;
qgroup           1512 fs/btrfs/qgroup.c 			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_RFER;
qgroup           1514 fs/btrfs/qgroup.c 			qgroup->rsv_rfer = 0;
qgroup           1516 fs/btrfs/qgroup.c 			qgroup->rsv_rfer = limit->rsv_rfer;
qgroup           1521 fs/btrfs/qgroup.c 			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_EXCL;
qgroup           1523 fs/btrfs/qgroup.c 			qgroup->rsv_excl = 0;
qgroup           1525 fs/btrfs/qgroup.c 			qgroup->rsv_excl = limit->rsv_excl;
qgroup           1528 fs/btrfs/qgroup.c 	qgroup->lim_flags |= limit->flags;
qgroup           1532 fs/btrfs/qgroup.c 	ret = update_qgroup_limit_item(trans, qgroup);
qgroup           2594 fs/btrfs/qgroup.c 		struct btrfs_qgroup *qgroup;
qgroup           2595 fs/btrfs/qgroup.c 		qgroup = list_first_entry(&fs_info->dirty_qgroups,
qgroup           2597 fs/btrfs/qgroup.c 		list_del_init(&qgroup->dirty);
qgroup           2599 fs/btrfs/qgroup.c 		ret = update_qgroup_info_item(trans, qgroup);
qgroup           2603 fs/btrfs/qgroup.c 		ret = update_qgroup_limit_item(trans, qgroup);
qgroup           2884 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           2906 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, ref_root);
qgroup           2907 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup           2915 fs/btrfs/qgroup.c 	ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
qgroup           2916 fs/btrfs/qgroup.c 			qgroup_to_aux(qgroup), GFP_ATOMIC);
qgroup           2971 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           2992 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, ref_root);
qgroup           2993 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup           3001 fs/btrfs/qgroup.c 		num_bytes = qgroup->rsv.values[type];
qgroup           3004 fs/btrfs/qgroup.c 	ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
qgroup           3005 fs/btrfs/qgroup.c 			qgroup_to_aux(qgroup), GFP_ATOMIC);
qgroup           3295 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           3300 fs/btrfs/qgroup.c 		qgroup = rb_entry(n, struct btrfs_qgroup, node);
qgroup           3301 fs/btrfs/qgroup.c 		qgroup->rfer = 0;
qgroup           3302 fs/btrfs/qgroup.c 		qgroup->rfer_cmpr = 0;
qgroup           3303 fs/btrfs/qgroup.c 		qgroup->excl = 0;
qgroup           3304 fs/btrfs/qgroup.c 		qgroup->excl_cmpr = 0;
qgroup           3305 fs/btrfs/qgroup.c 		qgroup_dirty(fs_info, qgroup);
qgroup           3698 fs/btrfs/qgroup.c 	struct btrfs_qgroup *qgroup;
qgroup           3709 fs/btrfs/qgroup.c 	qgroup = find_qgroup_rb(fs_info, ref_root);
qgroup           3710 fs/btrfs/qgroup.c 	if (!qgroup)
qgroup           3713 fs/btrfs/qgroup.c 	ret = ulist_add(fs_info->qgroup_ulist, qgroup->qgroupid,
qgroup           3714 fs/btrfs/qgroup.c 		       qgroup_to_aux(qgroup), GFP_ATOMIC);
qgroup           1647 include/trace/events/btrfs.h 		 struct btrfs_qgroup *qgroup,
qgroup           1650 include/trace/events/btrfs.h 	TP_ARGS(fs_info, qgroup, cur_old_count, cur_new_count),
qgroup           1661 include/trace/events/btrfs.h 		__entry->qgid		= qgroup->qgroupid;
qgroup           1662 include/trace/events/btrfs.h 		__entry->old_rfer	= qgroup->rfer;
qgroup           1663 include/trace/events/btrfs.h 		__entry->old_excl	= qgroup->excl;
qgroup           1675 include/trace/events/btrfs.h 	TP_PROTO(struct btrfs_fs_info *fs_info, struct btrfs_qgroup *qgroup,
qgroup           1678 include/trace/events/btrfs.h 	TP_ARGS(fs_info, qgroup, diff, type),
qgroup           1688 include/trace/events/btrfs.h 		__entry->qgid		= qgroup->qgroupid;
qgroup           1689 include/trace/events/btrfs.h 		__entry->cur_reserved	= qgroup->rsv.values[type];