summaryrefslogtreecommitdiff
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-14 05:42:34 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-14 05:42:34 -0700
commit70d1f017811daab3cdf75d69fa1e37b1a08f4bb8 (patch)
tree066e6289ef3f7fdaf6b9a080466f8352c2e80dba /include/linux/buffer_head.h
parent08aaf1cc54e61c4357828f7d029f9446144d0cc7 (diff)
[PATCH] filtered wakeups: apply to buffer_head functions
From: William Lee Irwin III <wli@holomorphy.com> This patch implements wake-one semantics for buffer_head wakeups in a single step. The buffer_head being waited on is passed to the waiter's wakeup function by the waker, and the wakeup function compares that to the a pointer stored in its on-stack structure and checking the readiness of the bit there also. Wake-one semantics are achieved by using WQ_FLAG_EXCLUSIVE in the codepaths waiting to acquire the bit for mutual exclusion.
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r--include/linux/buffer_head.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 99cb4139354b..6d70bd5393e6 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -170,6 +170,7 @@ struct buffer_head *__bread(struct block_device *, sector_t block, int size);
struct buffer_head *alloc_buffer_head(int gfp_flags);
void free_buffer_head(struct buffer_head * bh);
void FASTCALL(unlock_buffer(struct buffer_head *bh));
+void FASTCALL(__lock_buffer(struct buffer_head *bh));
void ll_rw_block(int, int, struct buffer_head * bh[]);
void sync_dirty_buffer(struct buffer_head *bh);
void submit_bh(int, struct buffer_head *);
@@ -279,8 +280,8 @@ static inline void wait_on_buffer(struct buffer_head *bh)
static inline void lock_buffer(struct buffer_head *bh)
{
- while (test_set_buffer_locked(bh))
- __wait_on_buffer(bh);
+ if (test_set_buffer_locked(bh))
+ __lock_buffer(bh);
}
#endif /* _LINUX_BUFFER_HEAD_H */