mutex: add __fio_mutex_remove()
We have to remember to free the condvar, so add a __fio_mutex_remove()
for cases that init a mutex inside an smalloc'ed region with
__fio_mutex_init().
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/filelock.c b/filelock.c
index b252a97..18e8875 100644
--- a/filelock.c
+++ b/filelock.c
@@ -144,10 +144,11 @@
ff = fio_hash_find(hash);
if (ff) {
- ff->references--;
+ int refs = --ff->references;
fio_mutex_up(&ff->lock);
- if (!ff->references) {
+ if (!refs) {
flist_del(&ff->list);
+ __fio_mutex_remove(&ff->lock);
sfree(ff);
}
} else