aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-11-12 12:17:03 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-11-26 16:32:40 -0500
commit02fe494619d525ea803ab1f4f671186dc8a52f7a (patch)
treefbbb37ca394e736b979254f811b10da888cbeca2
parentb9148c6b80d802dbc2a7530b29915a80432e50c7 (diff)
NFS: Clean up new multi-segment direct I/O changes
Simplify calling sequence of nfs_direct_{read,write}_schedule(), and rename them to reflect their new role. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/direct.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 4d726e9db295..5e8d82f6666b 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -263,10 +263,14 @@ static const struct rpc_call_ops nfs_read_direct_ops = {
263 * handled automatically by nfs_direct_read_result(). Otherwise, if 263 * handled automatically by nfs_direct_read_result(). Otherwise, if
264 * no requests have been sent, just return an error. 264 * no requests have been sent, just return an error.
265 */ 265 */
266static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos) 266static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
267 const struct iovec *iov,
268 loff_t pos)
267{ 269{
268 struct nfs_open_context *ctx = dreq->ctx; 270 struct nfs_open_context *ctx = dreq->ctx;
269 struct inode *inode = ctx->path.dentry->d_inode; 271 struct inode *inode = ctx->path.dentry->d_inode;
272 unsigned long user_addr = (unsigned long)iov->iov_base;
273 size_t count = iov->iov_len;
270 size_t rsize = NFS_SERVER(inode)->rsize; 274 size_t rsize = NFS_SERVER(inode)->rsize;
271 unsigned int pgbase; 275 unsigned int pgbase;
272 int result; 276 int result;
@@ -363,9 +367,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
363 367
364 for (seg = 0; seg < nr_segs; seg++) { 368 for (seg = 0; seg < nr_segs; seg++) {
365 const struct iovec *vec = &iov[seg]; 369 const struct iovec *vec = &iov[seg];
366 result = nfs_direct_read_schedule(dreq, 370 result = nfs_direct_read_schedule_segment(dreq, vec, pos);
367 (unsigned long)vec->iov_base,
368 vec->iov_len, pos);
369 if (result < 0) 371 if (result < 0)
370 break; 372 break;
371 requested_bytes += result; 373 requested_bytes += result;
@@ -631,10 +633,14 @@ static const struct rpc_call_ops nfs_write_direct_ops = {
631 * handled automatically by nfs_direct_write_result(). Otherwise, if 633 * handled automatically by nfs_direct_write_result(). Otherwise, if
632 * no requests have been sent, just return an error. 634 * no requests have been sent, just return an error.
633 */ 635 */
634static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos, int sync) 636static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
637 const struct iovec *iov,
638 loff_t pos, int sync)
635{ 639{
636 struct nfs_open_context *ctx = dreq->ctx; 640 struct nfs_open_context *ctx = dreq->ctx;
637 struct inode *inode = ctx->path.dentry->d_inode; 641 struct inode *inode = ctx->path.dentry->d_inode;
642 unsigned long user_addr = (unsigned long)iov->iov_base;
643 size_t count = iov->iov_len;
638 size_t wsize = NFS_SERVER(inode)->wsize; 644 size_t wsize = NFS_SERVER(inode)->wsize;
639 unsigned int pgbase; 645 unsigned int pgbase;
640 int result; 646 int result;
@@ -735,10 +741,8 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
735 741
736 for (seg = 0; seg < nr_segs; seg++) { 742 for (seg = 0; seg < nr_segs; seg++) {
737 const struct iovec *vec = &iov[seg]; 743 const struct iovec *vec = &iov[seg];
738 result = nfs_direct_write_schedule(dreq, 744 result = nfs_direct_write_schedule_segment(dreq, vec,
739 (unsigned long)vec->iov_base, 745 pos, sync);
740 vec->iov_len,
741 pos, sync);
742 if (result < 0) 746 if (result < 0)
743 break; 747 break;
744 requested_bytes += result; 748 requested_bytes += result;