All of lore.kernel.org
 help / color / mirror / Atom feed
From: andros@netapp.com
To: trond.myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH Version 2 01/12] NFSv4.1 move nfs4_reset_read and nfs_reset_write
Date: Wed, 21 Mar 2012 15:46:13 -0400	[thread overview]
Message-ID: <1332359184-1887-2-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1332359184-1887-1-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

Only called by the file layout code

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/internal.h       |    5 +++--
 fs/nfs/nfs4filelayout.c |   35 +++++++++++++++++++++++++++++++++--
 fs/nfs/nfs4proc.c       |   39 ++++-----------------------------------
 3 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 2476dc6..f9ac1f0 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -344,13 +344,14 @@ extern int nfs_migrate_page(struct address_space *,
 
 /* nfs4proc.c */
 extern void __nfs4_read_done_cb(struct nfs_read_data *);
-extern void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data);
+extern int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data);
+extern int nfs4_write_done_cb(struct rpc_task *task,
+			      struct nfs_write_data *data);
 extern int nfs4_init_client(struct nfs_client *clp,
 			    const struct rpc_timeout *timeparms,
 			    const char *ip_addr,
 			    rpc_authflavor_t authflavour,
 			    int noresvport);
-extern void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data);
 extern int _nfs4_call_sync(struct rpc_clnt *clnt,
 			   struct nfs_server *server,
 			   struct rpc_message *msg,
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 634c0bc..36a65ce 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -82,6 +82,37 @@ filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset)
 	BUG();
 }
 
+/* Reset the the nfs_write_data to send the write to the MDS. */
+void filelayout_reset_write(struct rpc_task *task, struct nfs_write_data *data)
+{
+	dprintk("%s Reset task for i/o through MDS\n", __func__);
+	put_lseg(data->lseg);
+	data->lseg          = NULL;
+	data->ds_clp        = NULL;
+	data->write_done_cb = nfs4_write_done_cb;
+	data->args.fh       = NFS_FH(data->inode);
+	data->args.bitmask  = data->res.server->cache_consistency_bitmask;
+	data->args.offset   = data->mds_offset;
+	data->res.fattr     = &data->fattr;
+	task->tk_ops        = data->mds_ops;
+	rpc_task_reset_client(task, NFS_CLIENT(data->inode));
+}
+
+/* Reset the the nfs_read_data to send the read to the MDS. */
+void filelayout_reset_read(struct rpc_task *task, struct nfs_read_data *data)
+{
+	dprintk("%s Reset task for i/o through MDS\n", __func__);
+	put_lseg(data->lseg);
+	data->lseg         = NULL;
+	/* offsets will differ in the dense stripe case */
+	data->args.offset  = data->mds_offset;
+	data->ds_clp       = NULL;
+	data->args.fh      = NFS_FH(data->inode);
+	data->read_done_cb = nfs4_read_done_cb;
+	task->tk_ops = data->mds_ops;
+	rpc_task_reset_client(task, NFS_CLIENT(data->inode));
+}
+
 static int filelayout_async_handle_error(struct rpc_task *task,
 					 struct nfs4_state *state,
 					 struct nfs_client *clp,
@@ -158,7 +189,7 @@ static int filelayout_read_done_cb(struct rpc_task *task,
 			__func__, data->ds_clp, data->ds_clp->cl_session);
 		if (reset) {
 			pnfs_set_lo_fail(data->lseg);
-			nfs4_reset_read(task, data);
+			filelayout_reset_read(task, data);
 		}
 		rpc_restart_call_prepare(task);
 		return -EAGAIN;
@@ -239,7 +270,7 @@ static int filelayout_write_done_cb(struct rpc_task *task,
 			__func__, data->ds_clp, data->ds_clp->cl_session);
 		if (reset) {
 			pnfs_set_lo_fail(data->lseg);
-			nfs4_reset_write(task, data);
+			filelayout_reset_write(task, data);
 		}
 		rpc_restart_call_prepare(task);
 		return -EAGAIN;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b76dd0e..f3c67db 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3284,7 +3284,7 @@ void __nfs4_read_done_cb(struct nfs_read_data *data)
 	nfs_invalidate_atime(data->inode);
 }
 
