Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175957
b: refs/heads/master
c: e608e79
h: refs/heads/master
i:
  175955: af08ba9
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Dec 4, 2009
1 parent 57a362f commit deb7de8
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d9ddde94aed01c4618cf6f70883cc511c3b2b62
refs/heads/master: e608e79f1bf4b967afcf57777e63b5f0939b00e8
16 changes: 2 additions & 14 deletions trunk/fs/nfs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,14 @@ extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int);
extern struct rpc_procinfo nfs3_procedures[];
extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int);

/* nfs4proc.c */
static inline void nfs4_restart_rpc(struct rpc_task *task,
const struct nfs_client *clp)
{
#ifdef CONFIG_NFS_V4_1
if (nfs4_has_session(clp) &&
test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)) {
rpc_restart_call_prepare(task);
return;
}
#endif /* CONFIG_NFS_V4_1 */
rpc_restart_call(task);
}

/* nfs4xdr.c */
#ifdef CONFIG_NFS_V4
extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
#endif

/* nfs4proc.c */
extern void nfs4_restart_rpc(struct rpc_task *, const struct nfs_client *,
struct nfs4_sequence_res *);
#ifdef CONFIG_NFS_V4
extern struct rpc_procinfo nfs4_procedures[];
#endif
Expand Down
29 changes: 23 additions & 6 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,19 @@ static void nfs4_sequence_done(const struct nfs_server *server,
#endif /* CONFIG_NFS_V4_1 */
}

void nfs4_restart_rpc(struct rpc_task *task, const struct nfs_client *clp,
struct nfs4_sequence_res *res)
{
#ifdef CONFIG_NFS_V4_1
if (nfs4_has_session(clp)) {
nfs41_sequence_free_slot(clp, res);
rpc_restart_call_prepare(task);
return;
}
#endif /* CONFIG_NFS_V4_1 */
rpc_restart_call(task);
}

/* no restart, therefore free slot here */
static void nfs4_sequence_done_free_slot(const struct nfs_server *server,
struct nfs4_sequence_res *res,
Expand Down Expand Up @@ -1750,7 +1763,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
break;
default:
if (nfs4_async_handle_error(task, server, state) == -EAGAIN) {
nfs4_restart_rpc(task, server->nfs_client);
nfs4_restart_rpc(task, server->nfs_client,
&calldata->res.seq_res);
return;
}
}
Expand Down Expand Up @@ -2988,7 +3002,7 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
nfs4_sequence_done(server, &data->res.seq_res, task->tk_status);

if (nfs4_async_handle_error(task, server, data->args.context->state) == -EAGAIN) {
nfs4_restart_rpc(task, server->nfs_client);
nfs4_restart_rpc(task, server->nfs_client, &data->res.seq_res);
return -EAGAIN;
}

Expand All @@ -3013,7 +3027,8 @@ static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
task->tk_status);

if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) {
nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client,
&data->res.seq_res);
return -EAGAIN;
}
if (task->tk_status >= 0) {
Expand Down Expand Up @@ -3041,7 +3056,8 @@ static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
nfs4_sequence_done(NFS_SERVER(inode), &data->res.seq_res,
task->tk_status);
if (nfs4_async_handle_error(task, NFS_SERVER(inode), NULL) == -EAGAIN) {
nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client,
&data->res.seq_res);
return -EAGAIN;
}
nfs4_sequence_free_slot(NFS_SERVER(inode)->nfs_client,
Expand Down Expand Up @@ -3755,7 +3771,8 @@ static void nfs4_locku_done(struct rpc_task *task, void *data)
default:
if (nfs4_async_handle_error(task, calldata->server, NULL) == -EAGAIN)
nfs4_restart_rpc(task,
calldata->server->nfs_client);
calldata->server->nfs_client,
&calldata->res.seq_res);
}
nfs4_sequence_free_slot(calldata->server->nfs_client,
&calldata->res.seq_res);
Expand Down Expand Up @@ -4890,7 +4907,7 @@ void nfs41_sequence_call_done(struct rpc_task *task, void *data)

if (_nfs4_async_handle_error(task, NULL, clp, NULL)
== -EAGAIN) {
nfs4_restart_rpc(task, clp);
nfs4_restart_rpc(task, clp, task->tk_msg.rpc_resp);
return;
}
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data
argp->offset += resp->count;
argp->pgbase += resp->count;
argp->count -= resp->count;
nfs4_restart_rpc(task, NFS_SERVER(data->inode)->nfs_client);
nfs4_restart_rpc(task, NFS_SERVER(data->inode)->nfs_client,
&data->res.seq_res);
return;
out:
nfs4_sequence_free_slot(NFS_SERVER(data->inode)->nfs_client,
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/nfs/unlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata)
{
struct nfs_unlinkdata *data = calldata;
struct inode *dir = data->dir;
struct nfs_removeres *res = task->tk_msg.rpc_resp;

if (!NFS_PROTO(dir)->unlink_done(task, dir))
nfs4_restart_rpc(task, NFS_SERVER(dir)->nfs_client);
nfs4_restart_rpc(task, NFS_SERVER(dir)->nfs_client,
&res->seq_res);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,8 @@ int nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
*/
argp->stable = NFS_FILE_SYNC;
}
nfs4_restart_rpc(task, server->nfs_client);
nfs4_restart_rpc(task, server->nfs_client,
&data->res.seq_res);
return -EAGAIN;
}
if (time_before(complain, jiffies)) {
Expand Down

0 comments on commit deb7de8

Please sign in to comment.