aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-02-28 20:34:14 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:42 -0500
commit94ad1c80e28f9700c84b4d28d1e5302ddf63a6fd (patch)
tree2c600c1f8e85648c7693b5f0018b5d0b7e960b5f /fs/nfs/pagelist.c
parentd684d2ae10a4f95d3035abf698d7d611ff2cd279 (diff)
NFSv4.1: coelesce across layout stripes
Add a pg_test layout driver hook which is used to avoid coelescing I/O across layout stripes. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com> Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Tao Guo <guotao@nrchpc.ac.cn> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index e1164e3f9e69..9b9a65c9bb4f 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -226,6 +226,7 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
226 desc->pg_doio = doio; 226 desc->pg_doio = doio;
227 desc->pg_ioflags = io_flags; 227 desc->pg_ioflags = io_flags;
228 desc->pg_error = 0; 228 desc->pg_error = 0;
229 desc->pg_lseg = NULL;
229} 230}
230 231
231/** 232/**
@@ -240,7 +241,8 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
240 * Return 'true' if this is the case, else return 'false'. 241 * Return 'true' if this is the case, else return 'false'.
241 */ 242 */
242static int nfs_can_coalesce_requests(struct nfs_page *prev, 243static int nfs_can_coalesce_requests(struct nfs_page *prev,
243 struct nfs_page *req) 244 struct nfs_page *req,
245 struct nfs_pageio_descriptor *pgio)
244{ 246{
245 if (req->wb_context->cred != prev->wb_context->cred) 247 if (req->wb_context->cred != prev->wb_context->cred)
246 return 0; 248 return 0;
@@ -254,6 +256,12 @@ static int nfs_can_coalesce_requests(struct nfs_page *prev,
254 return 0; 256 return 0;
255 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE) 257 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE)
256 return 0; 258 return 0;
259 /*
260 * Non-whole file layouts need to check that req is inside of
261 * pgio->pg_lseg.
262 */
263 if (pgio->pg_test && !pgio->pg_test(pgio, prev, req))
264 return 0;
257 return 1; 265 return 1;
258} 266}
259 267
@@ -286,7 +294,7 @@ static int nfs_pageio_do_add_request(struct nfs_pageio_descriptor *desc,
286 if (newlen > desc->pg_bsize) 294 if (newlen > desc->pg_bsize)
287 return 0; 295 return 0;
288 prev = nfs_list_entry(desc->pg_list.prev); 296 prev = nfs_list_entry(desc->pg_list.prev);
289 if (!nfs_can_coalesce_requests(prev, req)) 297 if (!nfs_can_coalesce_requests(prev, req, desc))
290 return 0; 298 return 0;
291 } else 299 } else
292 desc->pg_base = req->wb_pgbase; 300 desc->pg_base = req->wb_pgbase;