aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_metapage.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-11-26 15:58:10 -0500
committerDave Kleikamp <shaggy@linux.vnet.ibm.com>2008-01-03 14:11:44 -0500
commit54af6233d1cb84cdfaa6ea44ea0db0bcf518baac (patch)
tree031f07f853e18e2fe09b054a3a8e432424362e60 /fs/jfs/jfs_metapage.c
parent67e6682f18b3bf812a994ae027ff87174a297ae8 (diff)
JFS is missing a memory barrier
JFS is missing a memory barrier needed to close the critical section before clearing the lock bit. Use lock bitops for this. unlock_page() has a second barrier after clearing the lock, which is required because it checks whether the waitqueue is active without locks. Such a barrier is not required here because the waitqueue spinlock is always taken (something to think about if performance is an issue). Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Diffstat (limited to 'fs/jfs/jfs_metapage.c')
-rw-r--r--fs/jfs/jfs_metapage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index b27fa117f229..1dfaae5adf1b 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -39,11 +39,11 @@ static struct {
39#endif 39#endif
40 40
41#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag) 41#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
42#define trylock_metapage(mp) test_and_set_bit(META_locked, &(mp)->flag) 42#define trylock_metapage(mp) test_and_set_bit_lock(META_locked, &(mp)->flag)
43 43
44static inline void unlock_metapage(struct metapage *mp) 44static inline void unlock_metapage(struct metapage *mp)
45{ 45{
46 clear_bit(META_locked, &mp->flag); 46 clear_bit_unlock(META_locked, &mp->flag);
47 wake_up(&mp->wait); 47 wake_up(&mp->wait);
48} 48}
49 49