aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r--fs/nfs/nfs4state.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index da940abcfaa5..e17bd4412174 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -60,7 +60,7 @@ const nfs4_stateid zero_stateid;
60 60
61static LIST_HEAD(nfs4_clientid_list); 61static LIST_HEAD(nfs4_clientid_list);
62 62
63static int nfs4_init_client(struct nfs_client *clp, struct rpc_cred *cred) 63int nfs4_init_clientid(struct nfs_client *clp, struct rpc_cred *cred)
64{ 64{
65 unsigned short port; 65 unsigned short port;
66 int status; 66 int status;
@@ -1098,11 +1098,13 @@ out:
1098static int nfs4_reclaim_lease(struct nfs_client *clp) 1098static int nfs4_reclaim_lease(struct nfs_client *clp)
1099{ 1099{
1100 struct rpc_cred *cred; 1100 struct rpc_cred *cred;
1101 struct nfs4_state_recovery_ops *ops =
1102 nfs4_reboot_recovery_ops[clp->cl_minorversion];
1101 int status = -ENOENT; 1103 int status = -ENOENT;
1102 1104
1103 cred = nfs4_get_setclientid_cred(clp); 1105 cred = nfs4_get_setclientid_cred(clp);
1104 if (cred != NULL) { 1106 if (cred != NULL) {
1105 status = nfs4_init_client(clp, cred); 1107 status = ops->establish_clid(clp, cred);
1106 put_rpccred(cred); 1108 put_rpccred(cred);
1107 /* Handle case where the user hasn't set up machine creds */ 1109 /* Handle case where the user hasn't set up machine creds */
1108 if (status == -EACCES && cred == clp->cl_machine_cred) { 1110 if (status == -EACCES && cred == clp->cl_machine_cred) {
@@ -1208,7 +1210,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
1208 } 1210 }
1209 /* First recover reboot state... */ 1211 /* First recover reboot state... */
1210 if (test_and_clear_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state)) { 1212 if (test_and_clear_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state)) {
1211 status = nfs4_do_reclaim(clp, &nfs4_reboot_recovery_ops); 1213 status = nfs4_do_reclaim(clp,
1214 nfs4_reboot_recovery_ops[clp->cl_minorversion]);
1212 if (status == -NFS4ERR_STALE_CLIENTID) 1215 if (status == -NFS4ERR_STALE_CLIENTID)
1213 continue; 1216 continue;
1214 if (test_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state)) 1217 if (test_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state))
@@ -1219,7 +1222,8 @@ static void nfs4_state_manager(struct nfs_client *clp)
1219 1222
1220 /* Now recover expired state... */ 1223 /* Now recover expired state... */
1221 if (test_and_clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state)) { 1224 if (test_and_clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state)) {
1222 status = nfs4_do_reclaim(clp, &nfs4_nograce_recovery_ops); 1225 status = nfs4_do_reclaim(clp,
1226 nfs4_nograce_recovery_ops[clp->cl_minorversion]);
1223 if (status < 0) { 1227 if (status < 0) {
1224 set_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state); 1228 set_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state);
1225 if (status == -NFS4ERR_STALE_CLIENTID) 1229 if (status == -NFS4ERR_STALE_CLIENTID)