]> wimlib.net Git - wimlib/blobdiff - include/wimlib/inode.h
wimlib_wim_info: update docs for flag bits
[wimlib] / include / wimlib / inode.h
index 1818d10857eca684d5094f71c0ec6f2257e8f515..f516a1f89060bf411ac53b343ca7e96008a35b56 100644 (file)
@@ -121,19 +121,10 @@ struct wim_inode {
         * i_nlink dentries in this list.  */
        struct list_head i_dentry;
 
-       /* Field to place this inode into a list. */
-       union {
-               /* Hash list node- used in inode_fixup.c when the inodes are
-                * placed into a hash table keyed by inode number and optionally
-                * device number, in order to detect dentries that are aliases
-                * for the same inode. */
-               struct hlist_node i_hlist;
-
-               /* Normal list node- used to connect all the inodes of a WIM
-                * image into a single linked list referenced from the `struct
-                * wim_image_metadata' for that image. */
-               struct list_head i_list;
-       };
+       /* Field to place this inode into a list.  While reading a WIM image or
+        * adding files to a WIM image this is owned by the inode table;
+        * otherwise this links the inodes for the WIM image.  */
+       struct hlist_node i_hlist;
 
        /* Number of dentries that are aliases for this inode.  */
        u32 i_nlink;
@@ -346,11 +337,29 @@ inode_get_stream(const struct wim_inode *inode, int stream_type,
 extern struct wim_inode_stream *
 inode_get_unnamed_stream(const struct wim_inode *inode, int stream_type);
 
+static inline struct wim_inode_stream *
+inode_get_unnamed_data_stream(const struct wim_inode *inode)
+{
+       return inode_get_unnamed_stream(inode, STREAM_TYPE_DATA);
+}
+
 extern struct wim_inode_stream *
 inode_add_stream(struct wim_inode *inode, int stream_type,
                 const utf16lechar *stream_name, struct blob_descriptor *blob);
 
-extern struct wim_inode_stream *
+extern void
+inode_replace_stream_blob(struct wim_inode *inode,
+                         struct wim_inode_stream *strm,
+                         struct blob_descriptor *new_blob,
+                         struct blob_table *blob_table);
+
+extern bool
+inode_replace_stream_data(struct wim_inode *inode,
+                         struct wim_inode_stream *strm,
+                         const void *data, size_t size,
+                         struct blob_table *blob_table);
+
+extern bool
 inode_add_stream_with_data(struct wim_inode *inode, int stream_type,
                           const utf16lechar *stream_name,
                           const void *data, size_t size,
@@ -367,13 +376,6 @@ stream_blob_resolved(const struct wim_inode_stream *strm)
        return strm->_stream_blob;
 }
 
-static inline void
-stream_set_blob(struct wim_inode_stream *strm, struct blob_descriptor *blob)
-{
-       strm->_stream_blob = blob;
-       strm->stream_resolved = 1;
-}
-
 static inline bool
 stream_is_named(const struct wim_inode_stream *strm)
 {
@@ -399,9 +401,6 @@ extern int
 inode_resolve_streams(struct wim_inode *inode,
                      struct blob_table *table, bool force);
 
-extern void
-inode_unresolve_streams(struct wim_inode *inode);
-
 extern int
 blob_not_found_error(const struct wim_inode *inode, const u8 *hash);
 
@@ -429,6 +428,6 @@ inode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table);
 
 /* inode_fixup.c  */
 extern int
-dentry_tree_fix_inodes(struct wim_dentry *root, struct list_head *inode_list);
+dentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list);
 
 #endif /* _WIMLIB_INODE_H  */