Since we can now fill the pagecache at arbitrary offsets, we no longer need this optimization. Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx> --- fs/nfs/dir.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 7ca79d4b25ec..fc9e72341220 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1036,28 +1036,11 @@ static int find_and_lock_cache_page(struct nfs_readdir_descriptor *desc) return res; } -static bool nfs_readdir_dont_search_cache(struct nfs_readdir_descriptor *desc) -{ - struct address_space *mapping = desc->file->f_mapping; - struct inode *dir = file_inode(desc->file); - unsigned int dtsize = NFS_SERVER(dir)->dtsize; - loff_t size = i_size_read(dir); - - /* - * Default to uncached readdir if the page cache is empty, and - * we're looking for a non-zero cookie in a large directory. - */ - return desc->dir_cookie != 0 && mapping->nrpages == 0 && size > dtsize; -} - /* Search for desc->dir_cookie from the beginning of the page cache */ static int readdir_search_pagecache(struct nfs_readdir_descriptor *desc) { int res; - if (nfs_readdir_dont_search_cache(desc)) - return -EBADCOOKIE; - do { if (desc->pgc.page_index == 0) { desc->current_index = 0; -- 2.25.4