Add rw mutex init helper
authorJens Axboe <jens.axboe@oracle.com>
Mon, 3 Mar 2008 10:08:19 +0000 (11:08 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 3 Mar 2008 10:08:19 +0000 (11:08 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
mutex.h
smalloc.c

diff --git a/mutex.h b/mutex.h
index 74515936e759f504e98399c71d51ef8e0823c8e6..40cfc1ede75430c542b0b1fc5b2d17cacfbff5e4 100644 (file)
--- a/mutex.h
+++ b/mutex.h
@@ -20,4 +20,9 @@ extern void fio_mutex_up(struct fio_mutex *);
 extern void fio_mutex_up_read(struct fio_mutex *);
 extern void fio_mutex_up_write(struct fio_mutex *);
 
 extern void fio_mutex_up_read(struct fio_mutex *);
 extern void fio_mutex_up_write(struct fio_mutex *);
 
+static inline struct fio_mutex *fio_mutex_rw_init(void)
+{
+       return fio_mutex_init(0);
+}
+
 #endif
 #endif
index e6f89b2dd94824f6fe0432825c625d9d00c44ffd..9a7c25bf058899449109a5f1f15792db08738fbf 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -271,7 +271,7 @@ void sinit(void)
        int ret = add_pool(&mp[0]);
 
 #ifdef MP_SAFE
        int ret = add_pool(&mp[0]);
 
 #ifdef MP_SAFE
-       lock = fio_mutex_init(1);
+       lock = fio_mutex_rw_init();
 #endif
        assert(!ret);
 }
 #endif
        assert(!ret);
 }