diff options
Diffstat (limited to 'include/linux/locks.h')
-rw-r--r-- | include/linux/locks.h | 25 |
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 |