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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [locks.h] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#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
 * Unlocked, temporary IO buffer_heads gets moved to the reuse_list
13
 * once their page becomes unlocked.
14
 */
15
extern struct buffer_head *reuse_list;
16
 
17
/*
18
 * Buffer cache locking - note that interrupts may only unlock, not
19
 * lock buffers.
20
 */
21
extern void __wait_on_buffer(struct buffer_head *);
22
 
23
extern inline void wait_on_buffer(struct buffer_head * bh)
24
{
25
        if (test_bit(BH_Lock, &bh->b_state))
26
                __wait_on_buffer(bh);
27
}
28
 
29
extern inline void lock_buffer(struct buffer_head * bh)
30
{
31
        while (set_bit(BH_Lock, &bh->b_state))
32
                __wait_on_buffer(bh);
33
}
34
 
35
void unlock_buffer(struct buffer_head *);
36
 
37
 
38
/*
39
 * super-block locking. Again, interrupts may only unlock
40
 * a super-block (although even this isn't done right now.
41
 * nfs may need it).
42
 */
43
extern void __wait_on_super(struct super_block *);
44
 
45
extern inline void wait_on_super(struct super_block * sb)
46
{
47
        if (sb->s_lock)
48
                __wait_on_super(sb);
49
}
50
 
51
extern inline void lock_super(struct super_block * sb)
52
{
53
        if (sb->s_lock)
54
                __wait_on_super(sb);
55
        sb->s_lock = 1;
56
}
57
 
58
extern inline void unlock_super(struct super_block * sb)
59
{
60
        sb->s_lock = 0;
61
        wake_up(&sb->s_wait);
62
}
63
 
64
#endif /* _LINUX_LOCKS_H */
65
 

powered by: WebSVN 2.1.0

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