- (args.buf + off);
-
- a1 = btrfs_stack_qgroup_limit_flags(limit);
- a2 = btrfs_stack_qgroup_limit_max_referenced
- (limit);
- a3 = btrfs_stack_qgroup_limit_max_exclusive
- (limit);
- a4 = btrfs_stack_qgroup_limit_rsv_referenced
- (limit);
- a5 = btrfs_stack_qgroup_limit_rsv_exclusive
- (limit);
- add_qgroup(qgroup_lookup, sh->offset, 0, 0,
- 0, 0, 0, a1, a2, a3, a4, a5, 0, 0);
- } else if (sh->type == BTRFS_QGROUP_RELATION_KEY) {
- if (sh->offset < sh->objectid)
- goto skip;
- bq = qgroup_tree_search(qgroup_lookup,
- sh->offset);
- if (!bq)
- goto skip;
- bq1 = qgroup_tree_search(qgroup_lookup,
- sh->objectid);
- if (!bq1)
- goto skip;
- add_qgroup(qgroup_lookup, sh->offset, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, bq, bq1);
- } else
- goto done;
-skip:
- off += sh->len;
+ (args.buf + off);
+
+ ret = update_qgroup_limit(qgroup_lookup,
+ qgroupid, limit);
+ break;
+ case BTRFS_QGROUP_RELATION_KEY:
+ qgroupid = btrfs_search_header_offset(sh);
+ qgroupid1 = btrfs_search_header_objectid(sh);
+
+ if (qgroupid < qgroupid1)
+ break;
+
+ ret = update_qgroup_relation(qgroup_lookup,
+ qgroupid, qgroupid1);
+ break;
+ default:
+ return ret;
+ }
+
+ if (ret)
+ return ret;
+
+ off += btrfs_search_header_len(sh);