summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2020-11-01 19:31:20 +0100
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-12-02 20:05:51 +0100
commite762a639816015a70bb1af8ea4baf54f4facb591 (patch)
treebbf1be274170e339a8e0644256970ca26f08539c /fs/nfs
parentNFS: Don't discard readdir results (diff)
downloadlinux-e762a639816015a70bb1af8ea4baf54f4facb591.tar.xz
linux-e762a639816015a70bb1af8ea4baf54f4facb591.zip
NFS: Remove unnecessary kmap in nfs_readdir_xdr_to_array()
The kmapped pointer is only used once per loop to check if we need to exit. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Benjamin Coddington <bcodding@redhat.com> Tested-by: Dave Wysochanski <dwysocha@redhat.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index f7248145c333..e8b0fcc1bc9e 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -759,7 +759,6 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
struct page *pages[NFS_MAX_READDIR_PAGES];
struct nfs_entry entry;
struct file *file = desc->file;
- struct nfs_cache_array *array;
int status = -ENOMEM;
unsigned int array_size = ARRAY_SIZE(pages);
@@ -778,11 +777,9 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
goto out;
}
- array = kmap(page);
-
status = nfs_readdir_alloc_pages(pages, array_size);
if (status < 0)
- goto out_release_array;
+ goto out_release_label;
do {
unsigned int pglen;
status = nfs_readdir_xdr_filler(pages, desc, &entry, file, inode);
@@ -797,11 +794,10 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
}
status = nfs_readdir_page_filler(desc, &entry, pages, page, pglen);
- } while (!status && !nfs_readdir_array_is_full(array));
+ } while (!status && nfs_readdir_page_needs_filling(page));
nfs_readdir_free_pages(pages, array_size);
-out_release_array:
- kunmap(page);
+out_release_label:
nfs4_label_free(entry.label);
out:
nfs_free_fattr(entry.fattr);