Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51b11e36 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Artem Bityutskiy
Browse files

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarArtem Bityutskiy <dedekind1@gmail.com>
parent 9786f6e6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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();
	}