Lines Matching defs:idx_gc
447 struct ubifs_gced_idx_leb *idx_gc;
463 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS);
464 if (!idx_gc) {
469 idx_gc->lnum = lnum;
470 idx_gc->unmap = 0;
471 list_add(&idx_gc->list, &c->idx_gc);
604 if (i > SOFT_LEBS_LIMIT && !list_empty(&c->idx_gc)) {
757 if (ret == -ENOSPC && !list_empty(&c->idx_gc)) {
797 struct ubifs_gced_idx_leb *idx_gc;
830 list_for_each_entry(idx_gc, &c->idx_gc, list)
831 idx_gc->unmap = 1;
842 idx_gc = kmalloc(sizeof(struct ubifs_gced_idx_leb), GFP_NOFS);
843 if (!idx_gc) {
854 kfree(idx_gc);
859 idx_gc->lnum = lp->lnum;
860 idx_gc->unmap = 1;
861 list_add(&idx_gc->list, &c->idx_gc);
876 struct ubifs_gced_idx_leb *idx_gc, *tmp;
882 list_for_each_entry_safe(idx_gc, tmp, &c->idx_gc, list)
883 if (idx_gc->unmap) {
884 dbg_gc("LEB %d", idx_gc->lnum);
885 err = ubifs_leb_unmap(c, idx_gc->lnum);
888 err = ubifs_change_one_lp(c, idx_gc->lnum, LPROPS_NC,
892 list_del(&idx_gc->list);
893 kfree(idx_gc);
901 * ubifs_destroy_idx_gc - destroy idx_gc list.
904 * This function destroys the @c->idx_gc list. It is called when unmounting
910 while (!list_empty(&c->idx_gc)) {
911 struct ubifs_gced_idx_leb *idx_gc;
913 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb,
916 list_del(&idx_gc->list);
917 kfree(idx_gc);
929 struct ubifs_gced_idx_leb *idx_gc;
932 if (list_empty(&c->idx_gc))
934 idx_gc = list_entry(c->idx_gc.next, struct ubifs_gced_idx_leb, list);
935 lnum = idx_gc->lnum;
937 list_del(&idx_gc->list);
938 kfree(idx_gc);