From 4353a35c59257105eaab0c64e98348495a0fb715 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 30 May 2009 16:36:54 +0200 Subject: [PATCH] Removed some development remarks --- libisofs/ecma119.c | 4 ++++ libisofs/ecma119.h | 4 ++++ libisofs/ecma119_tree.c | 31 +++++++++++++++++++------------ libisofs/ecma119_tree.h | 2 -- libisofs/fs_image.c | 5 ----- libisofs/libisofs.h | 4 ++-- libisofs/node.c | 4 ++-- libisofs/stream.c | 11 ++++++++++- 8 files changed, 41 insertions(+), 24 deletions(-) diff --git a/libisofs/ecma119.c b/libisofs/ecma119.c index 9c005b1..f33b498 100644 --- a/libisofs/ecma119.c +++ b/libisofs/ecma119.c @@ -890,7 +890,11 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img) target->hardlinks = opts->hardlinks; target->aaip = opts->aaip; target->always_gmt = opts->always_gmt; + +#ifndef Libisofs_hardlink_matcheR target->ino = 0; +#endif + target->omit_version_numbers = opts->omit_version_numbers | opts->max_37_char_filenames; target->allow_deep_paths = opts->allow_deep_paths; diff --git a/libisofs/ecma119.h b/libisofs/ecma119.h index 9b28ac9..80b1b52 100644 --- a/libisofs/ecma119.h +++ b/libisofs/ecma119.h @@ -334,6 +334,8 @@ struct ecma119_image int sort_files; +#ifndef Libisofs_hardlink_matcheR + /* ts A90508 : <<< this is on its way out */ /** * In the CD, each file must have an unique inode number. So each @@ -341,6 +343,8 @@ struct ecma119_image */ ino_t ino; +#endif /* ! Libisofs_hardlink_matcheR */ + char *input_charset; char *output_charset; diff --git a/libisofs/ecma119_tree.c b/libisofs/ecma119_tree.c index 426e43a..3d4c712 100644 --- a/libisofs/ecma119_tree.c +++ b/libisofs/ecma119_tree.c @@ -95,10 +95,7 @@ int get_iso_name(Ecma119Image *img, IsoNode *iso, char **name) static int create_ecma119_node(Ecma119Image *img, IsoNode *iso, Ecma119Node **node) { - int ret; Ecma119Node *ecma; - unsigned int fs_id; - dev_t dev_id; ecma = calloc(1, sizeof(Ecma119Node)); if (ecma == NULL) { @@ -109,28 +106,38 @@ int create_ecma119_node(Ecma119Image *img, IsoNode *iso, Ecma119Node **node) ecma->node = iso; iso_node_ref(iso); - /* TODO #00009 : add true support for harlinks and inode numbers */ ecma->nlink = 1; +#ifndef Libisofs_hardlink_matcheR + + /* ts A90503 : This is obsolete with Libisofs_hardlink_matcheR + which will later hand out image inode numbers for all. */ + #ifdef Libisofs_hardlink_prooF - /* >>> ts A90503 : this is obsolete with Libisofs_hardlink_matcheR */ - /*ts A90428 */ /* Looking only for valid ISO image inode numbers. */ - ret = iso_node_get_id(iso, &fs_id, &dev_id, &(ecma->ino), 1); - if (ret < 0) { - return ret; - } else if (ret == 0) { - /* What has not got a valid ISO image inode yet, gets it now. */ - ecma->ino = img_give_ino_number(img->image, 0); + { + unsigned int fs_id; + dev_t dev_id; + int ret; + + ret = iso_node_get_id(iso, &fs_id, &dev_id, &(ecma->ino), 1); + if (ret < 0) { + return ret; + } else if (ret == 0) { + /* What has not got a valid ISO image inode yet, gets it now. */ + ecma->ino = img_give_ino_number(img->image, 0); + } } #else /* Libisofs_hardlink_prooF */ + /* TODO #00009 : add true support for harlinks and inode numbers */ ecma->ino = ++img->ino; #endif /* ! Libisofs_hardlink_prooF */ +#endif /* ! Libisofs_hardlink_matcheR */ *node = ecma; return ISO_SUCCESS; diff --git a/libisofs/ecma119_tree.h b/libisofs/ecma119_tree.h index f1ba0a4..aaef485 100644 --- a/libisofs/ecma119_tree.h +++ b/libisofs/ecma119_tree.h @@ -62,8 +62,6 @@ struct ecma119_node IsoNode *node; /*< reference to the iso node */ - /* TODO #00009 : add true support for harlinks and inode numbers */ - /* >>> ts A90501 : Shouldn't this be uint32_t as this is what PX will take ? */ ino_t ino; diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index 8f60e3c..6e503ac 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -1642,11 +1642,6 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent, ifsdata = (ImageFileSourceData*) (*src)->data; ifsdata->name = name; - /* >>> ts A90427 : What about final treatment ? - How does directory relocation relate to inode - numbers and hard links ? - */ - return ISO_SUCCESS; } diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 2c94522..352ccb8 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -5447,9 +5447,9 @@ struct burn_source { /* Experiment: Ignore PX inode numbers, have boot image inode number counted by fs_give_ino_number() - <<< Overridden if Libisofs_hardlink_prooF is defined. + Overridden if Libisofs_hardlink_prooF is defined. + #define Libisofs_new_fs_image_inO yes */ -#define Libisofs_new_fs_image_inO yes /* Experiment: Write obsolete RR entries with Rock Ridge. diff --git a/libisofs/node.c b/libisofs/node.c index 487d4af..019125e 100644 --- a/libisofs/node.c +++ b/libisofs/node.c @@ -2254,7 +2254,7 @@ int iso_node_zf_by_magic(IsoNode *node, int flag) } -/* <<< ts A90427 : to some other source module ? In what .h ? */ +/* ts A90427 */ int iso_px_ino_xinfo_func(void *data, int flag) { if (flag == 1) { @@ -2555,7 +2555,7 @@ image_inode_match:; if (n1->ctime != n2->ctime) return (n1->ctime < n2->ctime ? -1 : 1); - /* >>> compare xinfo */; + /* Compare xinfo */ /* :( cannot compare general xinfo because data length is not known :( */ /* compare aa_string */ diff --git a/libisofs/stream.c b/libisofs/stream.c index c2f5187..b9584e1 100644 --- a/libisofs/stream.c +++ b/libisofs/stream.c @@ -739,9 +739,14 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag) off_t size1, size2; FSrcStreamData *fssd1, *fssd2; - /* <<< */ + +/* <<< + #define Libisofs_stream_cmp_ino_debuG 1 +*/ +#ifdef Libisofs_stream_cmp_ino_debuG static int report_counter = 0; static int debug = 1; +#endif /* Libisofs_stream_cmp_ino_debuG */ if (s1 == s2) return 0; @@ -777,6 +782,7 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag) size2 = iso_stream_get_size(s2); if (size1 < size2) { +#ifdef Libisofs_stream_cmp_ino_debuG if (debug) { if (report_counter < 5) fprintf(stderr, @@ -786,10 +792,12 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag) "\n\nlibisofs_DEBUG : Inode error: more of same ino but differing size\n\n\n"); report_counter++; } +#endif /* Libisofs_stream_cmp_ino_debuG */ return -1; } else if (size1 > size2) { +#ifdef Libisofs_stream_cmp_ino_debuG if (debug) { if (report_counter < 5) fprintf(stderr, @@ -799,6 +807,7 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag) "\n\nlibisofs_DEBUG : Program error: more of same ino but differing size\n\n\n"); report_counter++; } +#endif /* Libisofs_stream_cmp_ino_debuG */ return 1; }