All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: [PATCH 03/11] NFSv4.1: add callback to nfs4_commit_done
Date: Wed, 23 Mar 2011 08:30:04 -0400	[thread overview]
Message-ID: <1300883412-32296-4-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1300883412-32296-1-git-send-email-iisaman@netapp.com>

Add a callback that the pnfs layout driver can use to do its own
error handling of the data server's COMMIT response.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4proc.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1d84e70..bcc29bd 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3195,12 +3195,9 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
 	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
 }
 
-static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
+static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *data)
 {
 	struct inode *inode = data->inode;
-	
-	if (!nfs4_sequence_done(task, &data->res.seq_res))
-		return -EAGAIN;
 
 	if (nfs4_async_handle_error(task, NFS_SERVER(inode), NULL) == -EAGAIN) {
 		nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
@@ -3210,11 +3207,20 @@ static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
 	return 0;
 }
 
+static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
+{
+	if (!nfs4_sequence_done(task, &data->res.seq_res))
+		return -EAGAIN;
+	return data->write_done_cb(task, data);
+}
+
 static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
 {
 	struct nfs_server *server = NFS_SERVER(data->inode);
 	
 	data->args.bitmask = server->cache_consistency_bitmask;
+	if (!data->write_done_cb)
+		data->write_done_cb = nfs4_commit_done_cb;
 	data->res.server = server;
 	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
 }
-- 
1.7.2.1


  parent reply	other threads:[~2011-03-23 12:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 12:30 [PATCH 00/11] NFSv4.1 pnfs wave5 submission Fred Isaman
2011-03-23 12:30 ` [PATCH 01/11] NFSv4.1: don't send COMMIT to ds for data sync writes Fred Isaman
2011-03-23 12:30 ` [PATCH 02/11] NFSv4.1: rearrange nfs_commit_rpcsetup Fred Isaman
2011-03-23 12:30 ` Fred Isaman [this message]
2011-03-23 12:30 ` [PATCH 04/11] NFSv4.1: pull error handling out of nfs_commit_list Fred Isaman
2011-03-23 12:30 ` [PATCH 05/11] NFSv4.1: pull out code from nfs_commit_release Fred Isaman
2011-03-23 12:30 ` [PATCH 06/11] NFSv4.1: shift filelayout_free_lseg Fred Isaman
2011-03-23 12:30 ` [PATCH 07/11] NFSv4.1: alloc and free commit_buckets Fred Isaman
2011-03-23 12:30 ` [PATCH 08/11] NFSv4.1: add generic layer hooks for pnfs COMMIT Fred Isaman
2011-03-23 12:30 ` [PATCH 09/11] NFSv4.1: remove GETATTR from ds commits Fred Isaman
2011-03-23 12:30 ` [PATCH 10/11] NFSv4.1: filelayout driver specific code for COMMIT Fred Isaman
2011-03-23 12:30 ` [PATCH 11/11] NFSv4.1 remove temp code that prevented ds commits Fred Isaman

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=1300883412-32296-4-git-send-email-iisaman@netapp.com \
    --to=iisaman@netapp.com \
    --cc=Trond.Myklebust@netapp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.