fs/reiserfs/journal.c: fix sparse context imbalance warning

Merge conditional unlock/lock in the same condition to avoid sparse
warning:

  fs/reiserfs/journal.c:703:36: warning: context imbalance in 'add_to_chunk' - unexpected unlock

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Fabian Frederick 2014-10-13 15:53:29 -07:00 committed by Linus Torvalds
parent 35c0b380d8
commit 54cc6cea73

View File

@ -699,11 +699,13 @@ static int add_to_chunk(struct buffer_chunk *chunk, struct buffer_head *bh,
chunk->bh[chunk->nr++] = bh; chunk->bh[chunk->nr++] = bh;
if (chunk->nr >= CHUNK_SIZE) { if (chunk->nr >= CHUNK_SIZE) {
ret = 1; ret = 1;
if (lock) if (lock) {
spin_unlock(lock); spin_unlock(lock);
fn(chunk); fn(chunk);
if (lock)
spin_lock(lock); spin_lock(lock);
} else {
fn(chunk);
}
} }
return ret; return ret;
} }