]> www.infradead.org Git - users/willy/pagecache.git/commit
bitops: Add xor_unlock_is_negative_byte()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 30 Jul 2023 04:03:58 +0000 (00:03 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 4 Oct 2023 01:07:32 +0000 (21:07 -0400)
commit13f20f559736963cce6c2c4d82457a0e8295b5cc
tree3d37691506e2de5c67c7882ccef8fec330759b76
parent425d674854aaf14c16f84428bf30e64021a54128
bitops: Add xor_unlock_is_negative_byte()

Replace clear_bit_and_unlock_is_negative_byte() with
xor_unlock_is_negative_byte().  We have a few places that like to lock
a folio, set a flag and unlock it again.  Allow for the possibility of
combining the latter two operations for efficiency.  We are guaranteed
that the caller holds the lock, so it is safe to unlock it with the xor.
The caller must guarantee that nobody else will set the flag without
holding the lock; it is not safe to do this with the PG_dirty flag,
for example.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
arch/powerpc/include/asm/bitops.h
arch/x86/include/asm/bitops.h
include/asm-generic/bitops/instrumented-lock.h
include/asm-generic/bitops/lock.h
kernel/kcsan/kcsan_test.c
kernel/kcsan/selftest.c
mm/filemap.c
mm/kasan/kasan_test.c