projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mmap: don't include MADV_FREE in fadvise_hint check
[fio.git]
/
filelock.c
diff --git
a/filelock.c
b/filelock.c
index 17b5a85aa4559e1a20c864a1106e18f4baf58c9c..6e84970fc0064cafaeb0945befd5f4355fd9cf7b 100644
(file)
--- a/
filelock.c
+++ b/
filelock.c
@@
-101,7
+101,7
@@
void fio_filelock_exit(void)
return;
assert(flist_empty(&fld->list));
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;
while (!flist_empty(&fld->free_list)) {
struct fio_filelock *ff;
@@
-109,7
+109,7
@@
void fio_filelock_exit(void)
ff = flist_first_entry(&fld->free_list, struct fio_filelock, list);
flist_del_init(&ff->list);
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);
}
sfree(fld);
@@
-165,7
+165,7
@@
static struct fio_filelock *fio_hash_get(uint32_t hash, int trylock)
return ff;
}
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;
{
struct fio_filelock *ff;
uint32_t hash;
@@
-180,16
+180,16
@@
static int __fio_lock_file(const char *fname, int trylock)
if (!ff) {
assert(!trylock);
if (!ff) {
assert(!trylock);
- return
1
;
+ return
true
;
}
if (!trylock) {
fio_mutex_down(&ff->lock);
}
if (!trylock) {
fio_mutex_down(&ff->lock);
- return
0
;
+ return
false
;
}
if (!fio_mutex_down_trylock(&ff->lock))
}
if (!fio_mutex_down_trylock(&ff->lock))
- return
0
;
+ return
false
;
fio_mutex_down(&fld->lock);
fio_mutex_down(&fld->lock);
@@
-206,13
+206,13
@@
static int __fio_lock_file(const char *fname, int trylock)
if (ff) {
fio_mutex_down(&ff->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);
}
{
return __fio_lock_file(fname, 1);
}