]> git.baikalelectronics.ru Git - kernel.git/commit
direct-io: Use return from cmpxchg to decide of assignment happened
authorOlof Johansson <olof@lixom.net>
Mon, 9 Sep 2013 17:34:23 +0000 (10:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Sep 2013 17:47:42 +0000 (10:47 -0700)
commitf3b994af705c0293dafe5479b6f5df7d0f19c4e6
treee1faec166f3edb5974829d9f7ec4c25e02fd1572
parent087d60f9991c3a58f7b84d26ea92c0cf639c1845
direct-io: Use return from cmpxchg to decide of assignment happened

Not using the return value can in the generic case be racy, so it's
in general good practice to check the return value instead.

This also resolved the warning caused on ARM and other architectures:

  fs/direct-io.c: In function 'sb_init_dio_done_wq':
  fs/direct-io.c:557:2: warning: value computed is not used [-Wunused-value]

Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: H Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/direct-io.c