diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-07-25 08:57:22 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-07-27 16:49:22 -0400 |
commit | 5ccb0066f2d561549cc4d73d7f56b4ce3ca7a8a1 (patch) | |
tree | 43ca9eff5c94fc3609d858ce2a430c544fcc5f99 /fs/lockd/svc.c | |
parent | db9c4553412d72c6a05e0168d1d487f66e0660b3 (diff) |
LockD: pass actual network namespace to grace period management functions
Passed network namespace replaced hard-coded init_net
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r-- | fs/lockd/svc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 834dfe2ed2e9..68271c206bdc 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -97,12 +97,12 @@ static void grace_ender(struct work_struct *grace) | |||
97 | locks_end_grace(&ln->lockd_manager); | 97 | locks_end_grace(&ln->lockd_manager); |
98 | } | 98 | } |
99 | 99 | ||
100 | static void set_grace_period(void) | 100 | static void set_grace_period(struct net *net) |
101 | { | 101 | { |
102 | unsigned long grace_period = get_lockd_grace_period(); | 102 | unsigned long grace_period = get_lockd_grace_period(); |
103 | struct lockd_net *ln = net_generic(&init_net, lockd_net_id); | 103 | struct lockd_net *ln = net_generic(net, lockd_net_id); |
104 | 104 | ||
105 | locks_start_grace(&ln->lockd_manager); | 105 | locks_start_grace(net, &ln->lockd_manager); |
106 | cancel_delayed_work_sync(&ln->grace_period_end); | 106 | cancel_delayed_work_sync(&ln->grace_period_end); |
107 | schedule_delayed_work(&ln->grace_period_end, grace_period); | 107 | schedule_delayed_work(&ln->grace_period_end, grace_period); |
108 | } | 108 | } |
@@ -110,12 +110,13 @@ static void set_grace_period(void) | |||
110 | static void restart_grace(void) | 110 | static void restart_grace(void) |
111 | { | 111 | { |
112 | if (nlmsvc_ops) { | 112 | if (nlmsvc_ops) { |
113 | struct lockd_net *ln = net_generic(&init_net, lockd_net_id); | 113 | struct net *net = &init_net; |
114 | struct lockd_net *ln = net_generic(net, lockd_net_id); | ||
114 | 115 | ||
115 | cancel_delayed_work_sync(&ln->grace_period_end); | 116 | cancel_delayed_work_sync(&ln->grace_period_end); |
116 | locks_end_grace(&ln->lockd_manager); | 117 | locks_end_grace(&ln->lockd_manager); |
117 | nlmsvc_invalidate_all(); | 118 | nlmsvc_invalidate_all(); |
118 | set_grace_period(); | 119 | set_grace_period(net); |
119 | } | 120 | } |
120 | } | 121 | } |
121 | 122 | ||
@@ -127,7 +128,8 @@ lockd(void *vrqstp) | |||
127 | { | 128 | { |
128 | int err = 0, preverr = 0; | 129 | int err = 0, preverr = 0; |
129 | struct svc_rqst *rqstp = vrqstp; | 130 | struct svc_rqst *rqstp = vrqstp; |
130 | struct lockd_net *ln = net_generic(&init_net, lockd_net_id); | 131 | struct net *net = &init_net; |
132 | struct lockd_net *ln = net_generic(net, lockd_net_id); | ||
131 | 133 | ||
132 | /* try_to_freeze() is called from svc_recv() */ | 134 | /* try_to_freeze() is called from svc_recv() */ |
133 | set_freezable(); | 135 | set_freezable(); |
@@ -141,7 +143,7 @@ lockd(void *vrqstp) | |||
141 | nlm_timeout = LOCKD_DFLT_TIMEO; | 143 | nlm_timeout = LOCKD_DFLT_TIMEO; |
142 | nlmsvc_timeout = nlm_timeout * HZ; | 144 | nlmsvc_timeout = nlm_timeout * HZ; |
143 | 145 | ||
144 | set_grace_period(); | 146 | set_grace_period(net); |
145 | 147 | ||
146 | /* | 148 | /* |
147 | * The main request loop. We don't terminate until the last | 149 | * The main request loop. We don't terminate until the last |