Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
fs
lockd
grace.c
Go to the documentation of this file.
1
/*
2
* Common code for control of lockd and nfsv4 grace periods.
3
*/
4
5
#include <linux/module.h>
6
#include <
linux/lockd/bind.h
>
7
#include <
net/net_namespace.h
>
8
9
#include "
netns.h
"
10
11
static
DEFINE_SPINLOCK
(grace_lock);
12
24
void
locks_start_grace
(
struct
net
*
net
,
struct
lock_manager
*
lm
)
25
{
26
struct
lockd_net
*ln =
net_generic
(net,
lockd_net_id
);
27
28
spin_lock(&grace_lock);
29
list_add(&lm->
list
, &ln->
grace_list
);
30
spin_unlock(&grace_lock);
31
}
32
EXPORT_SYMBOL_GPL
(
locks_start_grace
);
33
44
void
locks_end_grace
(
struct
lock_manager
*
lm
)
45
{
46
spin_lock(&grace_lock);
47
list_del_init(&lm->
list
);
48
spin_unlock(&grace_lock);
49
}
50
EXPORT_SYMBOL_GPL
(
locks_end_grace
);
51
59
int
locks_in_grace
(
struct
net
*
net
)
60
{
61
struct
lockd_net
*ln =
net_generic
(net,
lockd_net_id
);
62
63
return
!list_empty(&ln->
grace_list
);
64
}
65
EXPORT_SYMBOL_GPL
(
locks_in_grace
);
Generated on Thu Jan 10 2013 14:47:56 for Linux Kernel by
1.8.2