lockd: pass cookie in nlmsvc_testlock
authorMarc Eshel <eshel@almaden.ibm.com>
Tue, 28 Nov 2006 21:27:06 +0000 (16:27 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 7 May 2007 00:38:50 +0000 (20:38 -0400)
Change NLM internal interface to pass more information for test lock; we
need this to make sure the cookie information is pushed down to the place
where we do request deferral, which is handled for testlock by the
following patch.

Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/lockd/svc4proc.c
fs/lockd/svclock.c
fs/lockd/svcproc.c
include/linux/lockd/lockd.h

index 47a66aa..a1bccad 100644 (file)
@@ -99,7 +99,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
                return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now check for conflicting locks */
-       resp->status = nlmsvc_testlock(file, &argp->lock, &resp->lock);
+       resp->status = nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie);
 
        dprintk("lockd: TEST4          status %d\n", ntohl(resp->status));
        nlm_release_host(host);
index 6e74857..7ab2e60 100644 (file)
@@ -442,8 +442,9 @@ out:
  * Test for presence of a conflicting lock.
  */
 __be32
-nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
-                                      struct nlm_lock *conflock)
+nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
+               struct nlm_lock *lock, struct nlm_lock *conflock,
+               struct nlm_cookie *cookie)
 {
        dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n",
                                file->f_file->f_path.dentry->d_inode->i_sb->s_id,
index 31cb484..d13b827 100644 (file)
@@ -127,7 +127,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
                return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
 
        /* Now check for conflicting locks */
-       resp->status = cast_status(nlmsvc_testlock(file, &argp->lock, &resp->lock));
+       resp->status = cast_status(nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie));
 
        dprintk("lockd: TEST          status %d vers %d\n",
                ntohl(resp->status), rqstp->rq_vers);
index d4c4de7..424c3de 100644 (file)
@@ -195,8 +195,8 @@ typedef int   (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
 __be32           nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
                                        struct nlm_lock *, int, struct nlm_cookie *);
 __be32           nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
-__be32           nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
-                                       struct nlm_lock *);
+__be32           nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
+                       struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *);
 __be32           nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
 unsigned long    nlmsvc_retry_blocked(void);
 void             nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,