Lines Matching refs:offs

191 	int lnum, offs, len, alen, done_lsave, done_ltab, err;  in layout_cnodes()  local
201 offs = c->nhead_offs; in layout_cnodes()
205 if (!done_lsave && offs + c->lsave_sz <= c->leb_size) { in layout_cnodes()
208 c->lsave_offs = offs; in layout_cnodes()
209 offs += c->lsave_sz; in layout_cnodes()
213 if (offs + c->ltab_sz <= c->leb_size) { in layout_cnodes()
216 c->ltab_offs = offs; in layout_cnodes()
217 offs += c->ltab_sz; in layout_cnodes()
229 while (offs + len > c->leb_size) { in layout_cnodes()
230 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
231 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
232 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
236 offs = 0; in layout_cnodes()
243 c->lsave_offs = offs; in layout_cnodes()
244 offs += c->lsave_sz; in layout_cnodes()
251 c->ltab_offs = offs; in layout_cnodes()
252 offs += c->ltab_sz; in layout_cnodes()
260 cnode->parent->nbranch[cnode->iip].offs = offs; in layout_cnodes()
263 c->lpt_offs = offs; in layout_cnodes()
265 offs += len; in layout_cnodes()
272 if (offs + c->lsave_sz > c->leb_size) { in layout_cnodes()
273 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
274 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
275 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
279 offs = 0; in layout_cnodes()
285 c->lsave_offs = offs; in layout_cnodes()
286 offs += c->lsave_sz; in layout_cnodes()
292 if (offs + c->ltab_sz > c->leb_size) { in layout_cnodes()
293 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
294 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
295 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
299 offs = 0; in layout_cnodes()
304 c->ltab_offs = offs; in layout_cnodes()
305 offs += c->ltab_sz; in layout_cnodes()
309 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
310 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
311 dbg_chk_lpt_sz(c, 4, alen - offs); in layout_cnodes()
319 lnum, offs, len, done_ltab, done_lsave); in layout_cnodes()
370 int lnum, offs, len, from, err, wlen, alen, done_ltab, done_lsave; in write_cnodes() local
378 offs = c->nhead_offs; in write_cnodes()
379 from = offs; in write_cnodes()
381 if (offs == 0) { in write_cnodes()
389 if (!done_lsave && offs + c->lsave_sz <= c->leb_size) { in write_cnodes()
391 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
392 offs += c->lsave_sz; in write_cnodes()
396 if (offs + c->ltab_sz <= c->leb_size) { in write_cnodes()
398 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
399 offs += c->ltab_sz; in write_cnodes()
409 while (offs + len > c->leb_size) { in write_cnodes()
410 wlen = offs - from; in write_cnodes()
413 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
419 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
423 offs = from = 0; in write_cnodes()
432 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
433 offs += c->lsave_sz; in write_cnodes()
439 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
440 offs += c->ltab_sz; in write_cnodes()
447 ubifs_pack_nnode(c, buf + offs, in write_cnodes()
450 ubifs_pack_pnode(c, buf + offs, in write_cnodes()
462 offs += len; in write_cnodes()
469 if (offs + c->lsave_sz > c->leb_size) { in write_cnodes()
470 wlen = offs - from; in write_cnodes()
472 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
476 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
480 offs = from = 0; in write_cnodes()
488 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
489 offs += c->lsave_sz; in write_cnodes()
495 if (offs + c->ltab_sz > c->leb_size) { in write_cnodes()
496 wlen = offs - from; in write_cnodes()
498 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
502 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
506 offs = from = 0; in write_cnodes()
513 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
514 offs += c->ltab_sz; in write_cnodes()
519 wlen = offs - from; in write_cnodes()
521 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
527 err = dbg_chk_lpt_sz(c, 3, ALIGN(offs, c->min_io_size)); in write_cnodes()
532 c->nhead_offs = ALIGN(offs, c->min_io_size); in write_cnodes()
544 lnum, offs, len, done_ltab, done_lsave); in write_cnodes()
904 int offs) in make_nnode_dirty() argument
915 if (branch->lnum != lnum || branch->offs != offs) in make_nnode_dirty()
917 } else if (c->lpt_lnum != lnum || c->lpt_offs != offs) in make_nnode_dirty()
953 int offs) in make_pnode_dirty() argument
962 if (branch->lnum != lnum || branch->offs != offs) in make_pnode_dirty()
982 static int make_ltab_dirty(struct ubifs_info *c, int lnum, int offs) in make_ltab_dirty() argument
984 if (lnum != c->ltab_lnum || offs != c->ltab_offs) in make_ltab_dirty()
1007 static int make_lsave_dirty(struct ubifs_info *c, int lnum, int offs) in make_lsave_dirty() argument
1009 if (lnum != c->lsave_lnum || offs != c->lsave_offs) in make_lsave_dirty()
1035 int lnum, int offs) in make_node_dirty() argument
1039 return make_nnode_dirty(c, node_num, lnum, offs); in make_node_dirty()
1041 return make_pnode_dirty(c, node_num, lnum, offs); in make_node_dirty()
1043 return make_ltab_dirty(c, lnum, offs); in make_node_dirty()
1045 return make_lsave_dirty(c, lnum, offs); in make_node_dirty()
1078 int offs, pad_len; in get_pad_len() local
1082 offs = c->leb_size - len; in get_pad_len()
1083 pad_len = ALIGN(offs, c->min_io_size) - offs; in get_pad_len()
1150 int err, len = c->leb_size, node_type, node_num, node_len, offs; in lpt_gc_lnum() local
1173 offs = c->leb_size - len; in lpt_gc_lnum()
1176 err = make_node_dirty(c, node_type, node_num, lnum, offs); in lpt_gc_lnum()
1518 static int dbg_is_nnode_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_nnode_dirty() argument
1531 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_nnode_dirty()
1537 if (c->lpt_lnum != lnum || c->lpt_offs != offs) in dbg_is_nnode_dirty()
1553 static int dbg_is_pnode_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_pnode_dirty() argument
1567 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_pnode_dirty()
1582 static int dbg_is_ltab_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_ltab_dirty() argument
1584 if (lnum != c->ltab_lnum || offs != c->ltab_offs) in dbg_is_ltab_dirty()
1595 static int dbg_is_lsave_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_lsave_dirty() argument
1597 if (lnum != c->lsave_lnum || offs != c->lsave_offs) in dbg_is_lsave_dirty()
1610 int offs) in dbg_is_node_dirty() argument
1614 return dbg_is_nnode_dirty(c, lnum, offs); in dbg_is_node_dirty()
1616 return dbg_is_pnode_dirty(c, lnum, offs); in dbg_is_node_dirty()
1618 return dbg_is_ltab_dirty(c, lnum, offs); in dbg_is_node_dirty()
1620 return dbg_is_lsave_dirty(c, lnum, offs); in dbg_is_node_dirty()
1887 int err, len = c->leb_size, node_type, node_num, node_len, offs; in dump_lpt_leb() local
1902 offs = c->leb_size - len; in dump_lpt_leb()
1909 lnum, offs, pad_len); in dump_lpt_leb()
1916 lnum, offs, len); in dump_lpt_leb()
1927 lnum, offs, node_num); in dump_lpt_leb()
1929 pr_err("LEB %d:%d, pnode\n", lnum, offs); in dump_lpt_leb()
1940 lnum, offs, node_num); in dump_lpt_leb()
1943 lnum, offs); in dump_lpt_leb()
1952 nnode.nbranch[i].offs); in dump_lpt_leb()
1961 pr_err("LEB %d:%d, ltab\n", lnum, offs); in dump_lpt_leb()
1965 pr_err("LEB %d:%d, lsave len\n", lnum, offs); in dump_lpt_leb()