X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filelock.c;h=6e84970fc0064cafaeb0945befd5f4355fd9cf7b;hp=b1130071ea982ad38e7277ec6c0b7886f4c84bf2;hb=bf208c632815fac94c61abf338506a5a31e45a4d;hpb=3d0e3417997d9caa27cf97462e15ba437d285d29 diff --git a/filelock.c b/filelock.c index b1130071..6e84970f 100644 --- a/filelock.c +++ b/filelock.c @@ -165,7 +165,7 @@ static struct fio_filelock *fio_hash_get(uint32_t hash, int trylock) 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; @@ -180,16 +180,16 @@ static int __fio_lock_file(const char *fname, int trylock) 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); @@ -206,13 +206,13 @@ static int __fio_lock_file(const char *fname, int trylock) 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); }