New -zisofs parameters bpt_target=

This commit is contained in:
Thomas Schmitt 2020-10-17 15:30:26 +02:00
parent 2f44446d05
commit 3f390f2cdc
11 changed files with 6092 additions and 73 deletions

View File

@ -200,6 +200,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->zisofs_max_file_blocks= m->zisofs_max_file_blocks_default= 0x2000000;
m->zisofs_block_size= m->zisofs_block_size_default= (1 << 15);
m->zisofs_v2_block_size= m->zisofs_v2_block_size_default= (1 << 17);
m->zisofs_block_number_target= -1;
m->do_overwrite= 2;
m->do_reassure= 0;
m->drive_blacklist= NULL;

View File

@ -677,9 +677,10 @@ int Xorriso_set_zisofs_params(struct XorrisO *xorriso, int flag)
ctrl.max_total_blocks= xorriso->zisofs_max_total_blocks;
ctrl.max_file_blocks= xorriso->zisofs_max_file_blocks;
ctrl.v2_block_size_log2= 17;
for(i= 15; i <= 17; i++)
for(i= 15; i <= 20; i++)
if(xorriso->zisofs_v2_block_size == (1 << i))
ctrl.v2_block_size_log2= i;
ctrl.block_number_target= xorriso->zisofs_block_number_target;
ret= iso_zisofs_set_params(&ctrl, 0);
Xorriso_process_msg_queues(xorriso,0);
@ -727,22 +728,6 @@ int Xorriso_status_zisofs(struct XorrisO *xorriso, char *filter, FILE *fp,
always= 1;
}
#ifdef NIX
if((flag & 1) && xorriso->zlib_level == xorriso->zlib_level_default &&
xorriso->zisofs_block_size == xorriso->zisofs_block_size_default &&
xorriso->zisofs_by_magic == 0 && xorriso->zisofs_v2_enabled == 0 &&
xorriso->zisofs_max_file_blocks ==
xorriso->zisofs_max_file_blocks_default &&
xorriso->zisofs_v2_block_size == xorriso->zisofs_v2_block_size_default &&
ziso_count == 0 && osiz_count == 0 &&
gzip_count == 0 && gunzip_count == 0) {
if(filter == NULL)
return(2);
if(filter[0] == 0)
return 2;
}
#endif
if(always || !(
xorriso->zlib_level == xorriso->zlib_level_default &&
xorriso->zisofs_block_size == xorriso->zisofs_block_size_default &&
@ -755,12 +740,14 @@ int Xorriso_status_zisofs(struct XorrisO *xorriso, char *filter, FILE *fp,
}
if(always || !(
xorriso->zisofs_v2_enabled == 0 &&
xorriso->zisofs_v2_block_size == xorriso->zisofs_v2_block_size_default)){
xorriso->zisofs_v2_block_size == xorriso->zisofs_v2_block_size_default
&& xorriso->zisofs_block_number_target == -1)){
sprintf(xorriso->result_line,
"-zisofs version_2=%s:block_size_v2=%dk\n",
"-zisofs version_2=%s:block_size_v2=%dk:bpt_target=%.f\n",
xorriso->zisofs_v2_enabled ? xorriso->zisofs_v2_enabled == 1 ?
"as_needed" : "on" : "off",
xorriso->zisofs_v2_block_size / 1024);
xorriso->zisofs_v2_block_size / 1024,
(double) xorriso->zisofs_block_number_target);
Xorriso_status_result(xorriso, filter, fp, flag & 2);
}

View File

