lkml.org 
[lkml]   [2010]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectjbd2: Convert jbd2_slab_create_sem to mutex
jbd2_slab_create_sem is used as a mutex, so make it one.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
fs/jbd2/journal.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-next/fs/jbd2/journal.c
===================================================================
--- linux-next.orig/fs/jbd2/journal.c
+++ linux-next/fs/jbd2/journal.c
@@ -1838,7 +1838,7 @@ size_t journal_tag_bytes(journal_t *jour
*/
#define JBD2_MAX_SLABS 8
static struct kmem_cache *jbd2_slab[JBD2_MAX_SLABS];
-static DECLARE_MUTEX(jbd2_slab_create_sem);
+static DEFINE_MUTEX(jbd2_slab_create_mutex);

static const char *jbd2_slab_names[JBD2_MAX_SLABS] = {
"jbd2_1k", "jbd2_2k", "jbd2_4k", "jbd2_8k",
@@ -1870,16 +1870,16 @@ static int jbd2_journal_create_slab(size

if (unlikely(i < 0))
i = 0;
- down(&jbd2_slab_create_sem);
+ mutex_lock(&jbd2_slab_create_mutex);
if (jbd2_slab[i]) {
- up(&jbd2_slab_create_sem);
+ mutex_unlock(&jbd2_slab_create_mutex);
return 0; /* Already created */
}

slab_size = 1 << (i+10);
jbd2_slab[i] = kmem_cache_create(jbd2_slab_names[i], slab_size,
slab_size, 0, NULL);
- up(&jbd2_slab_create_sem);
+ mutex_unlock(&jbd2_slab_create_mutex);
if (!jbd2_slab[i]) {
printk(KERN_EMERG "JBD2: no memory for jbd2_slab cache\n");
return -ENOMEM;

\
 
 \ /
  Last update: 2010-10-16 22:37    [W:0.033 / U:4.108 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site