diff mbox series

[v1,09/10] NFS: Remove nfs_readdir_dont_search_cache()

Message ID 1ebc4a7d527775b03efc21f39d04072e4d118516.1611160121.git.bcodding@redhat.com (mailing list archive)
State New
Headers show
Series NFS client readdir per-page validation | expand

Commit Message

Benjamin Coddington Jan. 20, 2021, 4:59 p.m. UTC
Since we can now fill the pagecache at arbitrary offsets, we no longer need
this optimization.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
 fs/nfs/dir.c | 17 -----------------
 1 file changed, 17 deletions(-)
diff mbox series

Patch

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;