Commit 56d03a52 authored by Trond Myklebust's avatar Trond Myklebust

[PATCH] A basic NFSv4 client for 2.5.x

Now that all calls to nfs_async_handle_jukebox() have been moved to
fs/nfs/nfs3proc.c, we clean up by moving the nfs_async_jukebox() routine
itself there.  We also rename it nfs3_async_handle_jukebox(), to be
consistent with the naming conventions of that file.
parent be6b809b
...@@ -54,6 +54,17 @@ nfs3_rpc_call_wrapper(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, i ...@@ -54,6 +54,17 @@ nfs3_rpc_call_wrapper(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, i
#define rpc_call_sync(clnt, msg, flags) \ #define rpc_call_sync(clnt, msg, flags) \
nfs3_rpc_wrapper(clnt, msg, flags) nfs3_rpc_wrapper(clnt, msg, flags)
static int
nfs3_async_handle_jukebox(struct rpc_task *task)
{
if (task->tk_status != -EJUKEBOX)
return 0;
task->tk_status = 0;
rpc_restart_call(task);
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
return 1;
}
/* /*
* Bare-bones access to getattr: this is for nfs_read_super. * Bare-bones access to getattr: this is for nfs_read_super.
*/ */
...@@ -398,7 +409,7 @@ nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task) ...@@ -398,7 +409,7 @@ nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
struct rpc_message *msg = &task->tk_msg; struct rpc_message *msg = &task->tk_msg;
struct nfs_fattr *dir_attr; struct nfs_fattr *dir_attr;
if (nfs_async_handle_jukebox(task)) if (nfs3_async_handle_jukebox(task))
return 1; return 1;
if (msg->rpc_argp) { if (msg->rpc_argp) {
dir_attr = (struct nfs_fattr*)msg->rpc_resp; dir_attr = (struct nfs_fattr*)msg->rpc_resp;
...@@ -656,7 +667,7 @@ nfs3_read_done(struct rpc_task *task) ...@@ -656,7 +667,7 @@ nfs3_read_done(struct rpc_task *task)
{ {
struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata; struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata;
if (nfs_async_handle_jukebox(task)) if (nfs3_async_handle_jukebox(task))
return; return;
nfs_readpage_result(task, data->u.v3.res.count, data->u.v3.res.eof); nfs_readpage_result(task, data->u.v3.res.count, data->u.v3.res.eof);
} }
...@@ -701,7 +712,7 @@ nfs3_write_done(struct rpc_task *task) ...@@ -701,7 +712,7 @@ nfs3_write_done(struct rpc_task *task)
{ {
struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata; struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
if (nfs_async_handle_jukebox(task)) if (nfs3_async_handle_jukebox(task))
return; return;
nfs_writeback_done(task, data->u.v3.args.stable, nfs_writeback_done(task, data->u.v3.args.stable,
data->u.v3.args.count, data->u.v3.res.count); data->u.v3.args.count, data->u.v3.res.count);
...@@ -755,7 +766,7 @@ nfs3_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how) ...@@ -755,7 +766,7 @@ nfs3_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how)
static void static void
nfs3_commit_done(struct rpc_task *task) nfs3_commit_done(struct rpc_task *task)
{ {
if (nfs_async_handle_jukebox(task)) if (nfs3_async_handle_jukebox(task))
return; return;
nfs_commit_done(task); nfs_commit_done(task);
} }
......
...@@ -470,28 +470,7 @@ extern void * nfs_root_data(void); ...@@ -470,28 +470,7 @@ extern void * nfs_root_data(void);
__retval; \ __retval; \
}) })
#ifdef CONFIG_NFS_V3
#define NFS_JUKEBOX_RETRY_TIME (5 * HZ) #define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
static inline int
nfs_async_handle_jukebox(struct rpc_task *task)
{
if (task->tk_status != -EJUKEBOX)
return 0;
task->tk_status = 0;
rpc_restart_call(task);
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
return 1;
}
#else
static inline int
nfs_async_handle_jukebox(struct rpc_task *task)
{
return 0;
}
#endif /* CONFIG_NFS_V3 */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
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