summaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/xz.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 07:24:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 07:24:52 +0200
commitb6d0bcbf1fa9c8088578c959f442e219f590ebf9 (patch)
tree2aaffddd7c46e1850b651796797c8df18622b14e /lib/sqfs/comp/xz.c
parent30597cc7c5d566f671c84c025de97cb1fc2d242e (diff)
Cleanup: Pull compression level parameter out into compressor config
Every compressor (except LC4) has a compression level parameter. This commit pulls the compression level field out into the generic configuration structure and applies some code clean ups as a result from this. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/xz.c')
-rw-r--r--lib/sqfs/comp/xz.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqfs/comp/xz.c b/lib/sqfs/comp/xz.c
index 662a49f..7d7991d 100644
--- a/lib/sqfs/comp/xz.c
+++ b/lib/sqfs/comp/xz.c
@@ -242,8 +242,8 @@ static void xz_get_configuration(const sqfs_compressor_t *base,
cfg->id = SQFS_COMP_XZ;
cfg->flags = xz->flags;
cfg->block_size = xz->block_size;
+ cfg->level = xz->level;
cfg->opt.xz.dict_size = xz->dict_size;
- cfg->opt.xz.level = xz->level;
cfg->opt.xz.lc = xz->lc;
cfg->opt.xz.lp = xz->lp;
cfg->opt.xz.pb = xz->pb;
@@ -288,7 +288,7 @@ int xz_compressor_create(const sqfs_compressor_config_t *cfg,
if (cfg->opt.xz.pb > SQFS_XZ_MAX_PB)
return SQFS_ERROR_UNSUPPORTED;
- if (cfg->opt.xz.level > SQFS_XZ_MAX_LEVEL)
+ if (cfg->level > SQFS_XZ_MAX_LEVEL)
return SQFS_ERROR_UNSUPPORTED;
if (cfg->opt.xz.dict_size < SQFS_XZ_MIN_DICT_SIZE)
@@ -308,7 +308,7 @@ int xz_compressor_create(const sqfs_compressor_config_t *cfg,
xz->lc = cfg->opt.xz.lc;
xz->lp = cfg->opt.xz.lp;
xz->pb = cfg->opt.xz.pb;
- xz->level = cfg->opt.xz.level;
+ xz->level = cfg->level;
base->get_configuration = xz_get_configuration;
base->do_block = (cfg->flags & SQFS_COMP_FLAG_UNCOMPRESS) ?
xz_uncomp_block : xz_comp_block;