diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-12 13:42:02 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-15 09:12:20 -0400 |
commit | 50828d7e6767a92726708bc0666e2b8b84575808 (patch) | |
tree | 80f4a2fd19eb0cf232b6d5232eec28a45230c8e6 /fs/nfs/read.c | |
parent | 275acaafd45fbc8ecc3beabd6367e60b3049606a (diff) |
NFS: Cache rpc_ops in struct nfs_pageio_descriptor
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 0215bac35fc6..c14362fbe65f 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -327,6 +327,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, struct list_head | |||
327 | } while(nbytes != 0); | 327 | } while(nbytes != 0); |
328 | atomic_set(&req->wb_complete, requests); | 328 | atomic_set(&req->wb_complete, requests); |
329 | ClearPageError(page); | 329 | ClearPageError(page); |
330 | desc->pg_rpc_callops = &nfs_read_partial_ops; | ||
330 | return ret; | 331 | return ret; |
331 | out_bad: | 332 | out_bad: |
332 | while (!list_empty(res)) { | 333 | while (!list_empty(res)) { |
@@ -367,6 +368,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, struct list_head * | |||
367 | 368 | ||
368 | nfs_read_rpcsetup(req, data, desc->pg_count, 0); | 369 | nfs_read_rpcsetup(req, data, desc->pg_count, 0); |
369 | list_add(&data->list, res); | 370 | list_add(&data->list, res); |
371 | desc->pg_rpc_callops = &nfs_read_full_ops; | ||
370 | out: | 372 | out: |
371 | return ret; | 373 | return ret; |
372 | } | 374 | } |
@@ -376,19 +378,14 @@ int nfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) | |||
376 | LIST_HEAD(head); | 378 | LIST_HEAD(head); |
377 | int ret; | 379 | int ret; |
378 | 380 | ||
379 | if (desc->pg_bsize < PAGE_CACHE_SIZE) { | 381 | if (desc->pg_bsize < PAGE_CACHE_SIZE) |
380 | ret = nfs_pagein_multi(desc, &head); | 382 | ret = nfs_pagein_multi(desc, &head); |
381 | if (ret == 0) | 383 | else |
382 | ret = nfs_do_multiple_reads(&head, | ||
383 | &nfs_read_partial_ops, | ||
384 | desc->pg_lseg); | ||
385 | } else { | ||
386 | ret = nfs_pagein_one(desc, &head); | 384 | ret = nfs_pagein_one(desc, &head); |
387 | if (ret == 0) | 385 | |
388 | ret = nfs_do_multiple_reads(&head, | 386 | if (ret == 0) |
389 | &nfs_read_full_ops, | 387 | ret = nfs_do_multiple_reads(&head, desc->pg_rpc_callops, |
390 | desc->pg_lseg); | 388 | desc->pg_lseg); |
391 | } | ||
392 | put_lseg(desc->pg_lseg); | 389 | put_lseg(desc->pg_lseg); |
393 | desc->pg_lseg = NULL; | 390 | desc->pg_lseg = NULL; |
394 | return ret; | 391 | return ret; |