Lines Matching defs: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);
497 struct btrfs_qgroup *prealloc;
500 prealloc = kzalloc_obj(*prealloc);
501 if (!prealloc) {
505 qgroup = add_qgroup_rb(fs_info, prealloc, found_key.offset);
1010 struct btrfs_qgroup *prealloc = NULL;
1148 /* We should not have a stray @prealloc pointer. */
1149 ASSERT(prealloc == NULL);
1150 prealloc = kzalloc_obj(*prealloc, GFP_NOFS);
1151 if (unlikely(!prealloc)) {
1164 qgroup = add_qgroup_rb(fs_info, prealloc, found_key.offset);
1165 prealloc = NULL;
1206 ASSERT(prealloc == NULL);
1207 prealloc = kzalloc_obj(*prealloc, GFP_NOFS);
1208 if (!prealloc) {
1213 qgroup = add_qgroup_rb(fs_info, prealloc, BTRFS_FS_TREE_OBJECTID);
1214 prealloc = NULL;
1313 kfree(prealloc);
1585 * Add relation between @src and @dst qgroup. The @prealloc is allocated by the
1589 struct btrfs_qgroup_list *prealloc)
1597 ASSERT(prealloc);
1601 kfree(prealloc);
1640 ret = __add_relation_rb(prealloc, member, parent);
1641 prealloc = NULL;
1650 kfree(prealloc);
1728 struct btrfs_qgroup *prealloc = NULL;
1743 prealloc = kzalloc_obj(*prealloc, GFP_NOFS);
1744 if (!prealloc) {
1754 qgroup = add_qgroup_rb(fs_info, prealloc, qgroupid);
1756 prealloc = NULL;
1761 kfree(prealloc);
1892 "to be deleted qgroup " BTRFS_QGROUP_FMT " has non-zero numbers, data %llu meta prealloc %llu meta pertrans %llu",
3399 struct btrfs_qgroup *prealloc;
3409 prealloc = kzalloc_obj(*prealloc, GFP_NOFS);
3410 if (!prealloc)
3509 dstgroup = add_qgroup_rb(fs_info, prealloc, objectid);
3510 prealloc = NULL;
3639 kfree(prealloc);