diff options
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 6c1a4212919d..5427ae766f06 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c | |||
@@ -255,6 +255,7 @@ bl_read_pagelist(struct nfs_pgio_header *hdr) | |||
255 | struct page **pages = hdr->args.pages; | 255 | struct page **pages = hdr->args.pages; |
256 | int pg_index = hdr->args.pgbase >> PAGE_CACHE_SHIFT; | 256 | int pg_index = hdr->args.pgbase >> PAGE_CACHE_SHIFT; |
257 | const bool is_dio = (header->dreq != NULL); | 257 | const bool is_dio = (header->dreq != NULL); |
258 | struct blk_plug plug; | ||
258 | 259 | ||
259 | dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, | 260 | dprintk("%s enter nr_pages %u offset %lld count %u\n", __func__, |
260 | hdr->page_array.npages, f_offset, | 261 | hdr->page_array.npages, f_offset, |
@@ -266,6 +267,8 @@ bl_read_pagelist(struct nfs_pgio_header *hdr) | |||
266 | par->pnfs_callback = bl_end_par_io_read; | 267 | par->pnfs_callback = bl_end_par_io_read; |
267 | /* At this point, we can no longer jump to use_mds */ | 268 | /* At this point, we can no longer jump to use_mds */ |
268 | 269 | ||
270 | blk_start_plug(&plug); | ||
271 | |||
269 | isect = (sector_t) (f_offset >> SECTOR_SHIFT); | 272 | isect = (sector_t) (f_offset >> SECTOR_SHIFT); |
270 | /* Code assumes extents are page-aligned */ | 273 | /* Code assumes extents are page-aligned */ |
271 | for (i = pg_index; i < hdr->page_array.npages; i++) { | 274 | for (i = pg_index; i < hdr->page_array.npages; i++) { |
@@ -342,6 +345,7 @@ out: | |||
342 | bl_put_extent(be); | 345 | bl_put_extent(be); |
343 | bl_put_extent(cow_read); | 346 | bl_put_extent(cow_read); |
344 | bl_submit_bio(READ, bio); | 347 | bl_submit_bio(READ, bio); |
348 | blk_finish_plug(&plug); | ||
345 | put_parallel(par); | 349 | put_parallel(par); |
346 | return PNFS_ATTEMPTED; | 350 | return PNFS_ATTEMPTED; |
347 | 351 | ||
@@ -688,9 +692,12 @@ bl_write_pagelist(struct nfs_pgio_header *header, int sync) | |||
688 | u64 temp; | 692 | u64 temp; |
689 | int npg_per_block = | 693 | int npg_per_block = |
690 | NFS_SERVER(header->inode)->pnfs_blksize >> PAGE_CACHE_SHIFT; | 694 | NFS_SERVER(header->inode)->pnfs_blksize >> PAGE_CACHE_SHIFT; |
695 | struct blk_plug plug; | ||
691 | 696 | ||
692 | dprintk("%s enter, %Zu@%lld\n", __func__, count, offset); | 697 | dprintk("%s enter, %Zu@%lld\n", __func__, count, offset); |
693 | 698 | ||
699 | blk_start_plug(&plug); | ||
700 | |||
694 | if (header->dreq != NULL && | 701 | if (header->dreq != NULL && |
695 | (!IS_ALIGNED(offset, NFS_SERVER(header->inode)->pnfs_blksize) || | 702 | (!IS_ALIGNED(offset, NFS_SERVER(header->inode)->pnfs_blksize) || |
696 | !IS_ALIGNED(count, NFS_SERVER(header->inode)->pnfs_blksize))) { | 703 | !IS_ALIGNED(count, NFS_SERVER(header->inode)->pnfs_blksize))) { |
@@ -894,9 +901,11 @@ out: | |||
894 | bl_put_extent(be); | 901 | bl_put_extent(be); |
895 | bl_put_extent(cow_read); | 902 | bl_put_extent(cow_read); |
896 | bl_submit_bio(WRITE, bio); | 903 | bl_submit_bio(WRITE, bio); |
904 | blk_finish_plug(&plug); | ||
897 | put_parallel(par); | 905 | put_parallel(par); |
898 | return PNFS_ATTEMPTED; | 906 | return PNFS_ATTEMPTED; |
899 | out_mds: | 907 | out_mds: |
908 | blk_finish_plug(&plug); | ||
900 | bl_put_extent(be); | 909 | bl_put_extent(be); |
901 | bl_put_extent(cow_read); | 910 | bl_put_extent(cow_read); |
902 | kfree(par); | 911 | kfree(par); |