OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [linux/] [locks.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _LINUX_LOCKS_H
2
#define _LINUX_LOCKS_H
3
 
4
#ifndef _LINUX_MM_H
5
#include <linux/mm.h>
6
#endif
7
#ifndef _LINUX_PAGEMAP_H
8
#include <linux/pagemap.h>
9
#endif
10
 
11
/*
12
 * Buffer cache locking - note that interrupts may only unlock, not
13
 * lock buffers.
14
 */
15
extern void __wait_on_buffer(struct buffer_head *);
16
 
17
static inline void wait_on_buffer(struct buffer_head * bh)
18
{
19
        if (test_bit(BH_Lock, &bh->b_state))
20
                __wait_on_buffer(bh);
21
}
22
 
23
static inline void lock_buffer(struct buffer_head * bh)
24
{
25
        while (test_and_set_bit(BH_Lock, &bh->b_state))
26
                __wait_on_buffer(bh);
27
}
28
 
29
extern void FASTCALL(unlock_buffer(struct buffer_head *bh));
30
 
31
/*
32
 * super-block locking. Again, interrupts may only unlock
33
 * a super-block (although even this isn't done right now.
34
 * nfs may need it).
35
 */
36
 
37
static inline void lock_super(struct super_block * sb)
38
{
39
        down(&sb->s_lock);
40
}
41
 
42
static inline void unlock_super(struct super_block * sb)
43
{
44
        up(&sb->s_lock);
45
}
46
 
47
#endif /* _LINUX_LOCKS_H */
48
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.