Rework lockfile= file lock handling

Get rid of the hand rolled rw semaphores, just use pthread
rwlocks instead. Kill the batching too, it was broken by
default, so nobody could have been using it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/smalloc.c b/smalloc.c
index b017373..5dae7e7 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -52,7 +52,7 @@
 static struct pool mp[MAX_POOLS];
 static unsigned int nr_pools;
 static unsigned int last_pool;
-static struct fio_mutex *lock;
+static struct fio_rwlock *lock;
 
 static inline void pool_lock(struct pool *pool)
 {
@@ -66,22 +66,22 @@
 
 static inline void global_read_lock(void)
 {
-	fio_mutex_down_read(lock);
+	fio_rwlock_read(lock);
 }
 
 static inline void global_read_unlock(void)
 {
-	fio_mutex_up_read(lock);
+	fio_rwlock_unlock(lock);
 }
 
 static inline void global_write_lock(void)
 {
-	fio_mutex_down_write(lock);
+	fio_rwlock_write(lock);
 }
 
 static inline void global_write_unlock(void)
 {
-	fio_mutex_up_write(lock);
+	fio_rwlock_unlock(lock);
 }
 
 static inline int ptr_valid(struct pool *pool, void *ptr)
@@ -223,7 +223,7 @@
 {
 	int ret;
 
-	lock = fio_mutex_rw_init();
+	lock = fio_rwlock_init();
 	ret = add_pool(&mp[0], INITIAL_SIZE);
 	assert(!ret);
 }
@@ -248,7 +248,7 @@
 		cleanup_pool(&mp[i]);
 
 	if (lock)
-		fio_mutex_remove(lock);
+		fio_rwlock_remove(lock);
 }
 
 #ifdef SMALLOC_REDZONE