return;
assert(flist_empty(&fld->list));
- fio_mutex_remove(&fld->lock);
+ __fio_mutex_remove(&fld->lock);
while (!flist_empty(&fld->free_list)) {
struct fio_filelock *ff;
ff = flist_first_entry(&fld->free_list, struct fio_filelock, list);
flist_del_init(&ff->list);
- fio_mutex_remove(&ff->lock);
+ __fio_mutex_remove(&ff->lock);
}
sfree(fld);
return ff;
}
-static int __fio_lock_file(const char *fname, int trylock)
+static bool __fio_lock_file(const char *fname, int trylock)
{
struct fio_filelock *ff;
uint32_t hash;
if (!ff) {
assert(!trylock);
- return 1;
+ return true;
}
if (!trylock) {
fio_mutex_down(&ff->lock);
- return 0;
+ return false;
}
if (!fio_mutex_down_trylock(&ff->lock))
- return 0;
+ return false;
fio_mutex_down(&fld->lock);
if (ff) {
fio_mutex_down(&ff->lock);
- return 0;
+ return false;
}
- return 1;
+ return true;
}
-int fio_trylock_file(const char *fname)
+bool fio_trylock_file(const char *fname)
{
return __fio_lock_file(fname, 1);
}