Made development macro Libisofs_hardlink_matcheR unconditional

and removed an unused variable.
release-1.5.4.branch
Thomas Schmitt 13 years ago
parent 3f918d1acb
commit b1c4571a95
  1. 7
      libisofs/ecma119.c
  2. 12
      libisofs/ecma119.h
  3. 37
      libisofs/ecma119_tree.c
  4. 8
      libisofs/fs_image.c
  5. 14
      libisofs/libisofs.h
  6. 20
      libisofs/node.c
  7. 6
      libisofs/node.h
  8. 4
      libisofs/stream.c

@ -965,7 +965,7 @@ int checksum_prepare_nodes(Ecma119Image *target, IsoNode *node, int flag)
int ret, i, no_md5 = 0, has_xinfo = 0;
size_t value_length;
unsigned int idx = 0;
char *value= NULL, *direct_md5;
char *value= NULL;
void *xipt = NULL;
static char *cx_names = "isofs.cx";
static size_t cx_value_lengths[1] = {0};
@ -1065,11 +1065,6 @@ 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;

@ -364,18 +364,6 @@ 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
* time we add a new file, this is incremented.
*/
ino_t ino;
#endif /* ! Libisofs_hardlink_matcheR */
char *input_charset;
char *output_charset;

@ -103,42 +103,9 @@ int create_ecma119_node(Ecma119Image *img, IsoNode *iso, Ecma119Node **node)
return ISO_OUT_OF_MEM;
}
/* take a ref to the IsoNode */
ecma->node = iso;
iso_node_ref(iso);
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
/* Looking only for valid ISO image inode numbers. */
{
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;
}
@ -1023,16 +990,12 @@ int ecma119_tree_create(Ecma119Image *img)
}
img->root = root;
#ifdef Libisofs_hardlink_matcheR
iso_msg_debug(img->image->id, "Matching hardlinks...");
ret = match_hardlinks(img, img->root, 0);
if (ret < 0) {
return ret;
}
#endif /* ! Libisofs_hardlink_matcheR */
iso_msg_debug(img->image->id, "Sorting the low level tree...");
sort_tree(root);

@ -2815,13 +2815,9 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
}
link->dest = strdup(dest);
link->node.type = LIBISO_SYMLINK;
#ifdef Libisofs_hardlink_matcheR
link->fs_id = ISO_IMAGE_FS_ID;
link->st_dev = info.st_dev;
link->st_ino = info.st_ino;
#endif
new = (IsoNode*) link;
new->refcount = 0;
}
@ -2840,13 +2836,9 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
}
special->dev = info.st_rdev;
special->node.type = LIBISO_SPECIAL;
#ifdef Libisofs_hardlink_matcheR
special->fs_id = ISO_IMAGE_FS_ID;
special->st_dev = info.st_dev;
special->st_ino = info.st_ino;
#endif
new = (IsoNode*) special;
new->refcount = 0;
}

