diff options
author | Fred Isaman <iisaman@netapp.com> | 2012-04-20 14:47:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 14:10:37 -0400 |
commit | 30dd374f6fc1b202db3a1b57b61afff1326bad92 (patch) | |
tree | 7d3b631be897dd79a916ee8d410fd2bb92da4890 /fs/nfs/blocklayout | |
parent | cd841605f7a721878d8a2d1362484723d8abf569 (diff) |
NFS: create struct nfs_page_array
Both nfs_read_data and nfs_write_data devote several fields which
can be combined into a single shared struct.
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 7a482517f4c6..7ae8a608956f 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c | |||
@@ -242,7 +242,7 @@ bl_read_pagelist(struct nfs_read_data *rdata) | |||
242 | int pg_index = rdata->args.pgbase >> PAGE_CACHE_SHIFT; | 242 | int pg_index = rdata->args.pgbase >> PAGE_CACHE_SHIFT; |
243 | 243 | ||
244 | dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, | 244 | dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, |
245 | rdata->npages, f_offset, (unsigned int)rdata->args.count); | 245 | rdata->pages.npages, f_offset, (unsigned int)rdata->args.count); |
246 | 246 | ||
247 | par = alloc_parallel(rdata); | 247 | par = alloc_parallel(rdata); |
248 | if (!par) | 248 | if (!par) |
@@ -252,7 +252,7 @@ bl_read_pagelist(struct nfs_read_data *rdata) | |||
252 | 252 | ||
253 | isect = (sector_t) (f_offset >> SECTOR_SHIFT); | 253 | isect = (sector_t) (f_offset >> SECTOR_SHIFT); |
254 | /* Code assumes extents are page-aligned */ | 254 | /* Code assumes extents are page-aligned */ |
255 | for (i = pg_index; i < rdata->npages; i++) { | 255 | for (i = pg_index; i < rdata->pages.npages; i++) { |
256 | if (!extent_length) { | 256 | if (!extent_length) { |
257 | /* We've used up the previous extent */ | 257 | /* We've used up the previous extent */ |
258 | bl_put_extent(be); | 258 | bl_put_extent(be); |
@@ -285,7 +285,8 @@ bl_read_pagelist(struct nfs_read_data *rdata) | |||
285 | struct pnfs_block_extent *be_read; | 285 | struct pnfs_block_extent *be_read; |
286 | 286 | ||
287 | be_read = (hole && cow_read) ? cow_read : be; | 287 | be_read = (hole && cow_read) ? cow_read : be; |
288 | bio = bl_add_page_to_bio(bio, rdata->npages - i, READ, | 288 | bio = bl_add_page_to_bio(bio, rdata->pages.npages - i, |
289 | READ, | ||
289 | isect, pages[i], be_read, | 290 | isect, pages[i], be_read, |
290 | bl_end_io_read, par); | 291 | bl_end_io_read, par); |
291 | if (IS_ERR(bio)) { | 292 | if (IS_ERR(bio)) { |
@@ -654,7 +655,7 @@ next_page: | |||
654 | 655 | ||
655 | /* Middle pages */ | 656 | /* Middle pages */ |
656 | pg_index = wdata->args.pgbase >> PAGE_CACHE_SHIFT; | 657 | pg_index = wdata->args.pgbase >> PAGE_CACHE_SHIFT; |
657 | for (i = pg_index; i < wdata->npages; i++) { | 658 | for (i = pg_index; i < wdata->pages.npages; i++) { |
658 | if (!extent_length) { | 659 | if (!extent_length) { |
659 | /* We've used up the previous extent */ | 660 | /* We've used up the previous extent */ |
660 | bl_put_extent(be); | 661 | bl_put_extent(be); |
@@ -688,7 +689,7 @@ next_page: | |||
688 | goto out; | 689 | goto out; |
689 | } | 690 | } |
690 | } | 691 | } |
691 | bio = bl_add_page_to_bio(bio, wdata->npages - i, WRITE, | 692 | bio = bl_add_page_to_bio(bio, wdata->pages.npages - i, WRITE, |
692 | isect, pages[i], be, | 693 | isect, pages[i], be, |
693 | bl_end_io_write, par); | 694 | bl_end_io_write, par); |
694 | if (IS_ERR(bio)) { | 695 | if (IS_ERR(bio)) { |