Skip to content

Commit 39397a4

Browse files
committed
erofs: get rid of label `restart_now'
Simplify this part of code. No logic changes. Link: https://lore.kernel.org/r/20220529055425.226363-3-xiang@kernel.org Acked-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
1 parent 87ca34a commit 39397a4

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

fs/erofs/zdata.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -643,28 +643,23 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
643643
repeat:
644644
cur = end - 1;
645645

646-
/* lucky, within the range of the current map_blocks */
647-
if (offset + cur >= map->m_la &&
648-
offset + cur < map->m_la + map->m_llen) {
646+
if (offset + cur < map->m_la ||
647+
offset + cur >= map->m_la + map->m_llen) {
648+
erofs_dbg("out-of-range map @ pos %llu", offset + cur);
649+
650+
if (z_erofs_collector_end(fe))
651+
fe->backmost = false;
652+
map->m_la = offset + cur;
653+
map->m_llen = 0;
654+
err = z_erofs_map_blocks_iter(inode, map, 0);
655+
if (err)
656+
goto err_out;
657+
} else {
658+
if (fe->pcl)
659+
goto hitted;
649660
/* didn't get a valid pcluster previously (very rare) */
650-
if (!fe->pcl)
651-
goto restart_now;
652-
goto hitted;
653661
}
654662

655-
/* go ahead the next map_blocks */
656-
erofs_dbg("%s: [out-of-range] pos %llu", __func__, offset + cur);
657-
658-
if (z_erofs_collector_end(fe))
659-
fe->backmost = false;
660-
661-
map->m_la = offset + cur;
662-
map->m_llen = 0;
663-
err = z_erofs_map_blocks_iter(inode, map, 0);
664-
if (err)
665-
goto err_out;
666-
667-
restart_now:
668663
if (!(map->m_flags & EROFS_MAP_MAPPED))
669664
goto hitted;
670665

0 commit comments

Comments
 (0)