output_buffer: only realloc once, and memset just what we need
[fio.git] / filehash.c
index c6ebe761282edd5ef645042c2bbed7f8ff98792c..0d61f54cca0b2f8c526cd639f9749716069aa8ff 100644 (file)
@@ -21,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)