Made early preparations for implementation of hard link persistence

This commit is contained in:
Thomas Schmitt 2009-04-26 12:57:17 +02:00
parent 1ae2a39d1d
commit 5009d1038d
5 changed files with 32 additions and 1 deletions

View File

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

View File

@ -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(f1->stream, &fs_id1, &dev_id1, &ino_id1);
iso_stream_get_id(f2->stream, &fs_id2, &dev_id2, &ino_id2); 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) { if (fs_id1 < fs_id2) {
return -1; return -1;
} else if (fs_id1 > fs_id2) { } else if (fs_id1 > fs_id2) {

View File

@ -2786,6 +2786,8 @@ int create_boot_img_filesrc(IsoImageFilesystem *fs, IsoFileSource **src)
#else /* Libisofs_new_fs_image_inO */ #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... */ atts.st_ino = fsdata->imgblock; /* not the best solution, but... */
#endif /* ! Libisofs_new_fs_image_inO */ #endif /* ! Libisofs_new_fs_image_inO */

View File

@ -5283,6 +5283,15 @@ struct burn_source {
#define Libisofs_ino_from_lbA yes #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. /* Experiment: Write obsolete RR entries with Rock Ridge.
I suspect Solaris wants to see them. I suspect Solaris wants to see them.

View File

@ -198,7 +198,16 @@ int iso_rbtree_insert(IsoRBTree *tree, void *data, void **item)
} }
} }
/* 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); comp = tree->compare(q->data, data);
}
/* Stop if found */ /* Stop if found */
if (comp == 0) { if (comp == 0) {