aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorFabio M. De Francesco <fmdefrancesco@gmail.com>2022-06-28 20:24:26 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2022-07-12 10:06:18 -0400
commitc77c738c37d0fa8380a671613630298d71099180 (patch)
tree29e2033f24c9f56e2a723297999e59d6cf06a2c1 /fs/nfs/dir.c
parentNFS: remove redundant code in nfs_file_write() (diff)
downloadlinux-dev-c77c738c37d0fa8380a671613630298d71099180.tar.xz
linux-dev-c77c738c37d0fa8380a671613630298d71099180.zip
nfs: Replace kmap() with kmap_local_page()
The use of kmap() is being deprecated in favor of kmap_local_page(). With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. Furthermore, the mapping can be acquired from any context (including interrupts). Therefore, use kmap_local_page() in nfs_do_filldir() because this mapping is per thread, CPU local, and not globally visible. Suggested-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d9d277d7fa84..7b2230297f6b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1084,7 +1084,7 @@ static void nfs_do_filldir(struct nfs_readdir_descriptor *desc,
struct nfs_cache_array *array;
unsigned int i;
- array = kmap(desc->page);
+ array = kmap_local_page(desc->page);
for (i = desc->cache_entry_index; i < array->size; i++) {
struct nfs_cache_array_entry *ent;
@@ -1110,7 +1110,7 @@ static void nfs_do_filldir(struct nfs_readdir_descriptor *desc,
if (array->page_is_eof)
desc->eof = !desc->eob;
- kunmap(desc->page);
+ kunmap_local(array);
dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %llu\n",
(unsigned long long)desc->dir_cookie);
}