This is not needed if we always use full file layout. Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxx> --- fs/nfs/pnfs.c | 47 +++++++---------------------------------------- 1 files changed, 7 insertions(+), 40 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 5b0c4ec..a3b934d 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1196,32 +1196,6 @@ out: } void -readahead_range(struct inode *inode, struct list_head *pages, loff_t *offset, - size_t *count) -{ - struct page *first, *last; - loff_t foff, i_size = i_size_read(inode); - pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT; - size_t range; - - - first = list_entry((pages)->prev, struct page, lru); - last = list_entry((pages)->next, struct page, lru); - - foff = (loff_t)first->index << PAGE_CACHE_SHIFT; - - range = (last->index - first->index) * PAGE_CACHE_SIZE; - if (last->index == end_index) - range += ((i_size - 1) & ~PAGE_CACHE_MASK) + 1; - else - range += PAGE_CACHE_SIZE; - dprintk("%s foff %lu, range %Zu\n", __func__, (unsigned long)foff, - range); - *offset = foff; - *count = range; -} - -void pnfs_set_pg_test(struct inode *inode, struct nfs_pageio_descriptor *pgio) { struct pnfs_layout_type *laytype; @@ -1280,8 +1254,6 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct list_head *pages) { struct nfs_server *nfss = NFS_SERVER(inode); - size_t count = 0; - loff_t loff; pgio->pg_iswrite = 0; pgio->pg_boundary = 0; @@ -1291,19 +1263,14 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, if (!pnfs_enabled_sb(nfss)) return; - /* Calculate the total read-ahead count */ - readahead_range(inode, pages, &loff, &count); - - if (count > 0) { - _pnfs_update_layout(inode, ctx, loff, count, IOMODE_READ, - &pgio->pg_lseg); - if (!pgio->pg_lseg) - return; + _pnfs_update_layout(inode, ctx, 0, NFS4_MAX_UINT64, IOMODE_READ, + &pgio->pg_lseg); + if (!pgio->pg_lseg) + return; - pgio->pg_boundary = pnfs_getboundary(inode); - if (pgio->pg_boundary) - pnfs_set_pg_test(inode, pgio); - } + pgio->pg_boundary = pnfs_getboundary(inode); + if (pgio->pg_boundary) + pnfs_set_pg_test(inode, pgio); } void -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html