X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filehash.c;h=0d61f54cca0b2f8c526cd639f9749716069aa8ff;hp=392464e2ba61dd2f04caccba893ec5b0c17794cd;hb=17d4fb1d58fe3ab738a1b65fbea91e68edd822b0;hpb=521da527743088a9bd2ab882f8b64799d49d5848 diff --git a/filehash.c b/filehash.c index 392464e2..0d61f54c 100644 --- a/filehash.c +++ b/filehash.c @@ -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) @@ -18,6 +19,18 @@ static unsigned short hash(const char *name) return jhash(name, strlen(name), 0) & HASH_MASK; } +void fio_file_hash_lock(void) +{ + if (hash_lock) + fio_mutex_down(hash_lock); +} + +void fio_file_hash_unlock(void) +{ + if (hash_lock) + fio_mutex_up(hash_lock); +} + void remove_file_hash(struct fio_file *f) { fio_mutex_down(hash_lock);