Lines Matching refs:offs

184 	int lnum, offs, len, alen, done_lsave, done_ltab, err;  in layout_cnodes()  local
194 offs = c->nhead_offs; in layout_cnodes()
198 if (!done_lsave && offs + c->lsave_sz <= c->leb_size) { in layout_cnodes()
201 c->lsave_offs = offs; in layout_cnodes()
202 offs += c->lsave_sz; in layout_cnodes()
206 if (offs + c->ltab_sz <= c->leb_size) { in layout_cnodes()
209 c->ltab_offs = offs; in layout_cnodes()
210 offs += c->ltab_sz; in layout_cnodes()
222 while (offs + len > c->leb_size) { in layout_cnodes()
223 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
224 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
225 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
229 offs = 0; in layout_cnodes()
236 c->lsave_offs = offs; in layout_cnodes()
237 offs += c->lsave_sz; in layout_cnodes()
244 c->ltab_offs = offs; in layout_cnodes()
245 offs += c->ltab_sz; in layout_cnodes()
253 cnode->parent->nbranch[cnode->iip].offs = offs; in layout_cnodes()
256 c->lpt_offs = offs; in layout_cnodes()
258 offs += len; in layout_cnodes()
265 if (offs + c->lsave_sz > c->leb_size) { in layout_cnodes()
266 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
267 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
268 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
272 offs = 0; in layout_cnodes()
278 c->lsave_offs = offs; in layout_cnodes()
279 offs += c->lsave_sz; in layout_cnodes()
285 if (offs + c->ltab_sz > c->leb_size) { in layout_cnodes()
286 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
287 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
288 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in layout_cnodes()
292 offs = 0; in layout_cnodes()
297 c->ltab_offs = offs; in layout_cnodes()
298 offs += c->ltab_sz; in layout_cnodes()
302 alen = ALIGN(offs, c->min_io_size); in layout_cnodes()
303 upd_ltab(c, lnum, c->leb_size - alen, alen - offs); in layout_cnodes()
304 dbg_chk_lpt_sz(c, 4, alen - offs); in layout_cnodes()
312 lnum, offs, len, done_ltab, done_lsave); in layout_cnodes()
362 int lnum, offs, len, from, err, wlen, alen, done_ltab, done_lsave; in write_cnodes() local
370 offs = c->nhead_offs; in write_cnodes()
371 from = offs; in write_cnodes()
373 if (offs == 0) { in write_cnodes()
381 if (!done_lsave && offs + c->lsave_sz <= c->leb_size) { in write_cnodes()
383 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
384 offs += c->lsave_sz; in write_cnodes()
388 if (offs + c->ltab_sz <= c->leb_size) { in write_cnodes()
390 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
391 offs += c->ltab_sz; in write_cnodes()
401 while (offs + len > c->leb_size) { in write_cnodes()
402 wlen = offs - from; in write_cnodes()
405 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
411 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
415 offs = from = 0; in write_cnodes()
424 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
425 offs += c->lsave_sz; in write_cnodes()
431 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
432 offs += c->ltab_sz; in write_cnodes()
439 ubifs_pack_nnode(c, buf + offs, in write_cnodes()
442 ubifs_pack_pnode(c, buf + offs, in write_cnodes()
454 offs += len; in write_cnodes()
461 if (offs + c->lsave_sz > c->leb_size) { in write_cnodes()
462 wlen = offs - from; in write_cnodes()
464 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
468 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
472 offs = from = 0; in write_cnodes()
480 ubifs_pack_lsave(c, buf + offs, c->lsave); in write_cnodes()
481 offs += c->lsave_sz; in write_cnodes()
487 if (offs + c->ltab_sz > c->leb_size) { in write_cnodes()
488 wlen = offs - from; in write_cnodes()
490 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
494 dbg_chk_lpt_sz(c, 2, c->leb_size - offs); in write_cnodes()
498 offs = from = 0; in write_cnodes()
505 ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); in write_cnodes()
506 offs += c->ltab_sz; in write_cnodes()
511 wlen = offs - from; in write_cnodes()
513 memset(buf + offs, 0xff, alen - wlen); in write_cnodes()
519 err = dbg_chk_lpt_sz(c, 3, ALIGN(offs, c->min_io_size)); in write_cnodes()
524 c->nhead_offs = ALIGN(offs, c->min_io_size); in write_cnodes()
536 lnum, offs, len, done_ltab, done_lsave); in write_cnodes()
861 int offs) in make_nnode_dirty() argument
872 if (branch->lnum != lnum || branch->offs != offs) in make_nnode_dirty()
874 } else if (c->lpt_lnum != lnum || c->lpt_offs != offs) in make_nnode_dirty()
910 int offs) in make_pnode_dirty() argument
919 if (branch->lnum != lnum || branch->offs != offs) in make_pnode_dirty()
939 static int make_ltab_dirty(struct ubifs_info *c, int lnum, int offs) in make_ltab_dirty() argument
941 if (lnum != c->ltab_lnum || offs != c->ltab_offs) in make_ltab_dirty()
964 static int make_lsave_dirty(struct ubifs_info *c, int lnum, int offs) in make_lsave_dirty() argument
966 if (lnum != c->lsave_lnum || offs != c->lsave_offs) in make_lsave_dirty()
992 int lnum, int offs) in make_node_dirty() argument
996 return make_nnode_dirty(c, node_num, lnum, offs); in make_node_dirty()
998 return make_pnode_dirty(c, node_num, lnum, offs); in make_node_dirty()
1000 return make_ltab_dirty(c, lnum, offs); in make_node_dirty()
1002 return make_lsave_dirty(c, lnum, offs); in make_node_dirty()
1035 int offs, pad_len; in get_pad_len() local
1039 offs = c->leb_size - len; in get_pad_len()
1040 pad_len = ALIGN(offs, c->min_io_size) - offs; in get_pad_len()
1107 int err, len = c->leb_size, node_type, node_num, node_len, offs; in lpt_gc_lnum() local
1130 offs = c->leb_size - len; in lpt_gc_lnum()
1133 err = make_node_dirty(c, node_type, node_num, lnum, offs); in lpt_gc_lnum()
1476 static int dbg_is_nnode_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_nnode_dirty() argument
1489 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_nnode_dirty()
1495 if (c->lpt_lnum != lnum || c->lpt_offs != offs) in dbg_is_nnode_dirty()
1511 static int dbg_is_pnode_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_pnode_dirty() argument
1525 if (branch->lnum != lnum || branch->offs != offs) in dbg_is_pnode_dirty()
1540 static int dbg_is_ltab_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_ltab_dirty() argument
1542 if (lnum != c->ltab_lnum || offs != c->ltab_offs) in dbg_is_ltab_dirty()
1553 static int dbg_is_lsave_dirty(struct ubifs_info *c, int lnum, int offs) in dbg_is_lsave_dirty() argument
1555 if (lnum != c->lsave_lnum || offs != c->lsave_offs) in dbg_is_lsave_dirty()
1568 int offs) in dbg_is_node_dirty() argument
1572 return dbg_is_nnode_dirty(c, lnum, offs); in dbg_is_node_dirty()
1574 return dbg_is_pnode_dirty(c, lnum, offs); in dbg_is_node_dirty()
1576 return dbg_is_ltab_dirty(c, lnum, offs); in dbg_is_node_dirty()
1578 return dbg_is_lsave_dirty(c, lnum, offs); in dbg_is_node_dirty()
1844 int err, len = c->leb_size, node_type, node_num, node_len, offs; in dump_lpt_leb() local
1859 offs = c->leb_size - len; in dump_lpt_leb()
1866 lnum, offs, pad_len); in dump_lpt_leb()
1873 lnum, offs, len); in dump_lpt_leb()
1884 lnum, offs, node_num); in dump_lpt_leb()
1886 pr_err("LEB %d:%d, pnode\n", lnum, offs); in dump_lpt_leb()
1897 lnum, offs, node_num); in dump_lpt_leb()
1900 lnum, offs); in dump_lpt_leb()
1909 nnode.nbranch[i].offs); in dump_lpt_leb()
1918 pr_err("LEB %d:%d, ltab\n", lnum, offs); in dump_lpt_leb()
1922 pr_err("LEB %d:%d, lsave len\n", lnum, offs); in dump_lpt_leb()