Lines Matching refs:prealloc
196 * Must be called with qgroup_lock held and @prealloc preallocated.
198 * The control on the lifespan of @prealloc would be transferred to this
199 * function, thus caller should no longer touch @prealloc.
202 struct btrfs_qgroup *prealloc,
207 /* Caller must have pre-allocated @prealloc. */
208 ASSERT(prealloc);
210 prealloc->qgroupid = qgroupid;
211 node = rb_find_add(&prealloc->node, &fs_info->qgroup_tree, btrfs_qgroup_qgroupid_cmp);
213 kfree(prealloc);
217 INIT_LIST_HEAD(&prealloc->groups);
218 INIT_LIST_HEAD(&prealloc->members);
219 INIT_LIST_HEAD(&prealloc->dirty);
220 INIT_LIST_HEAD(&prealloc->iterator);
221 INIT_LIST_HEAD(&prealloc->nested_iterator);
223 return prealloc;
264 * Must be called with qgroup_lock held, the ownership of @prealloc is
271 static int __add_relation_rb(struct btrfs_qgroup_list *prealloc,
276 kfree(prealloc);
280 prealloc->group = parent;
281 prealloc->member = member;
282 list_add_tail(&prealloc->next_group, &member->groups);
283 list_add_tail(&prealloc->next_member, &parent->members);
298 struct btrfs_qgroup_list *prealloc,
307 return __add_relation_rb(prealloc, member, parent);
495 struct btrfs_qgroup *prealloc;
498 prealloc = kzalloc(sizeof(*prealloc), GFP_KERNEL);
499 if (!prealloc) {
503 qgroup = add_qgroup_rb(fs_info, prealloc, found_key.offset);
1010 struct btrfs_qgroup *prealloc = NULL;
1141 /* We should not have a stray @prealloc pointer. */
1142 ASSERT(prealloc == NULL);
1143 prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
1144 if (unlikely(!prealloc)) {
1157 qgroup = add_qgroup_rb(fs_info, prealloc, found_key.offset);
1158 prealloc = NULL;
1196 ASSERT(prealloc == NULL);
1197 prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
1198 if (!prealloc) {
1202 qgroup = add_qgroup_rb(fs_info, prealloc, BTRFS_FS_TREE_OBJECTID);
1203 prealloc = NULL;
1278 kfree(prealloc);
1539 * Add relation between @src and @dst qgroup. The @prealloc is allocated by the
1543 struct btrfs_qgroup_list *prealloc)
1551 ASSERT(prealloc);
1555 kfree(prealloc);
1590 ret = __add_relation_rb(prealloc, member, parent);
1591 prealloc = NULL;
1600 kfree(prealloc);
1678 struct btrfs_qgroup *prealloc = NULL;
1693 prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
1694 if (!prealloc) {
1704 qgroup = add_qgroup_rb(fs_info, prealloc, qgroupid);
1706 prealloc = NULL;
1711 kfree(prealloc);
1841 "to be deleted qgroup %u/%llu has non-zero numbers, data %llu meta prealloc %llu meta pertrans %llu",
3336 struct btrfs_qgroup *prealloc;
3346 prealloc = kzalloc(sizeof(*prealloc), GFP_NOFS);
3347 if (!prealloc)
3447 dstgroup = add_qgroup_rb(fs_info, prealloc, objectid);
3448 prealloc = NULL;
3577 kfree(prealloc);