X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fdentry.h;h=58adb5e681a9022b599be911d90219097d96f4a9;hp=28fdeaf27207570ac52cabaa0addaa219458e222;hb=143db75c035e6ecaca451ce70a4ed58a01102b43;hpb=13c6ce3160fce7c40008d1d182325c8b42450d1e diff --git a/src/dentry.h b/src/dentry.h index 28fdeaf2..58adb5e6 100644 --- a/src/dentry.h +++ b/src/dentry.h @@ -78,14 +78,16 @@ struct wim_ads_entry { * terminating null character. */ u16 stream_name_nbytes; - /* Stream name (UTF-16LE) */ - utf16lechar *stream_name; - -#ifdef WITH_FUSE /* Number to identify an alternate data stream even after it's possibly * been moved or renamed. */ u32 stream_id; -#endif + + /* Stream name (UTF-16LE) */ + utf16lechar *stream_name; + + /* Unused field. We read it into memory so we can write it out + * unchanged. */ + u64 unused; }; @@ -230,12 +232,26 @@ struct wim_inode { /* %true iff verify_inode() has run on this inode. */ u8 i_verified : 1; + u8 i_visited : 1; + /* Used only in NTFS-mode extraction */ u8 i_dos_name_extracted : 1; + /* Set to 0 if reparse point fixups have been done. Otherwise set to 1. + * + * Note: this actually may reflect the SYMBOLIC_LINK_RELATIVE flag. */ + u16 i_not_rpfixed; + /* Number of alternate data streams associated with this inode */ u16 i_num_ads; + /* Unused/unknown fields that we just read into memory so we can + * re-write them unchanged. */ + u64 i_unused_1; + u64 i_unused_2; + u32 i_rp_unknown_1; + u16 i_rp_unknown_2; + /* A hash of the file's contents, or a pointer to the lookup table entry * for this dentry if the lookup table entries have been resolved. * @@ -265,7 +281,10 @@ struct wim_inode { * link_count of them) */ struct list_head i_dentry; - struct hlist_node i_hlist; + union { + struct hlist_node i_hlist; + struct list_head i_list; + }; union { /* Used during image extraction to build a list of inodes that @@ -283,15 +302,14 @@ struct wim_inode { * noted in the @attributes field.) */ struct rb_root i_children; + /* Next alternate data stream ID to be assigned */ + u32 i_next_stream_id; + #ifdef WITH_FUSE /* wimfs file descriptors table for the inode */ u16 i_num_opened_fds; u16 i_num_allocated_fds; struct wimfs_fd **i_fds; - - /* Next alternate data stream ID to be assigned */ - u32 i_next_stream_id; - /* This mutex protects the inode's file descriptors table during * read-only mounts. Read-write mounts are still restricted to 1 * thread. */ @@ -372,6 +390,9 @@ print_dentry(struct wim_dentry *dentry, void *lookup_table); extern int print_dentry_full_path(struct wim_dentry *entry, void *ignore); +extern int +calculate_dentry_tree_full_paths(struct wim_dentry *root); + extern tchar * dentry_full_path(struct wim_dentry *dentry); @@ -403,7 +424,7 @@ free_dentry_tree(struct wim_dentry *root, extern void unlink_dentry(struct wim_dentry *dentry); -extern bool +extern struct wim_dentry * dentry_add_child(struct wim_dentry * restrict parent, struct wim_dentry * restrict child); @@ -424,6 +445,10 @@ inode_add_ads_with_data(struct wim_inode *inode, const tchar *name, const void *value, size_t size, struct wim_lookup_table *lookup_table); +extern int +inode_set_unnamed_stream(struct wim_inode *inode, const void *data, size_t len, + struct wim_lookup_table *lookup_table); + extern void inode_remove_ads(struct wim_inode *inode, u16 idx, struct wim_lookup_table *lookup_table); @@ -436,7 +461,7 @@ inode_remove_ads(struct wim_inode *inode, u16 idx, #define WIMLIB_UNIX_DATA_TAG_UTF16LE_NBYTES (sizeof(WIMLIB_UNIX_DATA_TAG_UTF16LE) - 1) /* Format for special alternate data stream entries to store UNIX data for files - * and directories (see: WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) */ + * and directories (see: WIMLIB_ADD_FLAG_UNIX_DATA) */ struct wimlib_unix_data { u16 version; /* Must be 0 */ u16 uid; @@ -500,8 +525,8 @@ static inline bool inode_is_symlink(const struct wim_inode *inode) { return (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) - && ((inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK) || - inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT); + && (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK || + inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT); } static inline bool