From f18d5157dca1b197ee5aa975e10a46e51e551381 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 1 May 2009 16:18:59 +0200 Subject: [PATCH] Caused image root to memorize its eventual PX inode number. --- libisofs/ecma119_tree.c | 10 +++------- libisofs/fs_image.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/libisofs/ecma119_tree.c b/libisofs/ecma119_tree.c index bbc9feb..7340739 100644 --- a/libisofs/ecma119_tree.c +++ b/libisofs/ecma119_tree.c @@ -112,19 +112,15 @@ int create_ecma119_node(Ecma119Image *img, IsoNode *iso, Ecma119Node **node) /* TODO #00009 : add true support for harlinks and inode numbers */ ecma->nlink = 1; - /* >>> One needs to find groups of nodes with identical id numbers - resp. with other reasons for being hard links. - This will replace the file source unifier by rbtree - in iso_file_src_create() and iso_file_src_add(). - */ - - /*ts A90428 */ #ifdef Libisofs_hardlink_prooF + /*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); } diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index 3537ab0..401c15a 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -3010,6 +3010,18 @@ int iso_image_import(IsoImage *image, IsoDataSource *src, if (ret < 0) goto import_revert; +#ifdef Libisofs_hardlink_prooF + + /* ts A90501 */ + /* Attach ino as xinfo if valid */ + if (ret > 0 && info.st_ino != 0 && !data->make_new_ino) { + ret = iso_node_set_ino(&(image->root->node), info.st_ino, 0); + if (ret < 0) + goto import_revert; + } + +#endif /* Libisofs_hardlink_prooF */ + } /* if old image has el-torito, add a new catalog */