return 0;
}
-static int erofsdump_map_blocks(struct erofs_inode *inode,
- struct erofs_map_blocks *map, int flags)
-{
- if (erofs_inode_is_data_compressed(inode->datalayout))
- return z_erofs_map_blocks_iter(inode, map, flags);
- return erofs_map_blocks(inode, map, flags);
-}
-
static void erofsdump_show_fileinfo(bool show_extent)
{
const char *ext_fmt[] = {
while (map.m_la < inode.i_size) {
struct erofs_map_dev mdev;
- err = erofsdump_map_blocks(&inode, &map,
- EROFS_GET_BLOCKS_FIEMAP);
+ err = erofs_map_blocks(&inode, &map, EROFS_GET_BLOCKS_FIEMAP);
if (err) {
erofs_err("failed to get file blocks range");
return;
erofs_dbg("verify data chunk of nid(%llu): type(%d)",
inode->nid | 0ULL, inode->datalayout);
- switch (inode->datalayout) {
- case EROFS_INODE_FLAT_PLAIN:
- case EROFS_INODE_FLAT_INLINE:
- case EROFS_INODE_CHUNK_BASED:
- compressed = false;
- break;
- case EROFS_INODE_COMPRESSED_FULL:
- case EROFS_INODE_COMPRESSED_COMPACT:
- compressed = true;
- break;
- default:
- erofs_err("unknown datalayout");
- return -EINVAL;
- }
-
+ compressed = erofs_inode_is_data_compressed(inode->datalayout);
while (pos < inode->i_size) {
unsigned int alloc_rawsize;
map.m_la = pos;
- if (compressed)
- ret = z_erofs_map_blocks_iter(inode, &map,
- EROFS_GET_BLOCKS_FIEMAP);
- else
- ret = erofs_map_blocks(inode, &map,
- EROFS_GET_BLOCKS_FIEMAP);
+ ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_FIEMAP);
if (ret)
goto out;
return err;
}
-int erofs_map_blocks(struct erofs_inode *inode,
- struct erofs_map_blocks *map, int flags)
+int __erofs_map_blocks(struct erofs_inode *inode,
+ struct erofs_map_blocks *map, int flags)
{
struct erofs_inode *vi = inode;
struct erofs_sb_info *sbi = inode->sbi;
return err;
}
+int erofs_map_blocks(struct erofs_inode *inode,
+ struct erofs_map_blocks *map, int flags)
+{
+ if (erofs_inode_is_data_compressed(inode->datalayout))
+ return z_erofs_map_blocks_iter(inode, map, flags);
+ return __erofs_map_blocks(inode, map, flags);
+}
+
int erofs_map_dev(struct erofs_sb_info *sbi, struct erofs_map_dev *map)
{
struct erofs_device_info *dif;