Transfering inode numbers from PX entries to IsoNode during image import

and using these numbers in PX entries during next image generation.
This also answers the concerns about PX without ino in RRIP 1.12
and PX with ino in RRIP 1.10 images produced by mkisofs.
This commit is contained in:
2009-04-28 22:40:15 +02:00
parent 5009d1038d
commit d20da80767
13 changed files with 696 additions and 79 deletions

View File

@@ -17,6 +17,8 @@
#include <string.h>
#include <limits.h>
/* ts A90427 : introduced test (n1 == n2) and flattened block nesting
*/
int iso_file_src_cmp(const void *n1, const void *n2)
{
const IsoFileSrc *f1, *f2;
@@ -24,6 +26,12 @@ int iso_file_src_cmp(const void *n1, const void *n2)
dev_t dev_id1, dev_id2;
ino_t ino_id1, ino_id2;
off_t size1, size2;
if (n1 == n2) {
return 0; /* Normally just a shortcut.
But important if Libisofs_file_src_cmp_non_zerO */
}
f1 = (const IsoFileSrc *)n1;
f2 = (const IsoFileSrc *)n2;
@@ -31,37 +39,36 @@ int iso_file_src_cmp(const void *n1, const void *n2)
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)
if (fs_id1 == 0 && dev_id1 == 0 && ino_id1 == 0) {
return -1;
if (fs_id2 == 0 && dev_id2 == 0 && ino_id2 == 0)
} else 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) {
return 1;
} else {
/* files belong to the same fs */
if (dev_id1 > dev_id2) {
return -1;
} else if (dev_id1 < dev_id2) {
return 1;
} else if (ino_id1 < ino_id2) {
return -1;
} else if (ino_id1 > ino_id2) {
return 1;
} else {
size1 = iso_stream_get_size(f1->stream);
size2 = iso_stream_get_size(f2->stream);
if (size1 < size2) {
return -1;
} else if (size1 > size2) {
return 1;
}
return 0;
}
}
/* files belong to the same fs */
if (dev_id1 > dev_id2) {
return -1;
} else if (dev_id1 < dev_id2) {
return 1;
} else if (ino_id1 < ino_id2) {
return -1;
} else if (ino_id1 > ino_id2) {
return 1;
}
size1 = iso_stream_get_size(f1->stream);
size2 = iso_stream_get_size(f2->stream);
if (size1 < size2) {
return -1;
} else if (size1 > size2) {
return 1;
}
return 0;
}
int iso_file_src_create(Ecma119Image *img, IsoFile *file, IsoFileSrc **src)