@ -5730,20 +5730,6 @@ struct burn_source {
/* ---------------------------- Improvements --------------------------- */
/* Hardlinks : During image generation accompany the tree of IsoFileSrc
by a sorted array of Ecma119Node.
The sorting order shall bring together candidates for being
hardlink siblings resp. having identical content.
This is in sync with the IsoFileSrc unification by IsoRBTree
and iso_file_src_cmp().
That tree cannot be obsoleted because Joliet and ISO1999 depend
on it. On the other hand, the Ecma119Node array includes objects
which have no IsoFileSrc attached. So both, tree and array, are
needed.
*/
#define Libisofs_hardlink_matcheR yes
/* Hardlinks : Override Libisofs_new_fs_image_inO and preserve inode numbers
from session to session.

@ -1310,13 +1310,9 @@ int iso_node_new_symlink(char *name, char *dest, IsoSymlink **link)
new->node.name = name;
new->dest = dest;
new->node.mode = S_IFLNK;
#ifdef Libisofs_hardlink_matcheR
new->fs_id = 0;
new->st_dev = 0;
new->st_ino = 0;
#endif
*link = new;
return ISO_SUCCESS;
}
@ -1348,13 +1344,9 @@ int iso_node_new_special(char *name, mode_t mode, dev_t dev,
new->node.mode = mode;
new->dev = dev;
#ifdef Libisofs_hardlink_matcheR
new->fs_id = 0;
new->st_dev = 0;
new->st_ino = 0;
#endif
*special = new;
return ISO_SUCCESS;
}
@ -2301,8 +2293,6 @@ int iso_node_get_id(IsoNode *node, unsigned int *fs_id, dev_t *dev_id,
}
return 1;
#ifdef Libisofs_hardlink_matcheR
} else if (node->type == LIBISO_SYMLINK) {
symlink = (IsoSymlink *) node;
if (symlink->fs_id != ISO_IMAGE_FS_ID && (flag & 1)) {
@ -2325,8 +2315,6 @@ int iso_node_get_id(IsoNode *node, unsigned int *fs_id, dev_t *dev_id,
*ino_id = special->st_ino;
return 1;
#endif
}
ret = 0;
@ -2381,8 +2369,6 @@ int iso_node_set_ino(IsoNode *node, ino_t ino, int flag)
if (ret < 0 || ret == 1)
return ret;
#ifdef Libisofs_hardlink_matcheR
} else if (node->type == LIBISO_SYMLINK) {
symlink = (IsoSymlink *) node;
if (symlink->fs_id == ISO_IMAGE_FS_ID) {
@ -2397,8 +2383,6 @@ int iso_node_set_ino(IsoNode *node, ino_t ino, int flag)
return 1;
}
#endif
}
ret = iso_node_set_ino_xinfo(node, ino, 0);
if (ret < 0)
@ -2473,8 +2457,6 @@ int iso_node_cmp_flag(IsoNode *n1, IsoNode *n2, int flag)
return ret1;
goto inode_match;
#ifdef Libisofs_hardlink_matcheR
} else if (n1->type == LIBISO_SYMLINK) {
l1 = (IsoSymlink *) n1;
@ -2497,8 +2479,6 @@ int iso_node_cmp_flag(IsoNode *n1, IsoNode *n2, int flag)
dev_id2 = s2->st_dev;
ino_id2 = s2->st_ino;
#endif /* Libisofs_hardlink_matcheR */
} else {
return (n1 < n2 ? -1 : 1); /* case n1 == n2 is handled above */
}

@ -132,7 +132,6 @@ struct Iso_Symlink
char *dest;
#ifdef Libisofs_hardlink_matcheR
/* If the IsoNode represents an object in an existing filesystem then
the following three numbers should unique identify it.
(0,0,0) will always be taken as unique.
@ -140,8 +139,6 @@ struct Iso_Symlink
unsigned int fs_id;
dev_t st_dev;
ino_t st_ino;
#endif
};
struct Iso_Special
@ -149,7 +146,6 @@ struct Iso_Special
IsoNode node;
dev_t dev;
#ifdef Libisofs_hardlink_matcheR
/* If the IsoNode represents an object in an existing filesystem then
the following three numbers should unique identify it.
(0,0,0) will always be taken as unique.
@ -157,8 +153,6 @@ struct Iso_Special
unsigned int fs_id;
dev_t st_dev;
ino_t st_ino;
#endif
};
struct iso_dir_iter_iface

@ -821,13 +821,9 @@ int iso_stream_cmp_ino(IsoStream *s1, IsoStream *s2, int flag)
if (ret != 0)
return ret;
}
#ifdef Libisofs_hardlink_matcheR
if (fs_id1 == 0 && dev_id1 == 0 && ino_id1 == 0) {
return (s1 < s2 ? -1 : 1);
}
#endif
return 0;
}

Loading…
Cancel
Save