diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-06 15:10:43 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-10 23:40:41 -0400 |
commit | 13437e12fb43cb7e285ff59248f781c91578eafe (patch) | |
tree | 450c618a4655161b4c534d700b9111cf7c349e6f /fs/nfs | |
parent | 901630278469c0d7610554227f39ed2d02d0d270 (diff) |
NFSv4: Support recalling delegations by stateid part 2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/delegation.c | 2 | ||||
-rw-r--r-- | fs/nfs/delegation.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 10 |
3 files changed, 6 insertions, 8 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index cee2ba42b68d..93a9f4bd9bd0 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -76,7 +76,7 @@ again: | |||
76 | continue; | 76 | continue; |
77 | get_nfs_open_context(ctx); | 77 | get_nfs_open_context(ctx); |
78 | spin_unlock(&inode->i_lock); | 78 | spin_unlock(&inode->i_lock); |
79 | err = nfs4_open_delegation_recall(ctx, state); | 79 | err = nfs4_open_delegation_recall(ctx, state, stateid); |
80 | if (err >= 0) | 80 | if (err >= 0) |
81 | err = nfs_delegation_claim_locks(ctx, state); | 81 | err = nfs_delegation_claim_locks(ctx, state); |
82 | put_nfs_open_context(ctx); | 82 | put_nfs_open_context(ctx); |
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h index 7b22f1742445..8f79a3135167 100644 --- a/fs/nfs/delegation.h +++ b/fs/nfs/delegation.h | |||
@@ -39,7 +39,7 @@ void nfs_delegation_reap_unclaimed(struct nfs_client *clp); | |||
39 | 39 | ||
40 | /* NFSv4 delegation-related procedures */ | 40 | /* NFSv4 delegation-related procedures */ |
41 | int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4_stateid *stateid); | 41 | int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4_stateid *stateid); |
42 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state); | 42 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid); |
43 | int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl); | 43 | int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl); |
44 | int nfs4_copy_delegation_stateid(nfs4_stateid *dst, struct inode *inode); | 44 | int nfs4_copy_delegation_stateid(nfs4_stateid *dst, struct inode *inode); |
45 | 45 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 03b60c67ca7c..10946415de77 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -510,32 +510,30 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta | |||
510 | return ret; | 510 | return ret; |
511 | } | 511 | } |
512 | 512 | ||
513 | static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state) | 513 | static int _nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) |
514 | { | 514 | { |
515 | struct nfs4_state_owner *sp = state->owner; | 515 | struct nfs4_state_owner *sp = state->owner; |
516 | struct nfs4_opendata *opendata; | 516 | struct nfs4_opendata *opendata; |
517 | int ret; | 517 | int ret; |
518 | 518 | ||
519 | if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) | ||
520 | return 0; | ||
521 | opendata = nfs4_opendata_alloc(&ctx->path, sp, 0, NULL); | 519 | opendata = nfs4_opendata_alloc(&ctx->path, sp, 0, NULL); |
522 | if (opendata == NULL) | 520 | if (opendata == NULL) |
523 | return -ENOMEM; | 521 | return -ENOMEM; |
524 | opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; | 522 | opendata->o_arg.claim = NFS4_OPEN_CLAIM_DELEGATE_CUR; |
525 | memcpy(opendata->o_arg.u.delegation.data, state->stateid.data, | 523 | memcpy(opendata->o_arg.u.delegation.data, stateid->data, |
526 | sizeof(opendata->o_arg.u.delegation.data)); | 524 | sizeof(opendata->o_arg.u.delegation.data)); |
527 | ret = nfs4_open_recover(opendata, state); | 525 | ret = nfs4_open_recover(opendata, state); |
528 | nfs4_opendata_put(opendata); | 526 | nfs4_opendata_put(opendata); |
529 | return ret; | 527 | return ret; |
530 | } | 528 | } |
531 | 529 | ||
532 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state) | 530 | int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid) |
533 | { | 531 | { |
534 | struct nfs4_exception exception = { }; | 532 | struct nfs4_exception exception = { }; |
535 | struct nfs_server *server = NFS_SERVER(state->inode); | 533 | struct nfs_server *server = NFS_SERVER(state->inode); |
536 | int err; | 534 | int err; |
537 | do { | 535 | do { |
538 | err = _nfs4_open_delegation_recall(ctx, state); | 536 | err = _nfs4_open_delegation_recall(ctx, state, stateid); |
539 | switch (err) { | 537 | switch (err) { |
540 | case 0: | 538 | case 0: |
541 | return err; | 539 | return err; |