-static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data)
+int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data)
 {
 	struct nfs_server *server = NFS_SERVER(data->inode);
 
@@ -3298,6 +3298,7 @@ static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data)
 		renew_lease(server, data->timestamp);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(nfs4_read_done_cb);
 
 static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
 {
@@ -3329,23 +3330,7 @@ static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_da
 	rpc_call_start(task);
 }
 
-/* Reset the the nfs_read_data to send the read to the MDS. */
-void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data)
-{
-	dprintk("%s Reset task for i/o through\n", __func__);
-	put_lseg(data->lseg);
-	data->lseg = NULL;
-	/* offsets will differ in the dense stripe case */
-	data->args.offset = data->mds_offset;
-	data->ds_clp = NULL;
-	data->args.fh     = NFS_FH(data->inode);
-	data->read_done_cb = nfs4_read_done_cb;
-	task->tk_ops = data->mds_ops;
-	rpc_task_reset_client(task, NFS_CLIENT(data->inode));
-}
-EXPORT_SYMBOL_GPL(nfs4_reset_read);
-
-static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data)
+int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data)
 {
 	struct inode *inode = data->inode;
 	
@@ -3359,6 +3344,7 @@ static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(nfs4_write_done_cb);
 
 static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
 {
@@ -3368,23 +3354,6 @@ static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
 		nfs4_write_done_cb(task, data);
 }
 
-/* Reset the the nfs_write_data to send the write to the MDS. */
-void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data)
-{
-	dprintk("%s Reset task for i/o through\n", __func__);
-	put_lseg(data->lseg);
-	data->lseg          = NULL;
-	data->ds_clp        = NULL;
-	data->write_done_cb = nfs4_write_done_cb;
-	data->args.fh       = NFS_FH(data->inode);
-	data->args.bitmask  = data->res.server->cache_consistency_bitmask;
-	data->args.offset   = data->mds_offset;
-	data->res.fattr     = &data->fattr;
-	task->tk_ops        = data->mds_ops;
-	rpc_task_reset_client(task, NFS_CLIENT(data->inode));
-}
-EXPORT_SYMBOL_GPL(nfs4_reset_write);
-
 static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
 {
 	struct nfs_server *server = NFS_SERVER(data->inode);
-- 
1.7.6.4


  reply	other threads:[~2012-03-21 19:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 19:46 [PATCH Version 2 00/12] NFSv4.1 file layout data server quick failover andros
2012-03-21 19:46 ` andros [this message]
2012-03-21 19:46 ` [PATCH Version 2 02/12] NFSv4.1: cleanup filelayout invalid deviceid handling andros
2012-03-21 19:46 ` [PATCH Version 2 03/12] NFSv4.1 cleanup filelayout invalid layout handling andros
2012-03-21 19:46 ` [PATCH Version 2 04/12] NFSv4.1 set RPC_TASK_SOFTCONN for filelayout DS RPC calls andros
2012-03-21 19:46 ` [PATCH Version 2 05/12] NFSv4.1: mark deviceid invalid on filelayout DS connection errors andros
2012-03-21 20:39   ` Myklebust, Trond
2012-03-22 13:23     ` Adamson, Andy
2012-03-22 13:44       ` Myklebust, Trond
2012-03-22 13:53         ` Andy Adamson
2012-03-21 19:46 ` [PATCH Version 2 06/12] NFSv4.1: send filelayout DS commits to the MDS on invalid deviceid andros
2012-03-21 19:46 ` [PATCH Version 2 07/12] NFSv4.1 Check invalid deviceid upon slot table waitq wakeup andros
2012-03-21 19:46 ` [PATCH Version 2 08/12] NFSv4.1 wake up all tasks on un-connected DS slot table waitq andros
2012-03-21 19:46 ` [PATCH Version 2 09/12] NFSv4.1 ref count nfs_client across filelayout data server io andros
2012-03-21 19:46 ` [PATCH Version 2 10/12] NFSv4.1 de reference a disconnected data server client record andros
2012-03-21 19:46 ` [PATCH Version 2 11/12] NFSv4.1 check for NULL pnfs_layout_hdr in pnfs scan commit lists andros
2012-03-21 19:46 ` [PATCH Version 2 12/12] NFSv4.1 have filelayout_initiate_commit return void andros
2012-03-21 20:47   ` Myklebust, Trond
2012-03-25 14:59     ` 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=1332359184-1887-2-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /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.