Lines Matching refs:cnt
339 static int get_leb_cnt(struct ubifs_info *c, int cnt) in get_leb_cnt() argument
344 cnt -= (c->leb_size - c->ihead_offs) / c->max_idx_node_sz; in get_leb_cnt()
345 if (cnt < 0) in get_leb_cnt()
346 cnt = 0; in get_leb_cnt()
348 return DIV_ROUND_UP(cnt, d); in get_leb_cnt()
361 static int layout_in_gaps(struct ubifs_info *c, int cnt) in layout_in_gaps() argument
365 dbg_gc("%d znodes to write", cnt); in layout_in_gaps()
395 cnt -= written; in layout_in_gaps()
396 leb_needed_cnt = get_leb_cnt(c, cnt); in layout_in_gaps()
397 dbg_gc("%d znodes remaining, need %d LEBs, have %d", cnt, in layout_in_gaps()
552 static int layout_commit(struct ubifs_info *c, int no_space, int cnt) in layout_commit() argument
557 err = layout_in_gaps(c, cnt); in layout_commit()
629 int cnt = 0; in get_znodes_to_commit() local
637 cnt += 1; in get_znodes_to_commit()
649 cnt += 1; in get_znodes_to_commit()
651 dbg_cmt("committing %d znodes", cnt); in get_znodes_to_commit()
652 ubifs_assert(cnt == atomic_long_read(&c->dirty_zn_cnt)); in get_znodes_to_commit()
653 return cnt; in get_znodes_to_commit()
665 static int alloc_idx_lebs(struct ubifs_info *c, int cnt) in alloc_idx_lebs() argument
671 leb_cnt = get_leb_cnt(c, cnt); in alloc_idx_lebs()
742 int err = 0, cnt; in ubifs_tnc_start_commit() local
748 cnt = get_znodes_to_commit(c); in ubifs_tnc_start_commit()
749 if (cnt != 0) { in ubifs_tnc_start_commit()
752 err = alloc_idx_lebs(c, cnt); in ubifs_tnc_start_commit()
757 err = layout_commit(c, no_space, cnt); in ubifs_tnc_start_commit()