Commit 8328d59f authored by Andy Adamson's avatar Andy Adamson Committed by Benny Halevy

nfs41: enable nfs_client only nfs4_async_handle_error

The session is per struct nfs_client, not per nfs_server. Allow the handler
to be called with no nfs_server which simplifies the nfs4_proc_async_sequence session renewal call and will let it be used by pnfs file layout data servers.
Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 0f3e66c6
...@@ -3221,10 +3221,8 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen ...@@ -3221,10 +3221,8 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
} }
static int static int
nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, struct nfs4_state *state) _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, struct nfs_client *clp, struct nfs4_state *state)
{ {
struct nfs_client *clp = server->nfs_client;
if (!clp || task->tk_status >= 0) if (!clp || task->tk_status >= 0)
return 0; return 0;
switch(task->tk_status) { switch(task->tk_status) {
...@@ -3244,6 +3242,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, ...@@ -3244,6 +3242,7 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
task->tk_status = 0; task->tk_status = 0;
return -EAGAIN; return -EAGAIN;
case -NFS4ERR_DELAY: case -NFS4ERR_DELAY:
if (server)
nfs_inc_server_stats(server, NFSIOS_DELAY); nfs_inc_server_stats(server, NFSIOS_DELAY);
case -NFS4ERR_GRACE: case -NFS4ERR_GRACE:
rpc_delay(task, NFS4_POLL_RETRY_MAX); rpc_delay(task, NFS4_POLL_RETRY_MAX);
...@@ -3257,6 +3256,12 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, ...@@ -3257,6 +3256,12 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
return 0; return 0;
} }
static int
nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, struct nfs4_state *state)
{
return _nfs4_async_handle_error(task, server, server->nfs_client, state);
}
int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short port, struct rpc_cred *cred) int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short port, struct rpc_cred *cred)
{ {
nfs4_verifier sc_verifier; nfs4_verifier sc_verifier;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment