summaryrefslogtreecommitdiffstats
path: root/include/linux/locks.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
committer <ralf@linux-mips.org>1997-01-07 02:33:00 +0000
commitbeb116954b9b7f3bb56412b2494b562f02b864b1 (patch)
tree120e997879884e1b9d93b265221b939d2ef1ade1 /include/linux/locks.h
parent908d4681a1dc3792ecafbe64265783a86c4cccb6 (diff)
Import of Linux/MIPS 2.1.14
Diffstat (limited to 'include/linux/locks.h')
-rw-r--r--include/linux/locks.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/locks.h b/include/linux/locks.h
index ac9b29076..9735bc630 100644
--- a/include/linux/locks.h
+++ b/include/linux/locks.h
@@ -1,6 +1,19 @@
#ifndef _LINUX_LOCKS_H
#define _LINUX_LOCKS_H
+#ifndef _LINUX_MM_H
+#include <linux/mm.h>
+#endif
+#ifndef _LINUX_PAGEMAP_H
+#include <linux/pagemap.h>
+#endif
+
+/*
+ * Unlocked, temporary IO buffer_heads gets moved to the reuse_list
+ * once their page becomes unlocked.
+ */
+extern struct buffer_head *reuse_list;
+
/*
* Buffer cache locking - note that interrupts may only unlock, not
* lock buffers.
@@ -9,22 +22,18 @@ extern void __wait_on_buffer(struct buffer_head *);
extern inline void wait_on_buffer(struct buffer_head * bh)
{
- if (bh->b_lock)
+ if (test_bit(BH_Lock, &bh->b_state))
__wait_on_buffer(bh);
}
extern inline void lock_buffer(struct buffer_head * bh)
{
- if (bh->b_lock)
+ while (set_bit(BH_Lock, &bh->b_state))
__wait_on_buffer(bh);
- bh->b_lock = 1;
}
-extern inline void unlock_buffer(struct buffer_head * bh)
-{
- bh->b_lock = 0;
- wake_up(&bh->b_wait);
-}
+void unlock_buffer(struct buffer_head *);
+
/*
* super-block locking. Again, interrupts may only unlock