Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320416
b: refs/heads/master
c: db9c455
h: refs/heads/master
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Jul 27, 2012
1 parent e812e24 commit 6d3d3ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9695c7057f4887ed54dc1e6c2ef22f72a2be1175
refs/heads/master: db9c4553412d72c6a05e0168d1d487f66e0660b3
14 changes: 11 additions & 3 deletions trunk/fs/lockd/grace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand All @@ -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);
Expand Down Expand Up @@ -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);
1 change: 1 addition & 0 deletions trunk/fs/lockd/netns.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct lockd_net {

struct delayed_work grace_period_end;
struct lock_manager lockd_manager;
struct list_head grace_list;
};

extern int lockd_net_id;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ static int lockd_init_net(struct net *net)
struct lockd_net *ln = net_generic(net, lockd_net_id);

INIT_DELAYED_WORK(&ln->grace_period_end, grace_ender);
INIT_LIST_HEAD(&ln->grace_list);
return 0;
}

Expand Down

0 comments on commit 6d3d3ed

Please sign in to comment.