aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-06-20 15:53:47 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-06-29 11:46:46 -0400
commit1abb50886afe8a126705c93dab2b50c1252a9c19 (patch)
tree484ae821c5b5b1a7dee221e9eba41119a27a3fb1 /fs/nfs/read.c
parent6663ee7f8187708143255c057bc132bbc84c1894 (diff)
NFS: Create an read_pageio_init() function
pNFS needs to select a read function based on the layout driver currently in use, so I let each NFS version decide how to best handle initializing reads. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 86ced7836214..6267b873bbcb 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -20,8 +20,6 @@
20#include <linux/nfs_page.h> 20#include <linux/nfs_page.h>
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#include "pnfs.h"
24
25#include "nfs4_fs.h" 23#include "nfs4_fs.h"
26#include "internal.h" 24#include "internal.h"
27#include "iostat.h" 25#include "iostat.h"
@@ -108,7 +106,7 @@ int nfs_return_empty_page(struct page *page)
108 return 0; 106 return 0;
109} 107}
110 108
111void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, 109void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
112 struct inode *inode, 110 struct inode *inode,
113 const struct nfs_pgio_completion_ops *compl_ops) 111 const struct nfs_pgio_completion_ops *compl_ops)
114{ 112{
@@ -123,14 +121,6 @@ void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio)
123} 121}
124EXPORT_SYMBOL_GPL(nfs_pageio_reset_read_mds); 122EXPORT_SYMBOL_GPL(nfs_pageio_reset_read_mds);
125 123
126void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
127 struct inode *inode,
128 const struct nfs_pgio_completion_ops *compl_ops)
129{
130 if (!pnfs_pageio_init_read(pgio, inode, compl_ops))
131 nfs_pageio_init_read_mds(pgio, inode, compl_ops);
132}
133
134int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode, 124int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
135 struct page *page) 125 struct page *page)
136{ 126{
@@ -149,7 +139,7 @@ int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
149 if (len < PAGE_CACHE_SIZE) 139 if (len < PAGE_CACHE_SIZE)
150 zero_user_segment(page, len, PAGE_CACHE_SIZE); 140 zero_user_segment(page, len, PAGE_CACHE_SIZE);
151 141
152 nfs_pageio_init_read(&pgio, inode, &nfs_async_read_completion_ops); 142 NFS_PROTO(inode)->read_pageio_init(&pgio, inode, &nfs_async_read_completion_ops);
153 nfs_pageio_add_request(&pgio, new); 143 nfs_pageio_add_request(&pgio, new);
154 nfs_pageio_complete(&pgio); 144 nfs_pageio_complete(&pgio);
155 NFS_I(inode)->read_io += pgio.pg_bytes_written; 145 NFS_I(inode)->read_io += pgio.pg_bytes_written;
@@ -652,7 +642,7 @@ int nfs_readpages(struct file *filp, struct address_space *mapping,
652 if (ret == 0) 642 if (ret == 0)
653 goto read_complete; /* all pages were read */ 643 goto read_complete; /* all pages were read */
654 644
655 nfs_pageio_init_read(&pgio, inode, &nfs_async_read_completion_ops); 645 NFS_PROTO(inode)->read_pageio_init(&pgio, inode, &nfs_async_read_completion_ops);
656 646
657 ret = read_cache_pages(mapping, pages, readpage_async_filler, &desc); 647 ret = read_cache_pages(mapping, pages, readpage_async_filler, &desc);
658 648