Browse Source

Made early preparations for implementation of hard link persistence

release-1.5.4.branch
Thomas Schmitt 13 years ago
parent
commit
5009d1038d
  1. 4
      libisofs/ecma119_tree.c
  2. 7
      libisofs/filesrc.c
  3. 2
      libisofs/fs_image.c
  4. 9
      libisofs/libisofs.h
  5. 11
      libisofs/util_rbtree.c

4
libisofs/ecma119_tree.c

@ -108,6 +108,10 @@ int create_ecma119_node(Ecma119Image *img, IsoNode *iso, Ecma119Node **node)
/* TODO #00009 : add true support for harlinks and inode numbers */
ecma->nlink = 1;
/* >>> ts A90426 : unite this with fs_give_ino_number() when it gets
an inode recycling mode
*/
ecma->ino = ++img->ino;
*node = ecma;

7
libisofs/filesrc.c

@ -30,6 +30,13 @@ int iso_file_src_cmp(const void *n1, const void *n2)
iso_stream_get_id(f1->stream, &fs_id1, &dev_id1, &ino_id1);
iso_stream_get_id(f2->stream, &fs_id2, &dev_id2, &ino_id2);
#ifdef Libisofs_file_src_cmp_non_zerO
if (fs_id1 == 0 && dev_id1 == 0 && ino_id1 == 0)
return -1;
if (fs_id2 == 0 && dev_id2 == 0 && ino_id2 == 0)
return 1;
#endif
if (fs_id1 < fs_id2) {
return -1;
} else if (fs_id1 > fs_id2) {

2
libisofs/fs_image.c

@ -2786,6 +2786,8 @@ int create_boot_img_filesrc(IsoImageFilesystem *fs, IsoFileSource **src)
#else /* Libisofs_new_fs_image_inO */
/* ts A90426 : >>> need a unique inode for El-Torito boot image */
atts.st_ino = fsdata->imgblock; /* not the best solution, but... */
#endif /* ! Libisofs_new_fs_image_inO */

9
libisofs/libisofs.h

@ -5283,6 +5283,15 @@ struct burn_source {
#define Libisofs_ino_from_lbA yes
*/
/* Experiment: Regarding (fs_id == 0 && dev_id == 0 && ino_id == 0)
as always unique.
WAS DANGEROUS: In a previous experiment iso_rbtree_insert() needed equality.
Now i changed the test in there, so that identical IsoFileSrc
objects are considered equal regardless of their id.
STILL UNTESTED.
#define Libisofs_file_src_cmp_non_zerO yes
*/
/* Experiment: Write obsolete RR entries with Rock Ridge.
I suspect Solaris wants to see them.

11
libisofs/util_rbtree.c

@ -198,7 +198,16 @@ int iso_rbtree_insert(IsoRBTree *tree, void *data, void **item)
}
}
comp = tree->compare(q->data, data);
/* ts A90424 : Maybe one can try again to introduce an id
tuple which is not considered equal to itself
by the compare test.
The last attempt caused a loop here.
*/
if (q->data == data) {
comp = 0;
} else {
comp = tree->compare(q->data, data);
}
/* Stop if found */
if (comp == 0) {

Loading…
Cancel
Save