jffs2: use mutex_is_locked() in __jffs2_flush_wbuf()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:24 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=51b11e3630672b7ce8793ecf13e5759656edf38a
Commit:     51b11e3630672b7ce8793ecf13e5759656edf38a
Parent:     9786f6e68af00d0988ad7f51fe3fd118be1c30ad
Author:     Alexey Khoroshilov <khoroshilov at ispras.ru>
AuthorDate: Tue Jun 28 00:21:30 2011 +0400
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:14 2011 +0300

    jffs2: use mutex_is_locked() in __jffs2_flush_wbuf()
    
    Use a helper to test if a mutex is held instead of a hack with
    mutex_trylock().
    
    Signed-off-by: Alexey Khoroshilov <khoroshilov at ispras.ru>
    Signed-off-by: Artem Bityutskiy <dedekind1 at gmail.com>
---
 fs/jffs2/wbuf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index 4515bea..a10fb24 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -578,8 +578,7 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
 	if (!jffs2_is_writebuffered(c))
 		return 0;
 
-	if (mutex_trylock(&c->alloc_sem)) {
-		mutex_unlock(&c->alloc_sem);
+	if (!mutex_is_locked(&c->alloc_sem)) {
 		printk(KERN_CRIT "jffs2_flush_wbuf() called with alloc_sem not locked!\n");
 		BUG();
 	}



More information about the linux-mtd-cvs mailing list