]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.c
extract_wim_resource_to_fd(): Handle full_write() retval correctly
[wimlib] / src / lookup_table.c
index d23d21c3c9372795f4fd145d1f8fe17cffcb99c1..57bbc0c63d9bb1c116f7a6147cd55d1129d1a37b 100644 (file)
@@ -158,8 +158,8 @@ static void finalize_lte(struct lookup_table_entry *lte)
  * reference count reaches 0, it is unlinked from the lookup table.  If,
  * furthermore, the entry has no opened file descriptors associated with it, the
  * entry is freed.  */
-struct lookup_table_entry *
-lte_decrement_refcnt(struct lookup_table_entry *lte, struct lookup_table *table)
+void lte_decrement_refcnt(struct lookup_table_entry *lte,
+                         struct lookup_table *table)
 {
        wimlib_assert(lte);
        wimlib_assert(lte->refcnt);
@@ -168,28 +168,18 @@ lte_decrement_refcnt(struct lookup_table_entry *lte, struct lookup_table *table)
        #ifdef WITH_FUSE
                if (lte->num_opened_fds == 0)
        #endif
-               {
                        finalize_lte(lte);
-                       lte = NULL;
-               }
        }
-       return lte;
 }
 
 #ifdef WITH_FUSE
-struct lookup_table_entry *
-lte_decrement_num_opened_fds(struct lookup_table_entry *lte,
-                            struct lookup_table *table)
+void lte_decrement_num_opened_fds(struct lookup_table_entry *lte,
+                                 struct lookup_table *table)
 {
-       if (lte) {
-               wimlib_assert(lte->num_opened_fds);
-               if (--lte->num_opened_fds == 0 && lte->refcnt == 0) {
-                       lookup_table_unlink(table, lte);
-                       finalize_lte(lte);
-                       lte = NULL;
-               }
-       }
-       return lte;
+       wimlib_assert(lte);
+       wimlib_assert(lte->num_opened_fds);
+       if (--lte->num_opened_fds == 0 && lte->refcnt == 0)
+               finalize_lte(lte);
 }
 #endif
 
@@ -570,8 +560,8 @@ int dentry_resolve_ltes(struct dentry *dentry, void *table)
  * data stream in one of the alternate data streams instead of inside the WIM
  * dentry itself.  So we need to check the alternate data streams too.
  *
- * Also, note that a dentry may appear to have than one unnamed stream, but if
- * the SHA1 message digest is all 0's then the corresponding stream does not
+ * Also, note that a dentry may appear to have more than one unnamed stream, but
+ * if the SHA1 message digest is all 0's then the corresponding stream does not
  * really "count" (this is the case for the inode's own file stream when the
  * file stream that should be there is actually in one of the alternate stream
  * entries.).  This is despite the fact that we may need to extract such a