diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2011-06-27 16:21:30 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:14 -0400 |
commit | 51b11e3630672b7ce8793ecf13e5759656edf38a (patch) | |
tree | 90b22e023e1120b475adbb6153283e16eaf6f932 /fs | |
parent | 9786f6e68af00d0988ad7f51fe3fd118be1c30ad (diff) |
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@ispras.ru>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | 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 4515bea0268f..a10fb24ca6e6 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) | |||
578 | if (!jffs2_is_writebuffered(c)) | 578 | if (!jffs2_is_writebuffered(c)) |
579 | return 0; | 579 | return 0; |
580 | 580 | ||
581 | if (mutex_trylock(&c->alloc_sem)) { | 581 | if (!mutex_is_locked(&c->alloc_sem)) { |
582 | mutex_unlock(&c->alloc_sem); | ||
583 | printk(KERN_CRIT "jffs2_flush_wbuf() called with alloc_sem not locked!\n"); | 582 | printk(KERN_CRIT "jffs2_flush_wbuf() called with alloc_sem not locked!\n"); |
584 | BUG(); | 583 | BUG(); |
585 | } | 584 | } |