All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 4/7] wave4: nfs: rearrange nfs4_write_done
Date: Fri, 11 Feb 2011 11:54:36 -0500	[thread overview]
Message-ID: <1297443279-19813-5-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1297443279-19813-1-git-send-email-iisaman@netapp.com>

Add hook that layout driver can use to take control here.

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

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a40a281..3952f7c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3122,13 +3122,10 @@ void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data)
 }
 EXPORT_SYMBOL_GPL(nfs4_reset_read);
 
-static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
+static int nfs4_write_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), data->args.context->state) == -EAGAIN) {
 		nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
 		return -EAGAIN;
@@ -3140,6 +3137,13 @@ static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
 	return 0;
 }
 
+static int nfs4_write_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_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
 {
 	struct nfs_server *server = NFS_SERVER(data->inode);
@@ -3149,6 +3153,8 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
 		data->res.fattr = NULL;
 	} else
 		data->args.bitmask = server->cache_consistency_bitmask;
+	if (!data->write_done_cb)
+		data->write_done_cb = nfs4_write_done_cb;
 	data->res.server = server;
 	data->timestamp   = jiffies;
 
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 726ec2a..23feaf6 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1040,6 +1040,7 @@ struct nfs_write_data {
 	struct nfs_writeres	res;		/* result struct */
 	struct pnfs_layout_segment *lseg;
 	struct nfs_client	*ds_clp;	/* pNFS data server */
+	int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
 #ifdef CONFIG_NFS_V4
 	unsigned long		timestamp;	/* For lease renewal */
 #endif
-- 
1.7.2.1


  parent reply	other threads:[~2011-02-11 16:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 16:54 [PATCH 0/7] pnfs wave 4 proposal Fred Isaman
2011-02-11 16:54 ` [PATCH 1/7] wave4: nfs: rearrange nfs_write_rpcsetup Fred Isaman
2011-02-14 17:22   ` Andy Adamson
2011-02-14 17:27     ` Fred Isaman
2011-02-14 18:11       ` William A. (Andy) Adamson
2011-02-11 16:54 ` [PATCH 2/7] wave4: Send lseg down through nfs_write_rpcsetup into nfs_initiate_write Fred Isaman
2011-02-11 16:54 ` [PATCH 3/7] wave4: remove GETATTR from ds write Fred Isaman
2011-02-11 16:54 ` Fred Isaman [this message]
2011-02-11 16:54 ` [PATCH 5/7] wave4: implement pnfs_try_to_write_data Fred Isaman
2011-02-11 16:54 ` [PATCH 6/7] wave4: filelayout write Fred Isaman
2011-02-11 16:54 ` [PATCH 7/7] wave4: nfs_pageio_do_add_request needs to distinguish between read and write Fred Isaman
2011-02-11 22:15   ` pNFS files server? Daniel.Muntz
2011-02-14 17:20     ` Andy Adamson
2011-02-11 20:19 ` [PATCH 0/7] pnfs wave 4 proposal Andy Adamson
2011-02-11 20:32   ` 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=1297443279-19813-5-git-send-email-iisaman@netapp.com \
    --to=iisaman@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.