summaryrefslogtreecommitdiffstats
path: root/include/linux/locks.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
commit012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch)
tree87efc733f9b164e8c85c0336f92c8fb7eff6d183 /include/linux/locks.h
parent625a1589d3d6464b5d90b8a0918789e3afffd220 (diff)
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found that this kernel will only boot SMP on Origin; the UP kernel freeze soon after bootup with SCSI timeout messages. I commit this anyway since I found that the last CVS versions had the same problem.
Diffstat (limited to 'include/linux/locks.h')
-rw-r--r--include/linux/locks.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/locks.h b/include/linux/locks.h
index 2094a4d19..9d342e669 100644
--- a/include/linux/locks.h
+++ b/include/linux/locks.h
@@ -29,7 +29,9 @@ extern inline void lock_buffer(struct buffer_head * bh)
extern inline void unlock_buffer(struct buffer_head *bh)
{
clear_bit(BH_Lock, &bh->b_state);
- wake_up(&bh->b_wait);
+ smp_mb__after_clear_bit();
+ if (waitqueue_active(&bh->b_wait))
+ wake_up(&bh->b_wait);
}
/*
@@ -55,7 +57,12 @@ extern inline void lock_super(struct super_block * sb)
extern inline void unlock_super(struct super_block * sb)
{
sb->s_lock = 0;
- wake_up(&sb->s_wait);
+ /*
+ * No need of any barrier, we're protected by
+ * the big kernel lock here... unfortunately :)
+ */
+ if (waitqueue_active(&sb->s_wait))
+ wake_up(&sb->s_wait);
}
#endif /* _LINUX_LOCKS_H */