aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2011-05-22 12:47:26 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-05-29 13:52:32 -0400
commitfb3296eb4636763918edef2d22e45b85b15d4518 (patch)
tree31c85255ccfa03cbca2d1e4e52028e489276a73b /fs/nfs/read.c
parentf7da7a129d57bfe0f74573dc03531c63e1360fae (diff)
pnfs: Use byte-range for layoutget
Add offset and count parameters to pnfs_update_layout and use them to get the layout in the pageio path. Order cache layout segments in the following order: * offset (ascending) * length (descending) * iomode (RW before READ) Test byte range against the layout segment in use in pnfs_{read,write}_pg_test so not to coalesce pages not using the same layout segment. [fix lseg ordering] [clean up pnfs_find_lseg lseg arg] [remove unnecessary FIXME] [fix ordering in pnfs_insert_layout] [clean up pnfs_insert_layout] Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 2bcf0dc306a1..540c8bc93f95 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -288,7 +288,9 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc)
288 atomic_set(&req->wb_complete, requests); 288 atomic_set(&req->wb_complete, requests);
289 289
290 BUG_ON(desc->pg_lseg != NULL); 290 BUG_ON(desc->pg_lseg != NULL);
291 lseg = pnfs_update_layout(desc->pg_inode, req->wb_context, IOMODE_READ, GFP_KERNEL); 291 lseg = pnfs_update_layout(desc->pg_inode, req->wb_context,
292 req_offset(req), desc->pg_count,
293 IOMODE_READ, GFP_KERNEL);
292 ClearPageError(page); 294 ClearPageError(page);
293 offset = 0; 295 offset = 0;
294 nbytes = desc->pg_count; 296 nbytes = desc->pg_count;
@@ -351,7 +353,9 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc)
351 } 353 }
352 req = nfs_list_entry(data->pages.next); 354 req = nfs_list_entry(data->pages.next);
353 if ((!lseg) && list_is_singular(&data->pages)) 355 if ((!lseg) && list_is_singular(&data->pages))
354 lseg = pnfs_update_layout(desc->pg_inode, req->wb_context, IOMODE_READ, GFP_KERNEL); 356 lseg = pnfs_update_layout(desc->pg_inode, req->wb_context,
357 req_offset(req), desc->pg_count,
358 IOMODE_READ, GFP_KERNEL);
355 359
356 ret = nfs_read_rpcsetup(req, data, &nfs_read_full_ops, desc->pg_count, 360 ret = nfs_read_rpcsetup(req, data, &nfs_read_full_ops, desc->pg_count,
357 0, lseg); 361 0, lseg);