aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-06-10 13:30:23 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-07-12 13:40:28 -0400
commit1751c3638f2a07a8c66a803a31791bab9bd3fced (patch)
tree5c1f39f879c0a0049c50b4f36a256ba1986d82b2 /fs/nfs/pagelist.c
parentf062eb6ced3b297277b94b4da3113b1d3782e539 (diff)
NFS: Cleanup of the nfs_pageio code in preparation for a pnfs bugfix
We need to ensure that the layouts are set up before we can decide to coalesce requests. To do so, we want to further split up the struct nfs_pageio_descriptor operations into an initialisation callback, a coalescing test callback, and a 'do i/o' callback. This patch cleans up the existing callback methods before adding the 'initialisation' callback. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 009855716286..9b8a4730f0bd 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -230,7 +230,7 @@ EXPORT_SYMBOL_GPL(nfs_generic_pg_test);
230 */ 230 */
231void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 231void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
232 struct inode *inode, 232 struct inode *inode,
233 int (*doio)(struct nfs_pageio_descriptor *), 233 const struct nfs_pageio_ops *pg_ops,
234 size_t bsize, 234 size_t bsize,
235 int io_flags) 235 int io_flags)
236{ 236{
@@ -241,12 +241,10 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
241 desc->pg_base = 0; 241 desc->pg_base = 0;
242 desc->pg_moreio = 0; 242 desc->pg_moreio = 0;
243 desc->pg_inode = inode; 243 desc->pg_inode = inode;
244 desc->pg_doio = doio; 244 desc->pg_ops = pg_ops;
245 desc->pg_ioflags = io_flags; 245 desc->pg_ioflags = io_flags;
246 desc->pg_error = 0; 246 desc->pg_error = 0;
247 desc->pg_lseg = NULL; 247 desc->pg_lseg = NULL;
248 desc->pg_test = nfs_generic_pg_test;
249 pnfs_pageio_init(desc, inode);
250} 248}
251 249
252/** 250/**
@@ -276,7 +274,7 @@ static bool nfs_can_coalesce_requests(struct nfs_page *prev,
276 return false; 274 return false;
277 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE) 275 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE)
278 return false; 276 return false;
279 return pgio->pg_test(pgio, prev, req); 277 return pgio->pg_ops->pg_test(pgio, prev, req);
280} 278}
281 279
282/** 280/**
@@ -311,7 +309,7 @@ static int nfs_pageio_do_add_request(struct nfs_pageio_descriptor *desc,
311static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc) 309static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc)
312{ 310{
313 if (!list_empty(&desc->pg_list)) { 311 if (!list_empty(&desc->pg_list)) {
314 int error = desc->pg_doio(desc); 312 int error = desc->pg_ops->pg_doio(desc);
315 if (error < 0) 313 if (error < 0)
316 desc->pg_error = error; 314 desc->pg_error = error;
317 else 315 else