summaryrefslogtreecommitdiff
path: root/smalloc.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-03-04 10:18:56 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-03-04 10:18:56 +0100
commit4d4e80f2b4260f2c8b37a8612ce655502a799f7a (patch)
tree4eb7d5762a63cdacc390b51add1e524bd84f760c /smalloc.c
parent5f1348c709d91ffa54bde1a6a1beb53ecda613b7 (diff)
downloadfio-4d4e80f2b4260f2c8b37a8612ce655502a799f7a.tar.gz
Revamp file locking
Get rid of the semaphore implementation, no need to carry both. Add different locking modes (exclusive and readwrite) to enable a wider range of testing. Also combine lockfile and lockfile_batch, the latter is now a postfix option to the former. So to enable readers-excluding-writers locking mode with a lock batch count of 4, you would write: lockfile=readwrite:4 instead. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'smalloc.c')
-rw-r--r--smalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/smalloc.c b/smalloc.c
index 9a7c25bf..85da7811 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -268,11 +268,12 @@ out_close:
void sinit(void)
{
- int ret = add_pool(&mp[0]);
+ int ret;
#ifdef MP_SAFE
lock = fio_mutex_rw_init();
#endif
+ ret = add_pool(&mp[0]);
assert(!ret);
}