erofs-utils: get rid of `end' argument from erofs_mapbh()
`end` arguement is completely broken now. Also, it could
be reintroduced later if needed.
Link: https://lore.kernel.org/r/20210122171153.27404-2-hsiangkao@aol.com
Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn>
Reviewed-by: Li Guifu <bluce.lee@aliyun.com>
Signed-off-by: Gao Xiang <hsiangkao@aol.com>
diff --git a/include/erofs/cache.h b/include/erofs/cache.h
index 8c171f5..f8dff67 100644
--- a/include/erofs/cache.h
+++ b/include/erofs/cache.h
@@ -95,7 +95,7 @@
struct erofs_buffer_head *erofs_battach(struct erofs_buffer_head *bh,
int type, unsigned int size);
-erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb, bool end);
+erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb);
bool erofs_bflush(struct erofs_buffer_block *bb);
void erofs_bdrop(struct erofs_buffer_head *bh, bool tryrevoke);
diff --git a/lib/cache.c b/lib/cache.c
index 0d5c4a5..32a5831 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -257,16 +257,14 @@
return blkaddr;
}
-erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb, bool end)
+erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb)
{
struct erofs_buffer_block *t, *nt;
if (!bb || bb->blkaddr == NULL_ADDR) {
list_for_each_entry_safe(t, nt, &blkh.list, list) {
- if (!end && (t == bb || nt == &blkh))
- break;
(void)__erofs_mapbh(t);
- if (end && t == bb)
+ if (t == bb)
break;
}
}
diff --git a/lib/compress.c b/lib/compress.c
index 86db940..2b1f93c 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -416,7 +416,7 @@
memset(compressmeta, 0, Z_EROFS_LEGACY_MAP_HEADER_SIZE);
- blkaddr = erofs_mapbh(bh->block, true); /* start_blkaddr */
+ blkaddr = erofs_mapbh(bh->block); /* start_blkaddr */
ctx.blkaddr = blkaddr;
ctx.metacur = compressmeta + Z_EROFS_LEGACY_MAP_HEADER_SIZE;
ctx.head = ctx.tail = 0;
diff --git a/lib/inode.c b/lib/inode.c
index 71615f5..6371aa5 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -148,7 +148,7 @@
inode->bh_data = bh;
/* get blkaddr of the bh */
- ret = erofs_mapbh(bh->block, true);
+ ret = erofs_mapbh(bh->block);
DBG_BUGON(ret < 0);
/* write blocks except for the tail-end block */
@@ -522,7 +522,7 @@
bh->op = &erofs_skip_write_bhops;
/* get blkaddr of bh */
- ret = erofs_mapbh(bh->block, true);
+ ret = erofs_mapbh(bh->block);
DBG_BUGON(ret < 0);
inode->u.i_blkaddr = bh->block->blkaddr;
@@ -632,7 +632,7 @@
int ret;
erofs_off_t pos;
- erofs_mapbh(bh->block, true);
+ erofs_mapbh(bh->block);
pos = erofs_btell(bh, true) - EROFS_BLKSIZ;
ret = dev_write(inode->idata, pos, inode->idata_size);
if (ret)
@@ -881,7 +881,7 @@
struct erofs_buffer_head *const bh = rootdir->bh;
erofs_off_t off, meta_offset;
- erofs_mapbh(bh->block, true);
+ erofs_mapbh(bh->block);
off = erofs_btell(bh, false);
if (off > rootnid_maxoffset)
@@ -900,7 +900,7 @@
if (!bh)
return inode->nid;
- erofs_mapbh(bh->block, true);
+ erofs_mapbh(bh->block);
off = erofs_btell(bh, false);
meta_offset = blknr_to_addr(sbi.meta_blkaddr);
diff --git a/lib/xattr.c b/lib/xattr.c
index 49ebb9c..8b7bcb1 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -575,7 +575,7 @@
}
bh->op = &erofs_skip_write_bhops;
- erofs_mapbh(bh->block, true);
+ erofs_mapbh(bh->block);
off = erofs_btell(bh, false);
sbi.xattr_blkaddr = off / EROFS_BLKSIZ;
diff --git a/mkfs/main.c b/mkfs/main.c
index abd48be..d9c4c7f 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -304,7 +304,7 @@
round_up(EROFS_SUPER_END, EROFS_BLKSIZ);
char *buf;
- *blocks = erofs_mapbh(NULL, true);
+ *blocks = erofs_mapbh(NULL);
sb.blocks = cpu_to_le32(*blocks);
sb.root_nid = cpu_to_le16(root_nid);
memcpy(sb.uuid, sbi.uuid, sizeof(sb.uuid));