Lines Matching refs:lnum

26 			 struct ubifs_znode *znode, int lnum, int offs, int len)  in make_idx_node()  argument
41 br->lnum = cpu_to_le32(zbr->lnum); in make_idx_node()
45 if (!zbr->lnum || !zbr->len) { in make_idx_node()
57 znode->lnum = lnum; in make_idx_node()
69 zbr->lnum = lnum; in make_idx_node()
74 c->zroot.lnum = lnum; in make_idx_node()
106 static int fill_gap(struct ubifs_info *c, int lnum, int gap_start, int gap_end, in fill_gap() argument
129 lnum, gap_pos, len); in fill_gap()
149 lnum, gap_start, gap_end, gap_end - gap_start, written, pad_len); in fill_gap()
163 static int find_old_idx(struct ubifs_info *c, int lnum, int offs) in find_old_idx() argument
171 if (lnum < o->lnum) in find_old_idx()
173 else if (lnum > o->lnum) in find_old_idx()
199 int level, int lnum, int offs) in is_idx_node_in_use() argument
203 ret = is_idx_node_in_tnc(c, key, level, lnum, offs); in is_idx_node_in_use()
207 if (find_old_idx(c, lnum, offs)) in is_idx_node_in_use()
228 int lnum, dirt = 0, gap_start, gap_end, err, written, tot_written; in layout_leb_in_gaps() local
232 lnum = ubifs_find_dirty_idx_leb(c); in layout_leb_in_gaps()
233 if (lnum < 0) in layout_leb_in_gaps()
238 return lnum; /* Error code */ in layout_leb_in_gaps()
239 c->gap_lebs[p] = lnum; in layout_leb_in_gaps()
240 dbg_gc("LEB %d", lnum); in layout_leb_in_gaps()
246 sleb = ubifs_scan(c, lnum, 0, c->ileb_buf, 0); in layout_leb_in_gaps()
260 in_use = is_idx_node_in_use(c, &snod->key, level, lnum, in layout_leb_in_gaps()
277 written = fill_gap(c, lnum, gap_start, gap_end, &dirt); in layout_leb_in_gaps()
290 written = fill_gap(c, lnum, gap_start, gap_end, &dirt); in layout_leb_in_gaps()
297 dbg_gc("LEB %d wrote %d index nodes", lnum, tot_written); in layout_leb_in_gaps()
298 err = ubifs_read_one_lp(c, lnum, &lp); in layout_leb_in_gaps()
306 err = ubifs_change_one_lp(c, lnum, in layout_leb_in_gaps()
314 err = ubifs_change_one_lp(c, lnum, c->leb_size - c->ileb_len, dirt, in layout_leb_in_gaps()
318 err = ubifs_leb_change(c, lnum, c->ileb_buf, c->ileb_len); in layout_leb_in_gaps()
321 dbg_gc("LEB %d wrote %d index nodes", lnum, tot_written); in layout_leb_in_gaps()
432 int lnum, offs, len, next_len, buf_len, buf_offs, used, avail; in layout_in_empty_space() local
439 lnum = c->ihead_lnum; in layout_in_empty_space()
450 lnum = -1; in layout_in_empty_space()
458 if (lnum == -1) { in layout_in_empty_space()
463 lnum = c->ilebs[c->ileb_nxt++]; in layout_in_empty_space()
471 znode->lnum = lnum; in layout_in_empty_space()
483 zbr->lnum = lnum; in layout_in_empty_space()
487 c->zroot.lnum = lnum; in layout_in_empty_space()
529 err = ubifs_update_one_lp(c, lnum, in layout_in_empty_space()
534 lnum = -1; in layout_in_empty_space()
542 err = ubifs_update_one_lp(c, lnum, c->leb_size - buf_offs, in layout_in_empty_space()
549 c->dbg->new_ihead_lnum = lnum; in layout_in_empty_space()
685 int i, leb_cnt, lnum; in alloc_idx_lebs() local
697 lnum = ubifs_find_free_leb_for_idx(c); in alloc_idx_lebs()
698 if (lnum < 0) in alloc_idx_lebs()
699 return lnum; in alloc_idx_lebs()
700 c->ilebs[c->ileb_cnt++] = lnum; in alloc_idx_lebs()
701 dbg_cmt("LEB %d", lnum); in alloc_idx_lebs()
719 int i, err = 0, lnum, er; in free_unused_idx_lebs() local
722 lnum = c->ilebs[i]; in free_unused_idx_lebs()
723 dbg_cmt("LEB %d", lnum); in free_unused_idx_lebs()
724 er = ubifs_change_one_lp(c, lnum, LPROPS_NC, LPROPS_NC, 0, in free_unused_idx_lebs()
828 int i, lnum, offs, len, next_len, buf_len, buf_offs, used; in write_index() local
839 lnum = c->ihead_lnum; in write_index()
850 err = ubifs_update_one_lp(c, lnum, LPROPS_NC, 0, 0, in write_index()
854 lnum = -1; in write_index()
874 br->lnum = cpu_to_le32(zbr->lnum); in write_index()
878 if (!zbr->lnum || !zbr->len) { in write_index()
908 if (lnum == -1) { in write_index()
909 lnum = c->ilebs[lnum_pos++]; in write_index()
916 if (lnum != znode->lnum || offs != znode->offs || in write_index()
992 err = ubifs_leb_write(c, lnum, c->cbuf, buf_offs, blen); in write_index()
998 err = ubifs_update_one_lp(c, lnum, LPROPS_NC, 0, in write_index()
1002 lnum = -1; in write_index()
1014 if (lnum != c->dbg->new_ihead_lnum || in write_index()
1020 c->ihead_lnum = lnum; in write_index()