Lines Matching refs:idx_gc
545 struct ubifs_gced_idx_leb *idx_gc; in ubifs_garbage_collect_leb() local
561 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); in ubifs_garbage_collect_leb()
562 if (!idx_gc) { in ubifs_garbage_collect_leb()
567 idx_gc->lnum = lnum; in ubifs_garbage_collect_leb()
568 idx_gc->unmap = 0; in ubifs_garbage_collect_leb()
569 list_add(&idx_gc->list, &c->idx_gc); in ubifs_garbage_collect_leb()
702 if (i > SOFT_LEBS_LIMIT && !list_empty(&c->idx_gc)) { in ubifs_garbage_collect()
822 if (ret == -ENOSPC && !list_empty(&c->idx_gc)) { in ubifs_garbage_collect()
862 struct ubifs_gced_idx_leb *idx_gc; in ubifs_gc_start_commit() local
891 list_for_each_entry(idx_gc, &c->idx_gc, list) in ubifs_gc_start_commit()
892 idx_gc->unmap = 1; in ubifs_gc_start_commit()
903 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); in ubifs_gc_start_commit()
904 if (!idx_gc) { in ubifs_gc_start_commit()
915 kfree(idx_gc); in ubifs_gc_start_commit()
920 idx_gc->lnum = lp->lnum; in ubifs_gc_start_commit()
921 idx_gc->unmap = 1; in ubifs_gc_start_commit()
922 list_add(&idx_gc->list, &c->idx_gc); in ubifs_gc_start_commit()
937 struct ubifs_gced_idx_leb *idx_gc, *tmp; in ubifs_gc_end_commit() local
943 list_for_each_entry_safe(idx_gc, tmp, &c->idx_gc, list) in ubifs_gc_end_commit()
944 if (idx_gc->unmap) { in ubifs_gc_end_commit()
945 dbg_gc("LEB %d", idx_gc->lnum); in ubifs_gc_end_commit()
946 err = ubifs_leb_unmap(c, idx_gc->lnum); in ubifs_gc_end_commit()
949 err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC, in ubifs_gc_end_commit()
953 list_del(&idx_gc->list); in ubifs_gc_end_commit()
954 kfree(idx_gc); in ubifs_gc_end_commit()
971 while (!list_empty(&c->idx_gc)) { in ubifs_destroy_idx_gc()
972 struct ubifs_gced_idx_leb *idx_gc; in ubifs_destroy_idx_gc() local
974 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, in ubifs_destroy_idx_gc()
977 list_del(&idx_gc->list); in ubifs_destroy_idx_gc()
978 kfree(idx_gc); in ubifs_destroy_idx_gc()
990 struct ubifs_gced_idx_leb *idx_gc; in ubifs_get_idx_gc_leb() local
993 if (list_empty(&c->idx_gc)) in ubifs_get_idx_gc_leb()
995 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, list); in ubifs_get_idx_gc_leb()
996 lnum = idx_gc->lnum; in ubifs_get_idx_gc_leb()
998 list_del(&idx_gc->list); in ubifs_get_idx_gc_leb()
999 kfree(idx_gc); in ubifs_get_idx_gc_leb()