This source file includes following definitions.
- wait_on_buffer
- lock_buffer
- unlock_buffer
- wait_on_super
- lock_super
- unlock_super
1 #ifndef _LINUX_LOCKS_H
2 #define _LINUX_LOCKS_H
3
4
5
6
7
8 extern void __wait_on_buffer(struct buffer_head *);
9
10 extern inline void wait_on_buffer(struct buffer_head * bh)
11 {
12 if (test_bit(BH_Lock, &bh->b_state))
13 __wait_on_buffer(bh);
14 }
15
16 extern inline void lock_buffer(struct buffer_head * bh)
17 {
18 if (set_bit(BH_Lock, &bh->b_state))
19 __wait_on_buffer(bh);
20 }
21
22 extern inline void unlock_buffer(struct buffer_head * bh)
23 {
24 clear_bit(BH_Lock, &bh->b_state);
25 wake_up(&bh->b_wait);
26 }
27
28
29
30
31
32
33 extern void __wait_on_super(struct super_block *);
34
35 extern inline void wait_on_super(struct super_block * sb)
36 {
37 if (sb->s_lock)
38 __wait_on_super(sb);
39 }
40
41 extern inline void lock_super(struct super_block * sb)
42 {
43 if (sb->s_lock)
44 __wait_on_super(sb);
45 sb->s_lock = 1;
46 }
47
48 extern inline void unlock_super(struct super_block * sb)
49 {
50 sb->s_lock = 0;
51 wake_up(&sb->s_wait);
52 }
53
54 #endif
55