Home
last modified time | relevance | path

Searched refs:leb_size (Results 1 – 25 of 39) sorted by relevance

12

/linux-6.1.9/fs/ubifs/
Dlpt_commit.c157 if (c->ltab[i].free == c->leb_size) { in alloc_lpt_leb()
167 if (c->ltab[i].free == c->leb_size) { in alloc_lpt_leb()
198 if (!done_lsave && offs + c->lsave_sz <= c->leb_size) { in layout_cnodes()
206 if (offs + c->ltab_sz <= c->leb_size) { in layout_cnodes()
222 while (offs + len > c->leb_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()
265 if (offs + c->lsave_sz > c->leb_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()
[all …]
Dlprops.c402 if (lprops->free == c->leb_size) { in ubifs_categorize_lprops()
407 if (lprops->free + lprops->dirty == c->leb_size) { in ubifs_categorize_lprops()
557 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) in ubifs_change_lp()
569 c->lst.total_used -= c->leb_size - old_spc; in ubifs_change_lp()
577 if (free == c->leb_size) { in ubifs_change_lp()
578 if (lprops->free != c->leb_size) in ubifs_change_lp()
580 } else if (lprops->free == c->leb_size) in ubifs_change_lp()
610 c->lst.total_used += c->leb_size - new_spc; in ubifs_change_lp()
613 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) in ubifs_change_lp()
790 ubifs_assert(c, lprops->free == c->leb_size); in ubifs_fast_find_empty()
[all …]
Dsb.c109 if (jnl_lebs * c->leb_size > DEFAULT_MAX_JNL) in create_default_filesystem()
110 jnl_lebs = DEFAULT_MAX_JNL / c->leb_size; in create_default_filesystem()
118 tmp = 2 * (c->ref_node_alsz * jnl_lebs) + c->leb_size - 1; in create_default_filesystem()
119 log_lebs = tmp / c->leb_size; in create_default_filesystem()
177 tmp64 = (long long)max_buds * c->leb_size; in create_default_filesystem()
197 sup->leb_size = cpu_to_le32(c->leb_size); in create_default_filesystem()
216 main_bytes = (long long)main_lebs * c->leb_size; in create_default_filesystem()
400 if (le32_to_cpu(sup->leb_size) != c->leb_size) { in validate_sb()
402 le32_to_cpu(sup->leb_size), c->leb_size); in validate_sb()
440 max_bytes = (long long)c->leb_size * UBIFS_MIN_BUD_LEBS; in validate_sb()
[all …]
Dlog.c94 h = (long long)c->lhead_lnum * c->leb_size + c->lhead_offs; in empty_log_bytes()
95 t = (long long)c->ltail_lnum * c->leb_size; in empty_log_bytes()
144 c->bud_bytes += c->leb_size - bud->start; in ubifs_add_bud()
204 if (c->bud_bytes + c->leb_size - offs > c->max_bud_bytes) { in ubifs_add_bud_to_log()
234 if (c->lhead_offs > c->leb_size - c->ref_node_alsz) { in ubifs_add_bud_to_log()
325 c->cmt_bud_bytes += c->leb_size - bud->start; in remove_buds()
328 c->leb_size - bud->start, c->cmt_bud_bytes); in remove_buds()
397 if (lnum == -1 || offs == c->leb_size) in ubifs_log_start_commit()
441 ubifs_assert(c, c->lhead_offs < c->leb_size); in ubifs_log_start_commit()
485 c->min_log_bytes = c->leb_size; in ubifs_log_end_commit()
[all …]
Dio.c252 ubifs_assert(c, !(offs & 7) && offs < c->leb_size); in ubifs_check_node()
273 if (node_len + offs > c->leb_size) in ubifs_check_node()
571 ubifs_assert(c, wbuf->offs + wbuf->size <= c->leb_size); in ubifs_wbuf_sync_nolock()
576 if (c->leb_size - wbuf->offs >= c->max_write_size) in ubifs_wbuf_sync_nolock()
606 if (c->leb_size - wbuf->offs < c->max_write_size) in ubifs_wbuf_sync_nolock()
607 wbuf->size = c->leb_size - wbuf->offs; in ubifs_wbuf_sync_nolock()
619 c->leb_size - wbuf->offs, dirt); in ubifs_wbuf_sync_nolock()
639 ubifs_assert(c, offs >= 0 && offs <= c->leb_size); in ubifs_wbuf_seek_nolock()
647 if (c->leb_size - wbuf->offs < c->max_write_size) in ubifs_wbuf_seek_nolock()
648 wbuf->size = c->leb_size - wbuf->offs; in ubifs_wbuf_seek_nolock()
[all …]
Dlpt.c70 c->space_bits = fls(c->leb_size) - 3; in do_calc_lpt_geom()
72 c->lpt_offs_bits = fls(c->leb_size - 1); in do_calc_lpt_geom()
73 c->lpt_spc_bits = fls(c->leb_size); in do_calc_lpt_geom()
110 while (sz > c->leb_size) { in do_calc_lpt_geom()
112 sz -= c->leb_size; in do_calc_lpt_geom()
134 lebs_needed = div_u64(sz + c->leb_size - 1, c->leb_size); in ubifs_calc_lpt_geom()
141 if (c->ltab_sz > c->leb_size) { in ubifs_calc_lpt_geom()
184 if (c->lpt_sz > c->leb_size) { in calc_dflt_lpt_geom()
193 lebs_needed = div_u64(sz + c->leb_size - 1, c->leb_size); in calc_dflt_lpt_geom()
203 if (c->ltab_sz > c->leb_size) { in calc_dflt_lpt_geom()
[all …]
Dtnc_commit.c141 if (gap_end == c->leb_size) { in fill_gap()
287 c->ileb_len = c->leb_size; in layout_leb_in_gaps()
288 gap_end = c->leb_size; in layout_leb_in_gaps()
301 if (lp.free == c->leb_size) { in layout_leb_in_gaps()
307 c->leb_size - c->ileb_len, 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()
339 cnt -= (c->leb_size - c->ihead_offs) / c->max_idx_node_sz; in get_leb_cnt()
342 d = c->leb_size / c->max_idx_node_sz; in get_leb_cnt()
449 if (buf_offs + next_len > c->leb_size) in layout_in_empty_space()
515 buf_offs + used + next_len <= c->leb_size && in layout_in_empty_space()
[all …]
Drecovery.c104 sbuf = vmalloc(c->leb_size); in get_master_node()
108 err = ubifs_leb_read(c, lnum, sbuf, 0, c->leb_size, 0); in get_master_node()
115 len = c->leb_size; in get_master_node()
116 while (offs + UBIFS_MST_NODE_SZ <= c->leb_size) { in get_master_node()
160 if (offs < c->leb_size) { in get_master_node()
170 if (offs < c->leb_size) in get_master_node()
267 c->leb_size - offs2 - sz < sz) { in ubifs_recover_master_node()
292 if (offs2 + sz + sz <= c->leb_size) in ubifs_recover_master_node()
355 ubifs_dump_node(c, mst1, c->leb_size - ((void *)mst1 - buf1)); in ubifs_recover_master_node()
359 ubifs_dump_node(c, mst2, c->leb_size - ((void *)mst2 - buf2)); in ubifs_recover_master_node()
[all …]
Dmaster.c193 c->lhead_offs < 0 || c->lhead_offs >= c->leb_size || in validate_master()
200 c->zroot.offs >= c->leb_size || c->zroot.offs & 7) { in validate_master()
218 c->ihead_offs > c->leb_size || c->ihead_offs & 7) { in validate_master()
223 main_sz = (long long)c->main_lebs * c->leb_size; in validate_master()
230 c->lpt_offs < 0 || c->lpt_offs + c->nnode_sz > c->leb_size) { in validate_master()
237 c->nhead_offs > c->leb_size) { in validate_master()
244 c->ltab_offs + c->ltab_sz > c->leb_size) { in validate_master()
251 c->lsave_offs + c->lsave_sz > c->leb_size)) { in validate_master()
402 c->lst.total_free += growth * (long long)c->leb_size; in ubifs_read_master()
446 if (offs + UBIFS_MST_NODE_SZ > c->leb_size) { in ubifs_write_master()
Dsuper.c531 c->leb_size = c->vi.usable_leb_size; in init_constants_early()
533 c->half_leb_size = c->leb_size / 2; in init_constants_early()
539 if (c->leb_size < UBIFS_MIN_LEB_SZ) { in init_constants_early()
541 c->leb_size, UBIFS_MIN_LEB_SZ); in init_constants_early()
599 c->ranges[UBIFS_SIG_NODE].max_len = c->leb_size - UBIFS_SB_NODE_SZ; in init_constants_early()
605 c->ranges[UBIFS_ORPH_NODE].max_len = c->leb_size; in init_constants_early()
635 c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ; in init_constants_early()
639 if (c->max_bu_buf_len > c->leb_size) in init_constants_early()
640 c->max_bu_buf_len = c->leb_size; in init_constants_early()
643 c->min_log_bytes = c->leb_size; in init_constants_early()
[all …]
Dgc.c73 c->leb_size - wbuf->offs - wbuf->used); in switch_gc_head()
358 avail = c->leb_size - wbuf->offs - wbuf->used - in move_nodes()
380 avail = c->leb_size - wbuf->offs - wbuf->used - in move_nodes()
503 if (lp->free + lp->dirty == c->leb_size) { in ubifs_garbage_collect_leb()
508 if (lp->free != c->leb_size) { in ubifs_garbage_collect_leb()
517 err = ubifs_change_one_lp(c, lp->lnum, c->leb_size, in ubifs_garbage_collect_leb()
578 err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, in ubifs_garbage_collect_leb()
595 err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, 0, 0); in ubifs_garbage_collect_leb()
745 space_before = c->leb_size - wbuf->offs - wbuf->used; in ubifs_garbage_collect()
796 space_after = c->leb_size - wbuf->offs - wbuf->used; in ubifs_garbage_collect()
[all …]
Dscan.c89 offs + node_len + pad_len > c->leb_size) { in ubifs_scan_a_node()
141 err = ubifs_leb_read(c, lnum, sbuf + offs, offs, c->leb_size - offs, 0); in ubifs_start_scan()
144 c->leb_size - offs, lnum, offs, err); in ubifs_start_scan()
231 len = c->leb_size - offs; in ubifs_scanned_corruption()
258 int err, len = c->leb_size - offs; in ubifs_scan()
Dfind.c102 if (lprops->free + lprops->dirty == c->leb_size) { in scan_for_dirty_cb()
183 lprops->free + lprops->dirty == c->leb_size)); in scan_for_dirty()
318 (pick_free && lp->free + lp->dirty == c->leb_size)); in ubifs_find_dirty_leb()
369 if (!data->pick_free && lprops->free == c->leb_size) in scan_for_free_cb()
377 if (lprops->free + lprops->dirty == c->leb_size && lprops->dirty > 0) in scan_for_free_cb()
549 *offs = c->leb_size - lprops->free; in ubifs_find_free_space()
564 dbg_find("found LEB %d, free %d", lnum, c->leb_size - *offs); in ubifs_find_free_space()
565 ubifs_assert(c, *offs <= c->leb_size - min_space); in ubifs_find_free_space()
606 if (lprops->free + lprops->dirty != c->leb_size) in scan_for_idx_cb()
639 ubifs_assert(c, lprops->free + lprops->dirty == c->leb_size); in scan_for_leb_for_idx()
[all …]
Dorphan.c278 ((c->leb_size - UBIFS_ORPH_NODE_SZ) / sizeof(__le64)); in avail_orphs()
279 gap = c->leb_size - c->ohead_offs; in avail_orphs()
298 ((c->leb_size - UBIFS_ORPH_NODE_SZ) / sizeof(__le64)); in tot_avail_orphs()
350 gap = c->leb_size - c->ohead_offs; in write_orph_node()
354 gap = c->leb_size; in write_orph_node()
389 ubifs_assert(c, c->ohead_offs + len <= c->leb_size); in write_orph_node()
650 c->leb_size - snod->offs); in do_kill_orphans()
679 c->leb_size - snod->offs); in do_kill_orphans()
823 c->orph_buf = vmalloc(c->leb_size); in ubifs_mount_orphans()
984 buf = __vmalloc(c->leb_size, GFP_NOFS); in dbg_scan_orphans()
Dreplay.c102 if (b->bud->start == 0 && (lp->free != c->leb_size || lp->dirty != 0)) { in set_bud_lprops()
126 dirty -= c->leb_size - lp->free; in set_bud_lprops()
148 b->bud->lnum, c->leb_size - b->free); in set_bud_lprops()
823 b->free = c->leb_size - sleb->endpt; in replay_bud()
833 ubifs_dump_node(c, snod->node, c->leb_size - snod->offs); in replay_bud()
955 lnum < c->main_first || offs > c->leb_size || in validate_ref()
1116 if (sleb->endpt || c->lhead_offs >= c->leb_size) { in replay_log_leb()
1129 ubifs_dump_node(c, snod->node, c->leb_size - snod->offs); in replay_log_leb()
1188 if (c->ihead_offs != c->leb_size - free) { in ubifs_replay_journal()
Ddebug.c365 pr_err("\tleb_size %u\n", le32_to_cpu(sup->leb_size)); in ubifs_dump_node()
694 lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, in ubifs_dump_lprop()
698 lp->lnum, lp->free, lp->dirty, c->leb_size - spc, spc, in ubifs_dump_lprop()
839 buf = __vmalloc(c->leb_size, GFP_NOFS); in ubifs_dump_leb()
858 ubifs_dump_node(c, snod->node, c->leb_size - snod->offs); in ubifs_dump_leb()
2338 ubifs_dump_node(c, sa->node, c->leb_size - sa->offs); in dbg_check_data_nodes_order()
2343 ubifs_dump_node(c, sb->node, c->leb_size - sb->offs); in dbg_check_data_nodes_order()
2374 ubifs_dump_node(c, sa->node, c->leb_size - sa->offs); in dbg_check_data_nodes_order()
2375 ubifs_dump_node(c, sb->node, c->leb_size - sb->offs); in dbg_check_data_nodes_order()
2406 ubifs_dump_node(c, sa->node, c->leb_size - sa->offs); in dbg_check_nondata_nodes_order()
[all …]
Dmisc.h281 int max_xattrs = (c->leb_size / 2) / UBIFS_INO_NODE_SZ; in ubifs_xattr_max_cnt()
/linux-6.1.9/drivers/mtd/ubi/
Dvtbl.c199 if (alignment > ubi->leb_size || alignment == 0) { in vtbl_check()
210 n = ubi->leb_size % alignment; in vtbl_check()
545 vol->usable_leb_size = ubi->leb_size - vol->data_pad; in init_volumes()
635 vol->usable_leb_size = ubi->leb_size; in init_volumes()
639 (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad); in init_volumes()
794 ubi->vtbl_slots = ubi->leb_size / UBI_VTBL_RECORD_SIZE; in ubi_read_volume_table()
Dvmt.c201 vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment; in ubi_create_volume()
221 vol->data_pad = ubi->leb_size % vol->alignment; in ubi_create_volume()
654 if (vol->alignment > ubi->leb_size || vol->alignment == 0) { in self_check_volume()
665 n = ubi->leb_size % vol->alignment; in self_check_volume()
687 n = ubi->leb_size - vol->data_pad; in self_check_volume()
688 if (vol->usable_leb_size != ubi->leb_size - vol->data_pad) { in self_check_volume()
Dblock.c80 int leb_size; member
195 offset = do_div(pos, dev->leb_size); in ubiblock_read()
204 if (offset + to_read > dev->leb_size) in ubiblock_read()
205 to_read = dev->leb_size - offset; in ubiblock_read()
399 dev->leb_size = vi->usable_leb_size; in ubiblock_create()
Dwl.h14 *count += (ubi->fm_size / ubi->leb_size) * 2; in ubi_fastmap_init()
Dattach.c878 memset(ubi->peb_buf, 0x00, ubi->leb_size); in check_corruption()
881 ubi->leb_size); in check_corruption()
897 if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size)) in check_corruption()
905 pnum, ubi->leb_start, ubi->leb_size); in check_corruption()
907 ubi->peb_buf, ubi->leb_size, 1); in check_corruption()
1711 if (av->data_pad > ubi->leb_size / 2) { in self_check_ai()
Dfastmap.c91 return roundup(size, ubi->leb_size); in ubi_calc_fm_size()
932 fm_size = ubi->leb_size * used_blocks; in ubi_scan_fastmap()
1024 ret = ubi_io_read_data(ubi, ubi->fm_buf + (ubi->leb_size * i), in ubi_scan_fastmap()
1025 pnum, 0, ubi->leb_size); in ubi_scan_fastmap()
1366 ret = ubi_io_write_data(ubi, fm_raw + (i * ubi->leb_size), in ubi_write_fastmap()
1367 new_fm->e[i]->pnum, 0, ubi->leb_size); in ubi_write_fastmap()
1562 new_fm->used_blocks = ubi->fm_size / ubi->leb_size; in ubi_update_fastmap()
Dio.c851 int usable_leb_size = ubi->leb_size - data_pad; in validate_vid_hdr()
886 if (data_pad >= ubi->leb_size / 2) { in validate_vid_hdr()
891 if (data_size > ubi->leb_size) { in validate_vid_hdr()
/linux-6.1.9/include/linux/mtd/
Dubi.h178 int leb_size; member

12