aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-19 11:16:02 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-04-19 11:18:07 +0200
commita872319cab2f56f207c39d6fd436741e661b809a (patch)
treead4c72d1a62a939cce7a0752bffec2faa45af387
parente1e655b02f6c54177f9070eeb221ab95c6d4e20f (diff)
libfstree: Remove external file_info_t declaration
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--bin/tar2sqfs/src/process_tarball.c8
-rw-r--r--include/fstree.h25
2 files changed, 15 insertions, 18 deletions
diff --git a/bin/tar2sqfs/src/process_tarball.c b/bin/tar2sqfs/src/process_tarball.c
index 94ee71c..2ba018d 100644
--- a/bin/tar2sqfs/src/process_tarball.c
+++ b/bin/tar2sqfs/src/process_tarball.c
@@ -7,7 +7,7 @@
#include "tar2sqfs.h"
static int write_file(istream_t *input_file, sqfs_writer_t *sqfs,
- const tar_header_decoded_t *hdr, file_info_t *fi)
+ const tar_header_decoded_t *hdr, tree_node_t *n)
{
int flags = 0, ret = 0;
ostream_t *out;
@@ -16,8 +16,8 @@ static int write_file(istream_t *input_file, sqfs_writer_t *sqfs,
if (no_tail_pack && hdr->actual_size > cfg.block_size)
flags |= SQFS_BLK_DONT_FRAGMENT;
- out = data_writer_ostream_create(hdr->name, sqfs->data, &fi->inode,
- flags);
+ out = data_writer_ostream_create(hdr->name, sqfs->data,
+ &(n->data.file.inode), flags);
if (out == NULL)
return -1;
@@ -126,7 +126,7 @@ static int create_node_and_repack_data(istream_t *input_file,
}
if (S_ISREG(hdr->mode)) {
- if (write_file(input_file, sqfs, hdr, &node->data.file))
+ if (write_file(input_file, sqfs, hdr, node))
return -1;
}
diff --git a/include/fstree.h b/include/fstree.h
index 044bb48..1d427a4 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -23,7 +23,6 @@
typedef struct fstree_defaults_t fstree_defaults_t;
typedef struct tree_node_t tree_node_t;
-typedef struct file_info_t file_info_t;
typedef struct fstree_t fstree_t;
enum {
@@ -31,18 +30,6 @@ enum {
FLAG_FILE_ALREADY_MATCHED = 0x02,
};
-/* Additional meta data stored in a tree_node_t for regular files. */
-struct file_info_t {
- /* Path to the input file. */
- char *input_file;
-
- sqfs_inode_generic_t *inode;
-
- /* used by sort file processing */
- sqfs_s64 priority;
- int flags;
-};
-
/* A node in a file system tree */
struct tree_node_t {
tree_node_t *next_by_type;
@@ -74,8 +61,18 @@ struct tree_node_t {
/* Type specific data. "target" pointer is into payload area below. */
union {
+ struct {
+ /* Path to the input file. */
+ char *input_file;
+
+ sqfs_inode_generic_t *inode;
+
+ /* used by sort file processing */
+ sqfs_s64 priority;
+ int flags;
+ } file;
+
tree_node_t *children;
- file_info_t file;
char *target;
sqfs_u64 devno;
tree_node_t *target_node;