stat: check if ctime_r() ends in a newline before stripping
[fio.git] / filehash.c
index 2d9659c5039a0e46cb79db758dcd694bc9d9971c..0d61f54cca0b2f8c526cd639f9749716069aa8ff 100644 (file)
@@ -4,6 +4,7 @@
 #include "fio.h"
 #include "flist.h"
 #include "hash.h"
+#include "filehash.h"
 
 #define HASH_BUCKETS   512
 #define HASH_MASK      (HASH_BUCKETS - 1)
@@ -20,12 +21,14 @@ static unsigned short hash(const char *name)
 
 void fio_file_hash_lock(void)
 {
-       fio_mutex_down(hash_lock);
+       if (hash_lock)
+               fio_mutex_down(hash_lock);
 }
 
 void fio_file_hash_unlock(void)
 {
-       fio_mutex_up(hash_lock);
+       if (hash_lock)
+               fio_mutex_up(hash_lock);
 }
 
 void remove_file_hash(struct fio_file *f)