]> wimlib.net Git - wimlib/blobdiff - src/inode.c
Factor out inode_unref_streams()
[wimlib] / src / inode.c
index 34508659fa6724d56142552960a659df273a69ea..e2f291631a043048273daf47fd1a958dc4209a2e 100644 (file)
@@ -798,8 +798,6 @@ out:
 int
 verify_inode(struct wim_inode *inode, const struct wim_security_data *sd)
 {
-       struct wim_dentry *dentry;
-
        /* Check the security ID.  -1 is valid and means "no security
         * descriptor".  Anything else has to be a valid index into the WIM
         * image's security descriptors table. */
@@ -839,6 +837,20 @@ inode_ref_streams(struct wim_inode *inode)
        }
 }
 
+void
+inode_unref_streams(struct wim_inode *inode,
+                   struct wim_lookup_table *lookup_table)
+{
+       struct wim_lookup_table_entry *lte;
+       unsigned i;
+
+       for (i = 0; i <= inode->i_num_ads; i++) {
+               lte = inode_stream_lte(inode, i, lookup_table);
+               if (lte)
+                       lte_decrement_refcnt(lte, lookup_table);
+       }
+}
+
 int
 init_inode_table(struct wim_inode_table *table, size_t capacity)
 {