@ -1316,8 +1316,8 @@ int Xorriso_stream_type(struct XorrisO *xorriso, IsoNode *node,
ret= iso_stream_get_zisofs_par(stream, &stream_type, zisofs_algo, &algo_num,
&block_size_log2, 0);
if(ret == 1)
sprintf(type_text + strlen(type_text), ":%c%c:%d",
zisofs_algo[0], zisofs_algo[1], 1 << block_size_log2);
sprintf(type_text + strlen(type_text), ":%c%c:%dk",
zisofs_algo[0], zisofs_algo[1], 1 << (block_size_log2 - 10));
} else if(strcmp(text, "gzip") == 0) {
strcpy(type_text, "--gzip");
} else if(strcmp(text, "pizg") == 0) {

View File

@ -228,6 +228,7 @@ LIBISOBURN_MISCONFIGURATION_ = 0;
xorriso->zisofs_max_file_blocks_default= zisofs_ctrl.max_file_blocks;
xorriso->zisofs_v2_block_size= xorriso->zisofs_v2_block_size_default=
1 << zisofs_ctrl.v2_block_size_log2;
xorriso->zisofs_block_number_target= zisofs_ctrl.block_number_target;
}
iso_node_xinfo_make_clonable(Xorriso__mark_update_xinfo,

View File

@ -2187,7 +2187,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Set global zisofs parameters:",
" level=0|...|9 , block_size=32k|64k|128k , by_magic=on|off",
" version_2=off|as_needed|on , block_size_v2=32k|...|1024k",
" max_bpt=1k...128g , max_bpt_f=1k...128g",
" max_bpt=1k...128g , max_bpt_f=1k...128g , bpt_target=num",
"",
"Write-to-media commands:",
" -rollback Discard the manipulated ISO image and reload it.",

View File

@ -2262,7 +2262,7 @@ static int parse_zisofs_param(char *cpt, int key_l, int l, double *num)
int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
{
int was_level, was_blocksize, was_v2_enabled, was_blocksize_v2;
uint64_t was_max_total_blocks, was_max_file_blocks;
uint64_t was_max_total_blocks, was_max_file_blocks, was_block_number_target;
int ret, l, i;
double num;
char *cpt, *npt, text[16];
@ -2273,6 +2273,7 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
was_max_total_blocks= xorriso->zisofs_max_total_blocks;
was_max_file_blocks= xorriso->zisofs_max_file_blocks;
was_blocksize_v2= xorriso->zisofs_v2_block_size;
was_block_number_target= xorriso->zisofs_block_number_target;
npt= cpt= mode;
for(cpt= mode; npt!=NULL; cpt= npt+1) {
npt= strchr(cpt,':');
@ -2367,6 +2368,10 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
}
xorriso->zisofs_v2_block_size= num;
} else if(strncmp(cpt, "bpt_target=", 11) == 0) {
parse_zisofs_param(cpt, 11, l, &num);
xorriso->zisofs_block_number_target= num;
} else if(strncmp(cpt, "default", l)==0) {
xorriso->zlib_level= xorriso->zlib_level_default;
xorriso->zisofs_block_size= xorriso->zisofs_block_size_default;
@ -2375,6 +2380,7 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
xorriso->zisofs_max_total_blocks= xorriso->zisofs_max_total_blocks_default;
xorriso->zisofs_max_file_blocks= xorriso->zisofs_max_file_blocks_default;
xorriso->zisofs_v2_block_size= xorriso->zisofs_v2_block_size_default;
xorriso->zisofs_block_number_target= -1;
} else {
unknown_mode:;
@ -2390,6 +2396,7 @@ sorry_ex:
xorriso->zisofs_max_total_blocks= was_max_total_blocks;
xorriso->zisofs_max_file_blocks= was_max_file_blocks;
xorriso->zisofs_v2_block_size= was_blocksize_v2;
xorriso->zisofs_block_number_target= was_block_number_target;
return(0);
}
}

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.5.3, Oct 14, 2020"
.TH XORRISO 1 "Version 1.5.3, Oct 16, 2020"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -3129,15 +3129,27 @@ zisofs compressed files.
.br
"block_size_v2="32k|64k|128k|256k|512k|1m sets the size of compression blocks
for zisofs2.
.br
"bpt_target="\-1|>0 sets a number of block pointers per file, which is
considered low enough to justify a reduction of block size. If this number is
larger than 0, then block sizes smaller than the settings of block_size= or
block_size_v2= are tried whether they yield not more block pointers than the
given number. If so, the smallest suitable block size is applied.
.br
The inavoidable final block pointer counts. E.g. a file of 55 KiB has 3 block
pointers if block size is 32k, and 2 block pointers with block size 64k.
.br
bpt_target=\-1 disables this automatic block size adjustment.
.br
"max_bpt="1k|...|128g sets the limit for the overall allocated block pointer
memory. Block pointers occupy virtual memory while a file gets uncompressed
and while a file, which shall be compressed, waits for ISO filesystem creation.
.br
One pointer occupies 8 bytes of memory and governs block_size or block_size_v2
uncompressed bytes.
I.e. with block size 128k, 1m of block pointer memory suffices for 16g of
uncompressed file size.
uncompressed bytes. I.e. with block size 128k, 1m of block pointer memory
suffices for at most 16g of uncompressed file size. Each file consumes one end
block pointer, independently of the file size. Partially filled end blocks
may further reduce the effective payload.
.br
"max_bpt_f="1k|...|128g sets the limit for the memory size of the block
pointer list of a single file. max_bpt_f is never larger than max_bpt.

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.5.3, Oct 14, 2020"
@c man .TH XORRISO 1 "Version 1.5.3, Oct 16, 2020"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -3642,15 +3642,27 @@ zisofs compressed files.
@*
"block_size_v2="32k|64k|128k|256k|512k|1m sets the size of compression blocks
for zisofs2.
@*
"bpt_target="-1|>0 sets a number of block pointers per file, which is
considered low enough to justify a reduction of block size. If this number is
larger than 0, then block sizes smaller than the settings of block_size= or
block_size_v2= are tried whether they yield not more block pointers than the
given number. If so, the smallest suitable block size is applied.
@*
The inavoidable final block pointer counts. E.g. a file of 55 KiB has 3 block
pointers if block size is 32k, and 2 block pointers with block size 64k.
@*
bpt_target=-1 disables this automatic block size adjustment.
@*
"max_bpt="1k|...|128g sets the limit for the overall allocated block pointer
memory. Block pointers occupy virtual memory while a file gets uncompressed
and while a file, which shall be compressed, waits for ISO filesystem creation.
@*
One pointer occupies 8 bytes of memory and governs block_size or block_size_v2
uncompressed bytes.
I.e. with block size 128k, 1m of block pointer memory suffices for 16g of
uncompressed file size.
uncompressed bytes. I.e. with block size 128k, 1m of block pointer memory
suffices for at most 16g of uncompressed file size. Each file consumes one end
block pointer, independently of the file size. Partially filled end blocks
may further reduce the effective payload.
@*
"max_bpt_f="1k|...|128g sets the limit for the memory size of the block
pointer list of a single file. max_bpt_f is never larger than max_bpt.

View File

@ -231,6 +231,7 @@ struct XorrisO { /* the global context of xorriso */
uint64_t zisofs_max_file_blocks_default;
int zisofs_v2_block_size;
int zisofs_v2_block_size_default;
int64_t zisofs_block_number_target;
int do_overwrite; /* 0=off, 1=on, 2=nondir */
int do_reassure; /* 0=off, 1=on, 2=tree */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2020.10.16.091750"
#define Xorriso_timestamP "2020.10.17.133001"