aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svcproc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-07-25 08:57:22 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-07-27 16:49:22 -0400
commit5ccb0066f2d561549cc4d73d7f56b4ce3ca7a8a1 (patch)
tree43ca9eff5c94fc3609d858ce2a430c544fcc5f99 /fs/lockd/svcproc.c
parentdb9c4553412d72c6a05e0168d1d487f66e0660b3 (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/svcproc.c')
-rw-r--r--fs/lockd/svcproc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index d27aab11f324..de8f2caa2235 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -11,6 +11,7 @@
11#include <linux/time.h> 11#include <linux/time.h>
12#include <linux/lockd/lockd.h> 12#include <linux/lockd/lockd.h>
13#include <linux/lockd/share.h> 13#include <linux/lockd/share.h>
14#include <linux/sunrpc/svc_xprt.h>
14 15
15#define NLMDBG_FACILITY NLMDBG_CLIENT 16#define NLMDBG_FACILITY NLMDBG_CLIENT
16 17
@@ -175,13 +176,14 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
175{ 176{
176 struct nlm_host *host; 177 struct nlm_host *host;
177 struct nlm_file *file; 178 struct nlm_file *file;
179 struct net *net = SVC_NET(rqstp);
178 180
179 dprintk("lockd: CANCEL called\n"); 181 dprintk("lockd: CANCEL called\n");
180 182
181 resp->cookie = argp->cookie; 183 resp->cookie = argp->cookie;
182 184
183 /* Don't accept requests during grace period */ 185 /* Don't accept requests during grace period */
184 if (locks_in_grace()) { 186 if (locks_in_grace(net)) {
185 resp->status = nlm_lck_denied_grace_period; 187 resp->status = nlm_lck_denied_grace_period;
186 return rpc_success; 188 return rpc_success;
187 } 189 }
@@ -191,7 +193,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
191 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 193 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
192 194
193 /* Try to cancel request. */ 195 /* Try to cancel request. */
194 resp->status = cast_status(nlmsvc_cancel_blocked(file, &argp->lock)); 196 resp->status = cast_status(nlmsvc_cancel_blocked(net, file, &argp->lock));
195 197
196 dprintk("lockd: CANCEL status %d\n", ntohl(resp->status)); 198 dprintk("lockd: CANCEL status %d\n", ntohl(resp->status));
197 nlmsvc_release_host(host); 199 nlmsvc_release_host(host);
@@ -208,13 +210,14 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
208{ 210{
209 struct nlm_host *host; 211 struct nlm_host *host;
210 struct nlm_file *file; 212 struct nlm_file *file;
213 struct net *net = SVC_NET(rqstp);
211 214
212 dprintk("lockd: UNLOCK called\n"); 215 dprintk("lockd: UNLOCK called\n");
213 216
214 resp->cookie = argp->cookie; 217 resp->cookie = argp->cookie;
215 218
216 /* Don't accept new lock requests during grace period */ 219 /* Don't accept new lock requests during grace period */
217 if (locks_in_grace()) { 220 if (locks_in_grace(net)) {
218 resp->status = nlm_lck_denied_grace_period; 221 resp->status = nlm_lck_denied_grace_period;
219 return rpc_success; 222 return rpc_success;
220 } 223 }
@@ -224,7 +227,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
224 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 227 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
225 228
226 /* Now try to remove the lock */ 229 /* Now try to remove the lock */
227 resp->status = cast_status(nlmsvc_unlock(file, &argp->lock)); 230 resp->status = cast_status(nlmsvc_unlock(net, file, &argp->lock));
228 231
229 dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status)); 232 dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status));
230 nlmsvc_release_host(host); 233 nlmsvc_release_host(host);
@@ -361,7 +364,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
361 resp->cookie = argp->cookie; 364 resp->cookie = argp->cookie;
362 365
363 /* Don't accept new lock requests during grace period */ 366 /* Don't accept new lock requests during grace period */
364 if (locks_in_grace() && !argp->reclaim) { 367 if (locks_in_grace(SVC_NET(rqstp)) && !argp->reclaim) {
365 resp->status = nlm_lck_denied_grace_period; 368 resp->status = nlm_lck_denied_grace_period;
366 return rpc_success; 369 return rpc_success;
367 } 370 }
@@ -394,7 +397,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
394 resp->cookie = argp->cookie; 397 resp->cookie = argp->cookie;
395 398
396 /* Don't accept requests during grace period */ 399 /* Don't accept requests during grace period */
397 if (locks_in_grace()) { 400 if (locks_in_grace(SVC_NET(rqstp))) {
398 resp->status = nlm_lck_denied_grace_period; 401 resp->status = nlm_lck_denied_grace_period;
399 return rpc_success; 402 return rpc_success;
400 } 403 }