Commit e21150e2 authored by Thomas Schmitt's avatar Thomas Schmitt

With -extract : made hardlink registration combinable with sort_lba

parent 9a96d6a1
......@@ -2,7 +2,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 "Jun 23, 2009"
.TH XORRISO 1 "Jun 27, 2009"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
......@@ -668,8 +668,7 @@ terminal where xorriso runs. Before attributing this local character set
to the produced ISO image, check whether the terminal properly displays
all intended filenames, especially exotic national characters.
.TP
\fB\-hardlinks\fR "on" | "off" | "without_update" | "perform_update" | "start_extract" | "end_extract"
.br
\fB\-hardlinks\fR mode[:mode...]
Enable or disable loading and recording of hardlink relations.
.br
In default mode "off", iso_rr files lose their inode numbers at image load
......@@ -691,15 +690,15 @@ automatic last minute changes before the session gets written. Command
Mode "without_update" avoids hardlink processing during update commands.
.br
xorriso commands which extract files from an ISO image try to hardlink files
with identical inode number. Normally this applies only to files which
get extracted during execution of that same command. One may surround a group
of extraction commands by -hardlinks "start_extract" and
-hardlinks "end_extract" to allow hard linking among their extracted files.
-osirrox "sort_lba_on" and -hardlinks "start_extract" mutually disable
each other.
with identical inode number. The normal scope of this operation is from
image load to image load. One may give up the accumulated hard link addresses
by -hardlinks "discard_extract".
.br
A large number of hardlink families may exhaust -temp_mem_limit
if not -osirrox option "sort_lba_on" is in effect.
if not -osirrox "sort_lba_on" and -hardlinks "cheap_sorted_extract"
are both in effect. This restricts hard linking to other files restored by
the same single extract command. -hardlinks "normal_extract" re-enables
wide and expensive hardlink accumulation.
.br
Hardlink processing automatically enables \fB\-compliance new_rr\fR.
This may be overridden by a following -compliance old_rr . In this case
......
This diff is collapsed.
......@@ -106,6 +106,8 @@ struct XorrisO { /* the global context of xorriso */
Do not consolidate suitable nodes to hardlinks.
bit3= with update:
Do not try to detect hardlink splits and joinings.
bit4= with extract:
Do not automatically create hln arrays
*/
int do_joliet;
......
#define Xorriso_timestamP "2009.06.25.125048"
#define Xorriso_timestamP "2009.06.27.112408"
......@@ -3927,17 +3927,24 @@ int Xorriso_restore_overwrite(struct XorrisO *xorriso,
/* @param flag bit0= do not accept hln_targets[i] != NULL as *node_idx
bit1= use *node_idx as found index rather than searching it
bit2= with bit1: use xorriso->node_array rather than hln_array
*/
int Xorriso_search_hardlinks(struct XorrisO *xorriso, IsoNode *node,
int *node_idx, int *min_hl, int *max_hl, int flag)
{
int idx, ret, i;
void *np;
int idx, ret, i, node_count;
void *np, **node_array;
node_array= xorriso->hln_array;
node_count= xorriso->hln_count;
*min_hl= *max_hl= -1;
np= node;
if(flag & 2) {
idx= *node_idx;
if(flag & 4) {
node_array= xorriso->node_array;
node_count= xorriso->node_counter;
}
} else {
*node_idx= -1;
ret= Xorriso_search_in_hln_array(xorriso, np, &idx, 0);
......@@ -3945,11 +3952,11 @@ int Xorriso_search_hardlinks(struct XorrisO *xorriso, IsoNode *node,
return(ret);
}
for(i= idx - 1; i >= 0 ; i--)
if(Xorriso__findi_sorted_ino_cmp(&(xorriso->hln_array[i]), &np) != 0)
if(Xorriso__findi_sorted_ino_cmp(&(node_array[i]), &np) != 0)
break;
*min_hl= i + 1;
for(i= idx + 1; i < xorriso->hln_count; i++)
if(Xorriso__findi_sorted_ino_cmp(&(xorriso->hln_array[i]), &np) != 0)
for(i= idx + 1; i < node_count; i++)
if(Xorriso__findi_sorted_ino_cmp(&(node_array[i]), &np) != 0)
break;
*max_hl= i - 1;
......@@ -3957,8 +3964,8 @@ int Xorriso_search_hardlinks(struct XorrisO *xorriso, IsoNode *node,
if(flag & 2)
return(1);
for(i= *min_hl; i <= *max_hl; i++)
if(xorriso->hln_array[i] == np) {
if((flag & 1) && xorriso->hln_targets != NULL)
if(node_array[i] == np) {
if((flag & 1) && xorriso->hln_targets != NULL && !(flag & 4))
if(xorriso->hln_targets[i] != NULL)
continue;
*node_idx= i;
......@@ -3994,7 +4001,7 @@ int Xorriso_restore_target_hl(struct XorrisO *xorriso, IsoNode *node,
}
link_sibling= 1;
ret= Xorriso_restore_make_hl(xorriso, xorriso->hln_targets[i], disk_path,
0);
!!xorriso->do_auto_chmod);
if(ret > 0)
return(1);
}
......@@ -4015,7 +4022,7 @@ int Xorriso_restore_prefix_hl(struct XorrisO *xorriso, IsoNode *node,
struct Xorriso_lsT *img_prefixes= NULL, *disk_prefixes= NULL;
ret= Xorriso_search_hardlinks(xorriso, node, &node_idx, &min_hl, &max_hl,
1 | 2);
2 | 4);
if(ret < 0)
return(ret);
if(ret == 0 || min_hl == max_hl)
......@@ -4042,7 +4049,8 @@ int Xorriso_restore_prefix_hl(struct XorrisO *xorriso, IsoNode *node,
img_path, old_path, hflag);
if(ret <= 0)
return(ret);
ret= Xorriso_restore_make_hl(xorriso, old_path, disk_path, 1);
ret= Xorriso_restore_make_hl(xorriso, old_path, disk_path,
!!xorriso->do_auto_chmod);
if(ret > 0)
return(1);
}
......@@ -4168,10 +4176,10 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
img_path_pt= img_path;
if(!((xorriso->ino_behavior & 4) || (flag & (1 || 16)) ||
LIBISO_ISDIR(node))) {
if(!((xorriso->ino_behavior & 4) || (flag & (1 | 16)) || LIBISO_ISDIR(node))){
/* Try to restore as hardlink */
ret= Xorriso_restore_target_hl(xorriso, node, disk_path, &node_idx, 0);
ret= Xorriso_restore_target_hl(xorriso, node, disk_path, &node_idx,
!!xorriso->do_auto_chmod);
if(ret < 0) {
goto ex;
} else if(ret & 1) {
......@@ -4823,8 +4831,10 @@ int Xorriso_restore_node_array(struct XorrisO *xorriso, int flag)
&stbuf_ret, 64);
if(ret<=0 || ret==3)
goto was_problem;
if(i > 0 && !(xorriso->ino_behavior & 4)) {
if(xorriso->hln_array != NULL && !(xorriso->ino_behavior & 16)) {
/* Eventual lookup of hardlinks will be done in
Xorriso_restore_disk_object() */;
} else if(i > 0 && !(xorriso->ino_behavior & 4)) {
if(Xorriso__findi_sorted_ino_cmp(&(xorriso->node_array[i-1]),
&(xorriso->node_array[i])) == 0) {
if(faulty_family) {
......@@ -4853,7 +4863,8 @@ int Xorriso_restore_node_array(struct XorrisO *xorriso, int flag)
}
ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path,
(off_t) 0, (off_t) 0, 4 | 128);
(off_t) 0, (off_t) 0,
4 | (xorriso->ino_behavior & 16) | 128);
if(ret<=0)
goto was_problem;
if(ret == 4) {
......@@ -4862,7 +4873,7 @@ int Xorriso_restore_node_array(struct XorrisO *xorriso, int flag)
if(ret < 0)
goto ex;
ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path,
(off_t) 0, (off_t) 0, 4);
(off_t) 0, (off_t) 0, 4 | (xorriso->ino_behavior & 16));
if(ret<=0)
goto was_problem;
Permstack_pop(&(xorriso->perm_stack), perm_stack_mem, xorriso, 0);
......
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