]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.c
Use FUSE multi-threaded mode for read-only mounts
[wimlib] / src / lookup_table.c
index e22bd4ed9bd6e6ab9cd893f41c2cb6ed3f66f755..36d2d13f69430518dcdafbf59b2649a75af25152 100644 (file)
@@ -219,8 +219,8 @@ static void finalize_lte(struct lookup_table_entry *lte)
 void lte_decrement_refcnt(struct lookup_table_entry *lte,
                          struct lookup_table *table)
 {
-       wimlib_assert(lte);
-       wimlib_assert(lte->refcnt);
+       wimlib_assert(lte != NULL);
+       wimlib_assert(lte->refcnt != 0);
        if (--lte->refcnt == 0) {
                lookup_table_unlink(table, lte);
        #ifdef WITH_FUSE
@@ -233,9 +233,9 @@ void lte_decrement_refcnt(struct lookup_table_entry *lte,
 #ifdef WITH_FUSE
 void lte_decrement_num_opened_fds(struct lookup_table_entry *lte)
 {
-       wimlib_assert(lte);
-       wimlib_assert(lte->num_opened_fds);
-       if (--lte->num_opened_fds == 0 && lte->refcnt == 0)
+       wimlib_assert(lte != NULL);
+       wimlib_assert(lte->num_opened_fds != 0);
+       if (atomic_dec(&lte->num_opened_fds) == 0 && lte->refcnt == 0)
                finalize_lte(lte);
 }
 #endif