Skip to content

Commit 85f3f1b

Browse files
Marc EshelJ. Bruce Fields
authored andcommitted
lockd: pass cookie in nlmsvc_testlock
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>
1 parent 0e4ac9d commit 85f3f1b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

fs/lockd/svc4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
9999
return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
100100

101101
/* Now check for conflicting locks */
102-
resp->status = nlmsvc_testlock(file, &argp->lock, &resp->lock);
102+
resp->status = nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie);
103103

104104
dprintk("lockd: TEST4 status %d\n", ntohl(resp->status));
105105
nlm_release_host(host);

fs/lockd/svclock.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,9 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
442442
* Test for presence of a conflicting lock.
443443
*/
444444
__be32
445-
nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
446-
struct nlm_lock *conflock)
445+
nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
446+
struct nlm_lock *lock, struct nlm_lock *conflock,
447+
struct nlm_cookie *cookie)
447448
{
448449
dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n",
449450
file->f_file->f_path.dentry->d_inode->i_sb->s_id,

fs/lockd/svcproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args *argp,
127127
return resp->status == nlm_drop_reply ? rpc_drop_reply :rpc_success;
128128

129129
/* Now check for conflicting locks */
130-
resp->status = cast_status(nlmsvc_testlock(file, &argp->lock, &resp->lock));
130+
resp->status = cast_status(nlmsvc_testlock(rqstp, file, &argp->lock, &resp->lock, &resp->cookie));
131131

132132
dprintk("lockd: TEST status %d vers %d\n",
133133
ntohl(resp->status), rqstp->rq_vers);

include/linux/lockd/lockd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
195195
__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
196196
struct nlm_lock *, int, struct nlm_cookie *);
197197
__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
198-
__be32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
199-
struct nlm_lock *);
198+
__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
199+
struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *);
200200
__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
201201
unsigned long nlmsvc_retry_blocked(void);
202202
void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,

0 commit comments

Comments
 (0)