Commit c704c9c2 authored by Thomas Schmitt's avatar Thomas Schmitt

New command -data_cache_size

parent b42293cd
......@@ -161,6 +161,7 @@ Xorriso_option_cp_clone;
Xorriso_option_cpri;
Xorriso_option_cpx;
Xorriso_option_cut_out;
Xorriso_option_data_cache_size;
Xorriso_option_dev;
Xorriso_option_devices;
Xorriso_option_dialog;
......
......@@ -192,6 +192,9 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->displacement_sign= 0;
m->drives_exclusive= 1;
m->early_stdio_test= 0;
m->cache_num_tiles= 0;
m->cache_tile_blocks= 0;
m->cache_default= 1 | 2;
m->do_calm_drive= 1;
m->indev[0]= 0;
m->in_drive_handle= NULL;
......
......@@ -429,6 +429,12 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
if(ret<=0)
goto ex;
ret= Xorriso_set_data_cache(xorriso, ropts, xorriso->cache_num_tiles,
xorriso->cache_tile_blocks,
xorriso->cache_default);
if(ret<=0)
goto ex;
ext= isoburn_ropt_noiso1999;
if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (1 | 4 | 32))
&& !(xorriso->do_md5 & 1))
......
......@@ -95,6 +95,7 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
/* Note: no return before isoburn_ropt_destroy() */
isoburn_ropt_set_extensions(ropts, isoburn_ropt_pretend_blank);
isoburn_ropt_set_input_charset(ropts, xorriso->in_charset);
isoburn_ropt_set_data_cache(ropts, 1, 1, 0);
isoburn_set_read_pacifier(drive, NULL, NULL);
ret= isoburn_read_image(drive, ropts, &volset);
Xorriso_process_msg_queues(xorriso,0);
......
......@@ -863,3 +863,26 @@ int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag)
return(1);
}
/* @param flag bit0= set num_tiles to default value
bit1= set tile_blocks to default value
*/
int Xorriso_set_data_cache(struct XorrisO *xorriso, void *o,
int num_tiles, int tile_blocks, int flag)
{
int ret, tiles, blocks, set_flag;
struct isoburn_read_opts *ropts;
ropts= (struct isoburn_read_opts *) o;
if(flag & (1 | 2)) {
isoburn_ropt_get_data_cache(ropts, &tiles, &blocks, &set_flag, 1);
if(flag & 1)
num_tiles= tiles;
if(flag & 2)
tile_blocks= blocks;
}
ret= isoburn_ropt_set_data_cache(ropts, num_tiles, tile_blocks, 0);
return(ret);
}
......@@ -30,6 +30,28 @@
#include "xorrisoburn.h"
/* Command -data_cache_size */
int Xorriso_option_data_cache_size(struct XorrisO *xorriso, char *num_tiles,
char *tile_blocks, int flag)
{
int ret, blocks= -1, tiles= -1, to_default= 0;
sscanf(num_tiles, "%d", &tiles);
sscanf(tile_blocks, "%d", &blocks);
if(strcmp(num_tiles, "default") == 0 || num_tiles[0] == 0)
to_default|= 1;
if(strcmp(tile_blocks, "default") == 0 || tile_blocks[0] == 0)
to_default|= 2;
ret= Xorriso_set_data_cache(xorriso, NULL, tiles, blocks, to_default);
if(ret > 0) {
xorriso->cache_num_tiles= tiles;
xorriso->cache_tile_blocks= blocks;
xorriso->cache_default= to_default;
}
return(ret);
}
/* Options -dev , -indev, -outdev */
/** @param flag bit0= use as indev
bit1= use as outdev
......@@ -1493,6 +1515,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Allow for writing only the usage of optical drives.",
" -early_stdio_test \"on\"|\"appendable_wo\"|\"off\"",
" Classify stdio drives by effective access permissions.",
" -data_cache_size number_of_tiles blocks_per_tile",
" Adjust size and granularity of the data read cache.",
" -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"",
" Blank medium resp. invalidate ISO image on medium.",
" -close_damaged \"as_needed\"|\"force\"",
......
......@@ -483,6 +483,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
};
static char arg2_commands[][40]= {
"assert_volid","boot_image","clone","compare","compare_r","drive_class",
"data_cache_size",
"errfile_log","error_behavior","extract","extract_single",
"jigdo","load","logfile",
"map","map_single","page","return_with",
......@@ -606,7 +607,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"load", "displacement", "drive_class", "assert_volid", "in_charset",
"auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup",
"disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write",
"early_stdio_test",
"early_stdio_test", "data_cache_size",
"* Character sets:",
"charset", "local_charset",
......@@ -1119,6 +1120,10 @@ next_command:;
ret= Xorriso_option_cut_out(xorriso, arg1, arg2,
argv[(*idx)-2], argv[(*idx)-1], 0);
} else if(strcmp(cmd,"data_cache_size")==0) {
(*idx)+= 2;
ret= Xorriso_option_data_cache_size(xorriso, arg1, arg2, 0);
} else if(strcmp(cmd,"dev")==0) {
(*idx)++;
ret= Xorriso_option_dev(xorriso, arg1, 3);
......
......@@ -1289,6 +1289,19 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->cache_default & 3) == 3);
sprintf(line, "-data_cache_size ");
if(xorriso->cache_default & 1)
sprintf(line + strlen(line), "default ");
else
sprintf(line + strlen(line), "%d ", xorriso->cache_num_tiles);
if(xorriso->cache_default & 2)
sprintf(line + strlen(line), "default\n");
else
sprintf(line + strlen(line), "%d\n", xorriso->cache_tile_blocks);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->allow_restore==0 && xorriso->do_concat_split==1 &&
xorriso->do_auto_chmod==0 && xorriso->drives_exclusive == 1);
mode_pt= "off";
......
......@@ -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.2.1, Mar 10, 2012"
.TH XORRISO 1 "Version 1.2.1, Mar 11, 2012"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
......@@ -945,6 +945,23 @@ of severe problems, and may avoid some less severe error events.
Mode "appendable_wo" is like "on" with the additional property that
non\-empty write\-only files are regarded as appendable rather than blank.
.TP
\fB\-data_cache_size\fR number_of_tiles blocks_per_tile
Set the size and granularity of the data cache which is used when ISO images
are loaded and when file content is read from ISO images. The cache consists
of several tiles, which each consists of several blocks. A larger cache
reduces the need for tiles being read multiple times. Larger tiles might
additionally improve the data throughput from the drive, but can be
wasteful if the data are scattered over the medium.
.br
Larger cache sizes help best with image loading from MMC drives. They are an
inferior alternative to \-osirrox option "sort_lba_on".
.br
blocks_per_tile must be a power of 2. E.g. 16, 32, or 64. The overall cache
size must not exceed 1 GiB.
The default values can be restored by parameter "default" instead of one or
both of the numbers.
Currently the default is 32 tiles of 32 blocks = 2 MiB.
.TP
.B Inserting files into ISO image:
.PP
The following commands expect file addresses of two kinds:
......
......@@ -818,6 +818,11 @@ int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path,
*/
int Xorriso_option_dev(struct XorrisO *xorriso, char *adr, int flag);
/* Command -data_cache_size */
/* @since 1.2.2 */
int Xorriso_option_data_cache_size(struct XorrisO *xorriso, char *num_tiles,
char *tile_blocks, int flag);
/* Command -devices */
/* @param flag bit0= perform -device_links rather than -devices
@return <=0 error , 1 success, 2 revoked by -reassure
......
No preview for this file type
......@@ -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.2.1, Mar 10, 2012"
@c man .TH XORRISO 1 "Version 1.2.1, Mar 11, 2012"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
......@@ -1189,6 +1189,25 @@ of severe problems, and may avoid some less severe error events.
@*
Mode "appendable_wo" is like "on" with the additional property that
non-empty write-only files are regarded as appendable rather than blank.
@c man .TP
@item -data_cache_size number_of_tiles blocks_per_tile
@kindex -data_cache_size adjusts read cache size
@cindex Image reading, cache size, -data_cache_size
Set the size and granularity of the data cache which is used when ISO images
are loaded and when file content is read from ISO images. The cache consists
of several tiles, which each consists of several blocks. A larger cache
reduces the need for tiles being read multiple times. Larger tiles might
additionally improve the data throughput from the drive, but can be
wasteful if the data are scattered over the medium.
@*
Larger cache sizes help best with image loading from MMC drives. They are an
inferior alternative to -osirrox option "sort_lba_on".
@*
blocks_per_tile must be a power of 2. E.g. 16, 32, or 64. The overall cache
size must not exceed 1 GiB.
The default values can be restored by parameter "default" instead of one or
both of the numbers.
Currently the default is 32 tiles of 32 blocks = 2 MiB.
@end table
@c man .TP
@c man .B Inserting files into ISO image:
......
......@@ -267,6 +267,10 @@ struct XorrisO { /* the global context of xorriso */
burn_write_opts_set_start_byte().
*/
int cache_num_tiles; /* -data_cache_size */
int cache_tile_blocks;
int cache_default; /* bit0= cache_num_tiles, bit1= cache_tile_blocks */
int do_calm_drive; /* bit0= calm down drive after aquiring it */
char indev[SfileadrL];
......
#define Xorriso_timestamP "2012.03.11.162050"
#define Xorriso_timestamP "2012.03.11.164130"
......@@ -595,5 +595,8 @@ int Xorriso_close_damaged(struct XorrisO *xorriso, int flag);
int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag);
int Xorriso_set_data_cache(struct XorrisO *xorriso, void *ropts,
int num_tiles, int tile_blocks, int flag);
#endif /* Xorrisoburn_includeD */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment