summaryrefslogtreecommitdiff
path: root/fs/lockd/grace.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-07-25 16:57:13 +0400
committerJ. Bruce Fields <bfields@redhat.com>2012-07-27 16:49:22 -0400
commitdb9c4553412d72c6a05e0168d1d487f66e0660b3 (patch)
treee6510453641076d46fb1453867f9532205ba302d /fs/lockd/grace.c
parent9695c7057f4887ed54dc1e6c2ef22f72a2be1175 (diff)
downloadlwn-db9c4553412d72c6a05e0168d1d487f66e0660b3.tar.gz
lwn-db9c4553412d72c6a05e0168d1d487f66e0660b3.zip
LockD: manage grace list per network namespace
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd/grace.c')
-rw-r--r--fs/lockd/grace.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/lockd/grace.c b/fs/lockd/grace.c
index 183cc1f0af1c..8dbaff782098 100644
--- a/fs/lockd/grace.c
+++ b/fs/lockd/grace.c
@@ -4,8 +4,10 @@
#include <linux/module.h>
#include <linux/lockd/bind.h>
+#include <net/net_namespace.h>
+
+#include "netns.h"
-static LIST_HEAD(grace_list);
static DEFINE_SPINLOCK(grace_lock);
/**
@@ -21,8 +23,11 @@ static DEFINE_SPINLOCK(grace_lock);
*/
void locks_start_grace(struct lock_manager *lm)
{
+ struct net *net = &init_net;
+ struct lockd_net *ln = net_generic(net, lockd_net_id);
+
spin_lock(&grace_lock);
- list_add(&lm->list, &grace_list);
+ list_add(&lm->list, &ln->grace_list);
spin_unlock(&grace_lock);
}
EXPORT_SYMBOL_GPL(locks_start_grace);
@@ -54,6 +59,9 @@ EXPORT_SYMBOL_GPL(locks_end_grace);
*/
int locks_in_grace(void)
{
- return !list_empty(&grace_list);
+ struct net *net = &init_net;
+ struct lockd_net *ln = net_generic(net, lockd_net_id);
+
+ return !list_empty(&ln->grace_list);
}
EXPORT_SYMBOL_GPL(locks_in_grace);