[pnfs] [PATCH] [SQUASHME] pnfs: client write with no getattr

Benny Halevy bhalevy at lt.bhalevy.com
Tue May 6 18:24:41 EDT 2008


From: Andy Adamson <andros at umich.edu>

bhalevy: resurrected pnfs4_proc_write_setup

Signed-off by: Andy Adamson<andros at umich.edu>
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfs/nfs4proc.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

--

Dean this should do the trick.
Mind testing this patch?

Benny

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index cd1eee8..99369d6 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3171,6 +3171,23 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa
 	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
 }
 
+#if defined(CONFIG_PNFS)
+/*
+ * pNFS does not send a getattr on write.
+ */
+static void pnfs4_proc_write_setup(struct nfs_write_data *data,
+				   struct rpc_message *msg)
+{
+	struct nfs_server *server = NFS_SERVER(data->inode);
+
+	data->args.bitmask = server->attr_bitmask;
+	data->res.server = server;
+	data->timestamp   = jiffies;
+
+	msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_PNFS_WRITE];
+}
+#endif /* CONFIG_PNFS */
+
 /*
  * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special
  * standalone procedure for queueing an asynchronous RENEW.
@@ -5603,7 +5620,7 @@ const struct nfs_rpc_ops pnfs_v41_clientops = {
 	.decode_dirent	= nfs4_decode_dirent,
 	.read_setup	= nfs4_proc_read_setup,
 	.read_done	= pnfs4_read_done,
-	.write_setup	= nfs4_proc_write_setup,
+	.write_setup	= pnfs4_proc_write_setup,
 	.write_done	= pnfs4_write_done,
 	.commit_setup	= nfs4_proc_commit_setup,
 	.commit_done	= pnfs4_commit_done,
-- 
1.5.3.3



More information about the pNFS mailing list