Lines Matching refs:orphan
48 struct ubifs_orphan *orphan, *o; in orphan_add() local
51 orphan = kzalloc(sizeof(struct ubifs_orphan), GFP_NOFS); in orphan_add()
52 if (!orphan) in orphan_add()
54 orphan->inum = inum; in orphan_add()
55 orphan->new = 1; in orphan_add()
56 INIT_LIST_HEAD(&orphan->child_list); in orphan_add()
61 kfree(orphan); in orphan_add()
75 kfree(orphan); in orphan_add()
81 rb_link_node(&orphan->rb, parent, p); in orphan_add()
82 rb_insert_color(&orphan->rb, &c->orph_tree); in orphan_add()
83 list_add_tail(&orphan->list, &c->orph_list); in orphan_add()
84 list_add_tail(&orphan->new_list, &c->orph_new); in orphan_add()
87 list_add_tail(&orphan->child_list, in orphan_add()
93 return orphan; in orphan_add()
163 struct ubifs_orphan *orphan; in ubifs_add_orphan() local
165 orphan = orphan_add(c, inum, NULL); in ubifs_add_orphan()
166 if (IS_ERR(orphan)) in ubifs_add_orphan()
167 return PTR_ERR(orphan); in ubifs_add_orphan()
184 xattr_orphan = orphan_add(c, xattr_inum, orphan); in ubifs_add_orphan()
240 struct ubifs_orphan *orphan, **last; in ubifs_orphan_start_commit() local
244 list_for_each_entry(orphan, &c->orph_new, new_list) { in ubifs_orphan_start_commit()
245 ubifs_assert(c, orphan->new); in ubifs_orphan_start_commit()
246 ubifs_assert(c, !orphan->cmt); in ubifs_orphan_start_commit()
247 orphan->new = 0; in ubifs_orphan_start_commit()
248 orphan->cmt = 1; in ubifs_orphan_start_commit()
249 *last = orphan; in ubifs_orphan_start_commit()
250 last = &orphan->cnext; in ubifs_orphan_start_commit()
345 struct ubifs_orphan *orphan, *cnext; in write_orph_node() local
374 orphan = cnext; in write_orph_node()
375 ubifs_assert(c, orphan->cmt); in write_orph_node()
376 orph->inos[i] = cpu_to_le64(orphan->inum); in write_orph_node()
377 orphan->cmt = 0; in write_orph_node()
378 cnext = orphan->cnext; in write_orph_node()
379 orphan->cnext = NULL; in write_orph_node()
447 struct ubifs_orphan *orphan, **last; in consolidate() local
452 list_for_each_entry(orphan, &c->orph_list, list) { in consolidate()
453 if (orphan->new) in consolidate()
455 orphan->cmt = 1; in consolidate()
456 *last = orphan; in consolidate()
457 last = &orphan->cnext; in consolidate()
512 struct ubifs_orphan *orphan, *dnext; in erase_deleted() local
517 orphan = dnext; in erase_deleted()
518 dnext = orphan->dnext; in erase_deleted()
519 ubifs_assert(c, !orphan->new); in erase_deleted()
520 ubifs_assert(c, orphan->del); in erase_deleted()
521 rb_erase(&orphan->rb, &c->orph_tree); in erase_deleted()
522 list_del(&orphan->list); in erase_deleted()
524 dbg_gen("deleting orphan ino %lu", (unsigned long)orphan->inum); in erase_deleted()
525 kfree(orphan); in erase_deleted()
584 struct ubifs_orphan *orphan, *o; in insert_dead_orphan() local
587 orphan = kzalloc(sizeof(struct ubifs_orphan), GFP_KERNEL); in insert_dead_orphan()
588 if (!orphan) in insert_dead_orphan()
590 orphan->inum = inum; in insert_dead_orphan()
602 kfree(orphan); in insert_dead_orphan()
607 rb_link_node(&orphan->rb, parent, p); in insert_dead_orphan()
608 rb_insert_color(&orphan->rb, &c->orph_tree); in insert_dead_orphan()
609 list_add_tail(&orphan->list, &c->orph_list); in insert_dead_orphan()
610 orphan->del = 1; in insert_dead_orphan()
611 orphan->dnext = c->orph_dnext; in insert_dead_orphan()
612 c->orph_dnext = orphan; in insert_dead_orphan()
867 struct check_orphan *orphan, *o; in dbg_ins_check_orphan() local
870 orphan = kzalloc(sizeof(struct check_orphan), GFP_NOFS); in dbg_ins_check_orphan()
871 if (!orphan) in dbg_ins_check_orphan()
873 orphan->inum = inum; in dbg_ins_check_orphan()
884 kfree(orphan); in dbg_ins_check_orphan()
888 rb_link_node(&orphan->rb, parent, p); in dbg_ins_check_orphan()
889 rb_insert_color(&orphan->rb, root); in dbg_ins_check_orphan()