summaryrefslogtreecommitdiff
path: root/lib/compress.c
diff options
context:
space:
mode:
authorGao Xiang <gaoxiang25@huawei.com>2019-09-16 16:18:08 +0800
committerGao Xiang <hsiangkao@aol.com>2019-09-18 00:07:38 +0800
commitfbba92dc493401dec79c902580f6ac2101660eb9 (patch)
tree01d62cc861ae3127e3dc8f08544b4434278d8a38 /lib/compress.c
parent634bb4da8e258287c89c7955725b10433ee448f0 (diff)
erofs-utils: keep up with in-kernel ondisk format naming
This patch adapts erofs-utils to the latest kernel ondisk definitions, especially the following kernel commits: 4b66eb51d2c4 erofs: remove all the byte offset comments 60a49ba8fee1 erofs: on-disk format should have explicitly assigned numbers b6796abd3cc1 erofs: some macros are much more readable as a function ed34aa4a8a7d erofs: kill __packed for on-disk structures c39747f770be erofs: update erofs_inode_is_data_compressed helper 426a930891cf erofs: use feature_incompat rather than requirements 8a76568225de erofs: better naming for erofs inode related stuffs ea559e7b8451 erofs: update erofs_fs.h comments Reviewed-by: Li Guifu <blucerlee@gmail.com> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Diffstat (limited to 'lib/compress.c')
-rw-r--r--lib/compress.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/compress.c b/lib/compress.c
index 1919609..7935fce 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -120,7 +120,7 @@ static int write_uncompressed_block(struct z_erofs_vle_compress_ctx *ctx,
int ret;
unsigned int count;
- if (!(sbi.requirements & EROFS_REQUIREMENT_LZ4_0PADDING)) {
+ if (!(sbi.feature_incompat & EROFS_FEATURE_INCOMPAT_LZ4_0PADDING)) {
/* fix up clusterofs to 0 if possable */
if (ctx->head >= ctx->clusterofs) {
ctx->head -= ctx->clusterofs;
@@ -184,7 +184,8 @@ nocompression:
erofs_dbg("Writing %u compressed data to block %u",
count, ctx->blkaddr);
- if (sbi.requirements & EROFS_REQUIREMENT_LZ4_0PADDING)
+ if (sbi.feature_incompat &
+ EROFS_FEATURE_INCOMPAT_LZ4_0PADDING)
ret = blk_write(dst - (EROFS_BLKSIZ - ret),
ctx->blkaddr, 1);
else
@@ -382,7 +383,7 @@ int z_erofs_convert_to_compacted_format(struct erofs_inode *inode,
4, logical_clusterbits, true);
}
inode->extent_isize = out - (u8 *)inode->compressmeta;
- inode->data_mapping_mode = EROFS_INODE_FLAT_COMPRESSION;
+ inode->datalayout = EROFS_INODE_FLAT_COMPRESSION;
return 0;
}
@@ -473,7 +474,7 @@ int erofs_write_compressed_file(struct erofs_inode *inode)
legacymetasize = ctx.metacur - compressmeta;
if (cfg.c_legacy_compress) {
inode->extent_isize = legacymetasize;
- inode->data_mapping_mode = EROFS_INODE_FLAT_COMPRESSION_LEGACY;
+ inode->datalayout = EROFS_INODE_FLAT_COMPRESSION_LEGACY;
} else {
ret = z_erofs_convert_to_compacted_format(inode, blkaddr - 1,
legacymetasize, 12);