blob: fc0baf6c6132b5875669dfe7ff8bcd90b0aae76b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#ifndef _LINUX_VRANGE_H
#define _LINUX_VRANGE_H
#include <linux/vrange_types.h>
#include <linux/mm.h>
#define vrange_from_node(node_ptr) \
container_of(node_ptr, struct vrange, node)
#define vrange_entry(ptr) \
container_of(ptr, struct vrange, node.rb)
#ifdef CONFIG_MMU
static inline void vrange_root_init(struct vrange_root *vroot, int type)
{
vroot->type = type;
vroot->v_rb = RB_ROOT;
mutex_init(&vroot->v_lock);
}
static inline void vrange_lock(struct vrange_root *vroot)
{
mutex_lock(&vroot->v_lock);
}
static inline void vrange_unlock(struct vrange_root *vroot)
{
mutex_unlock(&vroot->v_lock);
}
static inline int vrange_type(struct vrange *vrange)
{
return vrange->owner->type;
}
extern void vrange_root_cleanup(struct vrange_root *vroot);
extern int vrange_fork(struct mm_struct *new,
struct mm_struct *old);
#else
static inline void vrange_root_init(struct vrange_root *vroot, int type) {};
static inline void vrange_root_cleanup(struct vrange_root *vroot) {};
static inline int vrange_fork(struct mm_struct *new, struct mm_struct *old)
{
return 0;
}
#endif
#endif /* _LINIUX_VRANGE_H */
|