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 (bh->b_lock)
13 __wait_on_buffer(bh);
14 }
15
16 extern inline void lock_buffer(struct buffer_head * bh)
17 {
18 if (bh->b_lock)
19 __wait_on_buffer(bh);
20 bh->b_lock = 1;
21 }
22
23 extern inline void unlock_buffer(struct buffer_head * bh)
24 {
25 bh->b_lock = 0;
26 wake_up(&bh->b_wait);
27 }
28
29
30
31
32
33
34 extern void __wait_on_super(struct super_block *);
35
36 extern inline void wait_on_super(struct super_block * sb)
37 {
38 if (sb->s_lock)
39 __wait_on_super(sb);
40 }
41
42 extern inline void lock_super(struct super_block * sb)
43 {
44 if (sb->s_lock)
45 __wait_on_super(sb);
46 sb->s_lock = 1;
47 }
48
49 extern inline void unlock_super(struct super_block * sb)
50 {
51 sb->s_lock = 0;
52 wake_up(&sb->s_wait);
53 }
54
55 #endif
56