aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-04-01 09:22:46 -0400
committerBenny Halevy <bhalevy@panasas.com>2009-06-17 15:25:11 -0400
commita7b721037f898b29a8083da59b1dccd3da385b07 (patch)
tree57d0fba7528118a9d4dcd8395adbdb91956fcb17 /fs/nfs/nfs4state.c
parent8e69514f2981d85108c2bd220ff8e188c0c27cdb (diff)
nfs41: introduce get_state_renewal_cred
Use the machine cred for sending SEQUENCE to renew the client's lease. [revamp patch for new state management design starting 2.6.29] [nfs41: support minorversion 1 for nfs4_check_lease] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: get cred in exchange_id when cred arg is NULL] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: use cl_machined_cred instead of cl_ex_cred] Since EXCHANGE_ID insists on using the machine credential, cl_ex_cred is not needed. nfs4_proc_exchange_id() is only called if the machine credential is available. Remove the credential logic from nfs4_proc_exchange_id. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r--fs/nfs/nfs4state.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index dc5599c7f4d9..da940abcfaa5 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -77,7 +77,7 @@ static int nfs4_init_client(struct nfs_client *clp, struct rpc_cred *cred)
77 return status; 77 return status;
78} 78}
79 79
80static struct rpc_cred *nfs4_get_machine_cred_locked(struct nfs_client *clp) 80struct rpc_cred *nfs4_get_machine_cred_locked(struct nfs_client *clp)
81{ 81{
82 struct rpc_cred *cred = NULL; 82 struct rpc_cred *cred = NULL;
83 83
@@ -114,17 +114,7 @@ struct rpc_cred *nfs4_get_renew_cred_locked(struct nfs_client *clp)
114 return cred; 114 return cred;
115} 115}
116 116
117static struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp) 117struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp)
118{
119 struct rpc_cred *cred;
120
121 spin_lock(&clp->cl_lock);
122 cred = nfs4_get_renew_cred_locked(clp);
123 spin_unlock(&clp->cl_lock);
124 return cred;
125}
126
127static struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp)
128{ 118{
129 struct nfs4_state_owner *sp; 119 struct nfs4_state_owner *sp;
130 struct rb_node *pos; 120 struct rb_node *pos;
@@ -1090,7 +1080,9 @@ static int nfs4_check_lease(struct nfs_client *clp)
1090 /* Is the client already known to have an expired lease? */ 1080 /* Is the client already known to have an expired lease? */
1091 if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) 1081 if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state))
1092 return 0; 1082 return 0;
1093 cred = nfs4_get_renew_cred(clp); 1083 spin_lock(&clp->cl_lock);
1084 cred = ops->get_state_renewal_cred_locked(clp);
1085 spin_unlock(&clp->cl_lock);
1094 if (cred == NULL) { 1086 if (cred == NULL) {
1095 cred = nfs4_get_setclientid_cred(clp); 1087 cred = nfs4_get_setclientid_cred(clp);
1096 if (cred == NULL) 1088 if (cred == NULL)