X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fdentry.h;h=1629111d83d1ccc5d662436aef09e7f0a2d00e98;hb=8244af933d579b3dcd6245a6995d96a86e5ab322;hp=6a3affcdb56a66d0ae82b0466b6a1a28a239c21c;hpb=276f9f9f9658f4a8bafd6216db46760abe8c848d;p=wimlib diff --git a/src/dentry.h b/src/dentry.h index 6a3affcd..1629111d 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; }; @@ -142,9 +144,10 @@ struct wim_dentry { u16 file_name_nbytes; /* Length of full path name encoded using "tchars", in bytes, not - * including the terminating null terminator. */ + * including the terminating null character. */ u32 full_path_nbytes; + /* Has this dentry been extracted yet? */ u8 is_extracted : 1; /* Only used during NTFS capture */ @@ -185,10 +188,6 @@ struct wim_dentry { * points. */ u64 subdir_offset; - /* Number of references to the dentry tree itself, as in multiple - * WIMStructs */ - u32 refcnt; - /* Pointer to the UTF-16LE short filename (malloc()ed buffer) */ utf16lechar *short_name; @@ -196,7 +195,7 @@ struct wim_dentry { utf16lechar *file_name; /* Full path of this dentry */ - tchar *full_path; + tchar *_full_path; }; #define rbnode_dentry(node) container_of(node, struct wim_dentry, rb_node) @@ -236,9 +235,21 @@ struct wim_inode { /* 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. * @@ -268,9 +279,19 @@ 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; + }; - struct list_head i_lte_inode_list; + union { + /* Used during image extraction to build a list of inodes that + * share a certain stream */ + struct list_head i_lte_inode_list; + + /* Device number, used only during image capture */ + u64 i_devno; + }; tchar *i_extracted_file; @@ -279,15 +300,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. */ @@ -338,9 +358,6 @@ for_dentry_in_tree_depth(struct wim_dentry *root, int (*visitor)(struct wim_dentry*, void*), void *args); -extern int -calculate_dentry_full_path(struct wim_dentry *dentry, void *ignore); - extern void calculate_subdir_offsets(struct wim_dentry *dentry, u64 *subdir_offset_p); @@ -371,6 +388,15 @@ 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); + +extern struct wim_inode * +new_timeless_inode(); + extern int new_dentry(const tchar *name, struct wim_dentry **dentry_ret); @@ -393,13 +419,10 @@ extern void free_dentry_tree(struct wim_dentry *root, struct wim_lookup_table *lookup_table); -extern int -increment_dentry_refcnt(struct wim_dentry *dentry, void *ignore); - 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); @@ -420,6 +443,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); @@ -496,8 +523,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