6b13f685e
김민수
BSP 최초 추가
|
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#include <linux/module.h>
#include <linux/lockd/bind.h>
#include <net/net_namespace.h>
#include "netns.h"
static DEFINE_SPINLOCK(grace_lock);
void locks_start_grace(struct net *net, struct lock_manager *lm)
{
struct lockd_net *ln = net_generic(net, lockd_net_id);
spin_lock(&grace_lock);
list_add(&lm->list, &ln->grace_list);
spin_unlock(&grace_lock);
}
EXPORT_SYMBOL_GPL(locks_start_grace);
void locks_end_grace(struct lock_manager *lm)
{
spin_lock(&grace_lock);
list_del_init(&lm->list);
spin_unlock(&grace_lock);
}
EXPORT_SYMBOL_GPL(locks_end_grace);
int locks_in_grace(struct net *net)
{
struct lockd_net *ln = net_generic(net, lockd_net_id);
return !list_empty(&ln->grace_list);
}
EXPORT_SYMBOL_GPL(locks_in_grace);
|