Lines Matching defs:idx_gc
546 struct ubifs_gced_idx_leb *idx_gc;
562 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS);
563 if (!idx_gc) {
568 idx_gc->lnum = lnum;
569 idx_gc->unmap = 0;
570 list_add(&idx_gc->list, &c->idx_gc);
706 if (i > SOFT_LEBS_LIMIT && !list_empty(&c->idx_gc)) {
834 if (ret == -ENOSPC && !list_empty(&c->idx_gc)) {
875 struct ubifs_gced_idx_leb *idx_gc;
904 list_for_each_entry(idx_gc, &c->idx_gc, list)
905 idx_gc->unmap = 1;
916 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS);
917 if (!idx_gc) {
928 kfree(idx_gc);
933 idx_gc->lnum = lp->lnum;
934 idx_gc->unmap = 1;
935 list_add(&idx_gc->list, &c->idx_gc);
950 struct ubifs_gced_idx_leb *idx_gc, *tmp;
956 list_for_each_entry_safe(idx_gc, tmp, &c->idx_gc, list)
957 if (idx_gc->unmap) {
958 dbg_gc("LEB %d", idx_gc->lnum);
959 err = ubifs_leb_unmap(c, idx_gc->lnum);
962 err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC,
966 list_del(&idx_gc->list);
967 kfree(idx_gc);
975 * ubifs_destroy_idx_gc - destroy idx_gc list.
978 * This function destroys the @c->idx_gc list. It is called when unmounting
984 while (!list_empty(&c->idx_gc)) {
985 struct ubifs_gced_idx_leb *idx_gc;
987 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb,
990 list_del(&idx_gc->list);
991 kfree(idx_gc);
1003 struct ubifs_gced_idx_leb *idx_gc;
1006 if (list_empty(&c->idx_gc))
1008 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, list);
1009 lnum = idx_gc->lnum;
1011 list_del(&idx_gc->list);
1012 kfree(idx_gc);