Lines Matching refs:ref
51 struct ref_entry ref; member
162 struct ref_entry *ref) in insert_ref_entry() argument
172 cmp = comp_refs(entry, ref); in insert_ref_entry()
181 rb_link_node(&ref->node, parent_node, p); in insert_ref_entry()
182 rb_insert_color(&ref->node, root); in insert_ref_entry()
235 struct ref_entry *ref; in free_block_entry() local
246 ref = rb_entry(n, struct ref_entry, node); in free_block_entry()
247 rb_erase(&ref->node, &be->refs); in free_block_entry()
248 kfree(ref); in free_block_entry()
314 struct ref_entry *ref = NULL, *exist; in add_tree_block() local
316 ref = kmalloc(sizeof(struct ref_entry), GFP_NOFS); in add_tree_block()
317 if (!ref) in add_tree_block()
321 ref->root_objectid = 0; in add_tree_block()
323 ref->root_objectid = ref_root; in add_tree_block()
324 ref->parent = parent; in add_tree_block()
325 ref->owner = level; in add_tree_block()
326 ref->offset = 0; in add_tree_block()
327 ref->num_refs = 1; in add_tree_block()
331 kfree(ref); in add_tree_block()
344 exist = insert_ref_entry(&be->refs, ref); in add_tree_block()
347 kfree(ref); in add_tree_block()
359 struct ref_entry *ref; in add_shared_data_ref() local
361 ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); in add_shared_data_ref()
362 if (!ref) in add_shared_data_ref()
366 kfree(ref); in add_shared_data_ref()
371 ref->parent = parent; in add_shared_data_ref()
372 ref->num_refs = num_refs; in add_shared_data_ref()
373 if (insert_ref_entry(&be->refs, ref)) { in add_shared_data_ref()
376 kfree(ref); in add_shared_data_ref()
389 struct ref_entry *ref; in add_extent_data_ref() local
396 ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); in add_extent_data_ref()
397 if (!ref) in add_extent_data_ref()
401 kfree(ref); in add_extent_data_ref()
406 ref->parent = 0; in add_extent_data_ref()
407 ref->owner = owner; in add_extent_data_ref()
408 ref->root_objectid = ref_root; in add_extent_data_ref()
409 ref->offset = offset; in add_extent_data_ref()
410 ref->num_refs = num_refs; in add_extent_data_ref()
411 if (insert_ref_entry(&be->refs, ref)) { in add_extent_data_ref()
414 kfree(ref); in add_extent_data_ref()
611 ra->action, ra->root, ra->ref.root_objectid, ra->ref.parent, in dump_ref_action()
612 ra->ref.owner, ra->ref.offset, ra->ref.num_refs); in dump_ref_action()
623 struct ref_entry *ref; in dump_block_entry() local
634 ref = rb_entry(n, struct ref_entry, node); in dump_block_entry()
637 ref->root_objectid, ref->parent, ref->owner, in dump_block_entry()
638 ref->offset, ref->num_refs); in dump_block_entry()
662 struct ref_entry *ref = NULL, *exist; in btrfs_ref_tree_mod() local
690 ref = kzalloc(sizeof(struct ref_entry), GFP_NOFS); in btrfs_ref_tree_mod()
692 if (!ra || !ref) { in btrfs_ref_tree_mod()
693 kfree(ref); in btrfs_ref_tree_mod()
699 ref->parent = parent; in btrfs_ref_tree_mod()
700 ref->owner = owner; in btrfs_ref_tree_mod()
701 ref->root_objectid = ref_root; in btrfs_ref_tree_mod()
702 ref->offset = offset; in btrfs_ref_tree_mod()
703 ref->num_refs = (action == BTRFS_DROP_DELAYED_REF) ? -1 : 1; in btrfs_ref_tree_mod()
705 memcpy(&ra->ref, ref, sizeof(struct ref_entry)); in btrfs_ref_tree_mod()
712 ra->ref.owner = owner; in btrfs_ref_tree_mod()
713 ra->ref.offset = offset; in btrfs_ref_tree_mod()
714 ra->ref.root_objectid = ref_root; in btrfs_ref_tree_mod()
734 kfree(ref); in btrfs_ref_tree_mod()
748 kfree(ref); in btrfs_ref_tree_mod()
767 kfree(ref); in btrfs_ref_tree_mod()
789 kfree(ref); in btrfs_ref_tree_mod()
798 kfree(ref); in btrfs_ref_tree_mod()
812 exist = insert_ref_entry(&be->refs, ref); in btrfs_ref_tree_mod()
820 kfree(ref); in btrfs_ref_tree_mod()
836 kfree(ref); in btrfs_ref_tree_mod()
840 kfree(ref); in btrfs_ref_tree_mod()
847 kfree(ref); in btrfs_ref_tree_mod()