Lines Matching refs:idx_gc
524 struct ubifs_gced_idx_leb *idx_gc; in ubifs_garbage_collect_leb() local
540 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); in ubifs_garbage_collect_leb()
541 if (!idx_gc) { in ubifs_garbage_collect_leb()
546 idx_gc->lnum = lnum; in ubifs_garbage_collect_leb()
547 idx_gc->unmap = 0; in ubifs_garbage_collect_leb()
548 list_add(&idx_gc->list, &c->idx_gc); in ubifs_garbage_collect_leb()
682 if (i > SOFT_LEBS_LIMIT && !list_empty(&c->idx_gc)) { in ubifs_garbage_collect()
802 if (ret == -ENOSPC && !list_empty(&c->idx_gc)) { in ubifs_garbage_collect()
842 struct ubifs_gced_idx_leb *idx_gc; in ubifs_gc_start_commit() local
875 list_for_each_entry(idx_gc, &c->idx_gc, list) in ubifs_gc_start_commit()
876 idx_gc->unmap = 1; in ubifs_gc_start_commit()
887 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS); in ubifs_gc_start_commit()
888 if (!idx_gc) { in ubifs_gc_start_commit()
899 kfree(idx_gc); in ubifs_gc_start_commit()
904 idx_gc->lnum = lp->lnum; in ubifs_gc_start_commit()
905 idx_gc->unmap = 1; in ubifs_gc_start_commit()
906 list_add(&idx_gc->list, &c->idx_gc); in ubifs_gc_start_commit()
921 struct ubifs_gced_idx_leb *idx_gc, *tmp; in ubifs_gc_end_commit() local
927 list_for_each_entry_safe(idx_gc, tmp, &c->idx_gc, list) in ubifs_gc_end_commit()
928 if (idx_gc->unmap) { in ubifs_gc_end_commit()
929 dbg_gc("LEB %d", idx_gc->lnum); in ubifs_gc_end_commit()
930 err = ubifs_leb_unmap(c, idx_gc->lnum); in ubifs_gc_end_commit()
933 err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC, in ubifs_gc_end_commit()
937 list_del(&idx_gc->list); in ubifs_gc_end_commit()
938 kfree(idx_gc); in ubifs_gc_end_commit()
955 while (!list_empty(&c->idx_gc)) { in ubifs_destroy_idx_gc()
956 struct ubifs_gced_idx_leb *idx_gc; in ubifs_destroy_idx_gc() local
958 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, in ubifs_destroy_idx_gc()
961 list_del(&idx_gc->list); in ubifs_destroy_idx_gc()
962 kfree(idx_gc); in ubifs_destroy_idx_gc()
974 struct ubifs_gced_idx_leb *idx_gc; in ubifs_get_idx_gc_leb() local
977 if (list_empty(&c->idx_gc)) in ubifs_get_idx_gc_leb()
979 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, list); in ubifs_get_idx_gc_leb()
980 lnum = idx_gc->lnum; in ubifs_get_idx_gc_leb()
982 list_del(&idx_gc->list); in ubifs_get_idx_gc_leb()
983 kfree(idx_gc); in ubifs_get_idx_gc_leb()