From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v1 09/19] NFS: Add a "struct nfs_server *" argument to nfs4_sequence_done()
Date: Fri, 12 Jul 2013 12:32:45 -0400 [thread overview]
Message-ID: <20130712163245.1444.48096.stgit@seurat.1015granger.net> (raw)
In-Reply-To: <20130712155303.1444.62697.stgit@seurat.1015granger.net>
For NFSv4.1, a session slot table reference is passed to
nfs4_sequence_done().
For NFSv4.0, transport state is managed in the nfs_client that owns
this nfs_server. The nfs_server struct must be passed to
nfs4_sequence_done() to make it available to the functions dealing
with transport blocking.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/nfs/nfs4proc.c | 46 ++++++++++++++++++++++++++--------------------
1 file changed, 26 insertions(+), 20 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0c1fa13..20768e8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -553,8 +553,9 @@ out_retry:
return 0;
}
-static int nfs4_sequence_done(struct rpc_task *task,
- struct nfs4_sequence_res *res)
+static int nfs4_sequence_done(const struct nfs_server *server,
+ struct rpc_task *task,
+ struct nfs4_sequence_res *res)
{
if (res->sr_slot == NULL)
return 1;
@@ -726,8 +727,9 @@ static int nfs4_setup_sequence(const struct nfs_server *server,
return 0;
}
-static int nfs4_sequence_done(struct rpc_task *task,
- struct nfs4_sequence_res *res)
+static int nfs4_sequence_done(const struct nfs_server *server,
+ struct rpc_task *task,
+ struct nfs4_sequence_res *res)
{
return 1;
}
@@ -745,7 +747,7 @@ static void nfs40_call_sync_done(struct rpc_task *task, void *calldata)
{
struct nfs4_call_sync_data *data = calldata;
- nfs4_sequence_done(task, data->seq_res);
+ nfs4_sequence_done(data->seq_server, task, data->seq_res);
}
static const struct rpc_call_ops nfs40_call_sync_ops = {
@@ -1622,7 +1624,7 @@ unlock_no_action:
out_no_action:
task->tk_action = NULL;
out_wait:
- nfs4_sequence_done(task, &data->o_res.seq_res);
+ nfs4_sequence_done(data->o_arg.server, task, &data->o_res.seq_res);
}
static void nfs4_open_done(struct rpc_task *task, void *calldata)
@@ -1631,7 +1633,7 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata)
data->rpc_status = task->tk_status;
- if (!nfs4_sequence_done(task, &data->o_res.seq_res))
+ if (!nfs4_sequence_done(data->o_arg.server, task, &data->o_res.seq_res))
return;
if (task->tk_status == 0) {
@@ -2294,7 +2296,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
struct nfs_server *server = NFS_SERVER(calldata->inode);
dprintk("%s: begin!\n", __func__);
- if (!nfs4_sequence_done(task, &calldata->res.seq_res))
+ if (!nfs4_sequence_done(server, task, &calldata->res.seq_res))
return;
/* hmm. we are done with the inode, and in the process of freeing
* the state_owner. we keep this around to process errors
@@ -2381,7 +2383,7 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
out_no_action:
task->tk_action = NULL;
out_wait:
- nfs4_sequence_done(task, &calldata->res.seq_res);
+ nfs4_sequence_done(NFS_SERVER(inode), task, &calldata->res.seq_res);
}
static const struct rpc_call_ops nfs4_close_ops = {
@@ -3149,7 +3151,7 @@ static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
struct nfs_removeres *res = task->tk_msg.rpc_resp;
- if (!nfs4_sequence_done(task, &res->seq_res))
+ if (!nfs4_sequence_done(res->server, task, &res->seq_res))
return 0;
if (nfs4_async_handle_error(task, res->server, NULL) == -EAGAIN)
return 0;
@@ -3181,7 +3183,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
{
struct nfs_renameres *res = task->tk_msg.rpc_resp;
- if (!nfs4_sequence_done(task, &res->seq_res))
+ if (!nfs4_sequence_done(res->server, task, &res->seq_res))
return 0;
if (nfs4_async_handle_error(task, res->server, NULL) == -EAGAIN)
return 0;
@@ -3705,10 +3707,11 @@ static bool nfs4_read_stateid_changed(struct rpc_task *task,
static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
{
+ struct nfs_server *server = NFS_SERVER(data->header->inode);
dprintk("--> %s\n", __func__);
- if (!nfs4_sequence_done(task, &data->res.seq_res))
+ if (!nfs4_sequence_done(server, task, &data->res.seq_res))
return -EAGAIN;
if (nfs4_read_stateid_changed(task, &data->args))
return -EAGAIN;
@@ -3753,7 +3756,6 @@ static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data
static bool nfs4_write_stateid_changed(struct rpc_task *task,
struct nfs_writeargs *args)
{
-
if (!nfs4_error_stateid_expired(task->tk_status) ||
nfs4_stateid_is_current(&args->stateid,
args->context,
@@ -3766,7 +3768,9 @@ static bool nfs4_write_stateid_changed(struct rpc_task *task,
static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
{
- if (!nfs4_sequence_done(task, &data->res.seq_res))
+ struct nfs_server *server = NFS_SERVER(data->header->inode);
+
+ if (!nfs4_sequence_done(server, task, &data->res.seq_res))
return -EAGAIN;
if (nfs4_write_stateid_changed(task, &data->args))
return -EAGAIN;
@@ -3839,7 +3843,9 @@ static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_commit_data *da
static int nfs4_commit_done(struct rpc_task *task, struct nfs_commit_data *data)
{
- if (!nfs4_sequence_done(task, &data->res.seq_res))
+ struct nfs_server *server = NFS_SERVER(data->inode);
+
+ if (!nfs4_sequence_done(server, task, &data->res.seq_res))
return -EAGAIN;
return data->commit_done_cb(task, data);
}
@@ -4439,7 +4445,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
{
struct nfs4_delegreturndata *data = calldata;
- if (!nfs4_sequence_done(task, &data->res.seq_res))
+ if (!nfs4_sequence_done(data->res.server, task, &data->res.seq_res))
return;
switch (task->tk_status) {
@@ -4690,7 +4696,7 @@ static void nfs4_locku_done(struct rpc_task *task, void *data)
{
struct nfs4_unlockdata *calldata = data;
- if (!nfs4_sequence_done(task, &calldata->res.seq_res))
+ if (!nfs4_sequence_done(calldata->server, task, &calldata->res.seq_res))
return;
switch (task->tk_status) {
case 0:
@@ -4730,7 +4736,7 @@ static void nfs4_locku_prepare(struct rpc_task *task, void *data)
out_no_action:
task->tk_action = NULL;
out_wait:
- nfs4_sequence_done(task, &calldata->res.seq_res);
+ nfs4_sequence_done(calldata->server, task, &calldata->res.seq_res);
}
static const struct rpc_call_ops nfs4_locku_ops = {
@@ -4905,7 +4911,7 @@ out_release_open_seqid:
out_release_lock_seqid:
nfs_release_seqid(data->arg.lock_seqid);
out_wait:
- nfs4_sequence_done(task, &data->res.seq_res);
+ nfs4_sequence_done(data->server, task, &data->res.seq_res);
dprintk("%s: done!, ret = %d\n", __func__, data->rpc_status);
}
@@ -4915,7 +4921,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
dprintk("%s: begin!\n", __func__);
- if (!nfs4_sequence_done(task, &data->res.seq_res))
+ if (!nfs4_sequence_done(data->server, task, &data->res.seq_res))
return;
data->rpc_status = task->tk_status;
next prev parent reply other threads:[~2013-07-12 16:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-12 16:31 [PATCH v1 00/19] NFSv4 migration Chuck Lever
2013-07-12 16:31 ` [PATCH v1 01/19] NFS: Never use user credentials for lease renewal Chuck Lever
2013-07-22 18:33 ` Myklebust, Trond
2013-07-22 18:52 ` Chuck Lever
2013-07-22 18:53 ` Myklebust, Trond
2013-07-22 18:56 ` Chuck Lever
2013-07-12 16:31 ` [PATCH v1 02/19] NFS: Fix return type of nfs4_end_drain_session() stub Chuck Lever
2013-07-12 16:31 ` [PATCH v1 03/19] NFS: Introduce a vector of migration recovery ops Chuck Lever
2013-07-12 16:32 ` [PATCH v1 04/19] NFS: Refactor nfs4_call_data_sequence() Chuck Lever
2013-07-22 19:08 ` Myklebust, Trond
2013-07-12 16:32 ` [PATCH v1 05/19] NFS: Rename nfs41_call_sync_data as a common data structure Chuck Lever
2013-07-12 16:32 ` [PATCH v1 06/19] NFS: Clean up nfs4_setup_sequence() Chuck Lever
2013-07-12 16:32 ` [PATCH v1 07/19] NFS: Fix compiler warning in nfs_setup_sequence() Chuck Lever
2013-07-22 19:03 ` Myklebust, Trond
2013-07-22 20:16 ` Chuck Lever
2013-07-22 20:22 ` Myklebust, Trond
2013-07-22 20:24 ` Chuck Lever
2013-07-12 16:32 ` [PATCH v1 08/19] NFS: Use RPC callouts to start NFSv4.0 synchronous requests Chuck Lever
2013-07-12 16:32 ` Chuck Lever [this message]
2013-07-22 19:27 ` [PATCH v1 09/19] NFS: Add a "struct nfs_server *" argument to nfs4_sequence_done() Myklebust, Trond
2013-07-24 22:04 ` Chuck Lever
2013-07-12 16:32 ` [PATCH v1 10/19] NFS: Implement a transport blocking scheme for migration Chuck Lever
2013-07-12 16:33 ` [PATCH v1 11/19] SUNRPC: Add a helper to switch the transport of an rpc_clnt Chuck Lever
2013-07-12 16:33 ` [PATCH v1 12/19] NFS: Add a super_block backpointer to the nfs_server struct Chuck Lever
2013-07-12 16:33 ` [PATCH v1 13/19] NFS: Add functions to swap transports during migration recovery Chuck Lever
2013-07-12 16:33 ` [PATCH v1 14/19] NFS: Add method to retrieve fs_locations " Chuck Lever
2013-07-12 16:33 ` [PATCH v1 15/19] NFS: Add basic migration support to state manager thread Chuck Lever
2013-07-12 16:33 ` [PATCH v1 16/19] NFS: Add migration recovery callouts in nfs4proc.c Chuck Lever
2013-07-12 16:33 ` [PATCH v1 17/19] NFS: Add method to detect whether an FSID is still on the server Chuck Lever
2013-07-12 16:34 ` [PATCH v1 18/19] NFS: Implement support for NFS4ERR_LEASE_MOVED Chuck Lever
2013-07-12 16:34 ` [PATCH v1 19/19] NFS: Set EXCHGID4_FLAG_SUPP_MOVED_MIGR Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130712163245.1444.48096.stgit@seurat.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).