aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svcproc.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/lockd/svcproc.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'fs/lockd/svcproc.c')
-rw-r--r--fs/lockd/svcproc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 21171f0c647..d27aab11f32 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -11,7 +11,6 @@
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>
15 14
16#define NLMDBG_FACILITY NLMDBG_CLIENT 15#define NLMDBG_FACILITY NLMDBG_CLIENT
17 16
@@ -68,8 +67,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
68 67
69 /* Obtain file pointer. Not used by FREE_ALL call. */ 68 /* Obtain file pointer. Not used by FREE_ALL call. */
70 if (filp != NULL) { 69 if (filp != NULL) {
71 error = cast_status(nlm_lookup_file(rqstp, &file, &lock->fh)); 70 if ((error = nlm_lookup_file(rqstp, &file, &lock->fh)) != 0)
72 if (error != 0)
73 goto no_locks; 71 goto no_locks;
74 *filp = file; 72 *filp = file;
75 73
@@ -177,14 +175,13 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
177{ 175{
178 struct nlm_host *host; 176 struct nlm_host *host;
179 struct nlm_file *file; 177 struct nlm_file *file;
180 struct net *net = SVC_NET(rqstp);
181 178
182 dprintk("lockd: CANCEL called\n"); 179 dprintk("lockd: CANCEL called\n");
183 180
184 resp->cookie = argp->cookie; 181 resp->cookie = argp->cookie;
185 182
186 /* Don't accept requests during grace period */ 183 /* Don't accept requests during grace period */
187 if (locks_in_grace(net)) { 184 if (locks_in_grace()) {
188 resp->status = nlm_lck_denied_grace_period; 185 resp->status = nlm_lck_denied_grace_period;
189 return rpc_success; 186 return rpc_success;
190 } 187 }
@@ -194,7 +191,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqstp, struct nlm_args *argp,
194 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 191 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
195 192
196 /* Try to cancel request. */ 193 /* Try to cancel request. */
197 resp->status = cast_status(nlmsvc_cancel_blocked(net, file, &argp->lock)); 194 resp->status = cast_status(nlmsvc_cancel_blocked(file, &argp->lock));
198 195
199 dprintk("lockd: CANCEL status %d\n", ntohl(resp->status)); 196 dprintk("lockd: CANCEL status %d\n", ntohl(resp->status));
200 nlmsvc_release_host(host); 197 nlmsvc_release_host(host);
@@ -211,14 +208,13 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
211{ 208{
212 struct nlm_host *host; 209 struct nlm_host *host;
213 struct nlm_file *file; 210 struct nlm_file *file;
214 struct net *net = SVC_NET(rqstp);
215 211
216 dprintk("lockd: UNLOCK called\n"); 212 dprintk("lockd: UNLOCK called\n");
217 213
218 resp->cookie = argp->cookie; 214 resp->cookie = argp->cookie;
219 215
220 /* Don't accept new lock requests during grace period */ 216 /* Don't accept new lock requests during grace period */
221 if (locks_in_grace(net)) { 217 if (locks_in_grace()) {
222 resp->status = nlm_lck_denied_grace_period; 218 resp->status = nlm_lck_denied_grace_period;
223 return rpc_success; 219 return rpc_success;
224 } 220 }
@@ -228,7 +224,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqstp, struct nlm_args *argp,
228 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success; 224 return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
229 225
230 /* Now try to remove the lock */ 226 /* Now try to remove the lock */
231 resp->status = cast_status(nlmsvc_unlock(net, file, &argp->lock)); 227 resp->status = cast_status(nlmsvc_unlock(file, &argp->lock));
232 228
233 dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status)); 229 dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status));
234 nlmsvc_release_host(host); 230 nlmsvc_release_host(host);
@@ -298,7 +294,6 @@ static __be32 nlmsvc_callback(struct svc_rqst *rqstp, u32 proc, struct nlm_args
298 return rpc_system_err; 294 return rpc_system_err;
299 295
300 call = nlm_alloc_call(host); 296 call = nlm_alloc_call(host);
301 nlmsvc_release_host(host);
302 if (call == NULL) 297 if (call == NULL)
303 return rpc_system_err; 298 return rpc_system_err;
304 299
@@ -366,7 +361,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp, struct nlm_args *argp,
366 resp->cookie = argp->cookie; 361 resp->cookie = argp->cookie;
367 362
368 /* Don't accept new lock requests during grace period */ 363 /* Don't accept new lock requests during grace period */
369 if (locks_in_grace(SVC_NET(rqstp)) && !argp->reclaim) { 364 if (locks_in_grace() && !argp->reclaim) {
370 resp->status = nlm_lck_denied_grace_period; 365 resp->status = nlm_lck_denied_grace_period;
371 return rpc_success; 366 return rpc_success;
372 } 367 }
@@ -399,7 +394,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqstp, struct nlm_args *argp,
399 resp->cookie = argp->cookie; 394 resp->cookie = argp->cookie;
400 395
401 /* Don't accept requests during grace period */ 396 /* Don't accept requests during grace period */
402 if (locks_in_grace(SVC_NET(rqstp))) { 397 if (locks_in_grace()) {
403 resp->status = nlm_lck_denied_grace_period; 398 resp->status = nlm_lck_denied_grace_period;
404 return rpc_success; 399 return rpc_success;
405 } 400 }