summaryrefslogtreecommitdiffstats
path: root/fs/verity
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-08-18 15:40:10 -0700
committerEric Biggers <ebiggers@google.com>2022-08-19 15:19:55 -0700
commit8377e8a24bba1ae73b3869bc71ee9df16b6bef61 (patch)
tree6ae78bff5700d3ff9586cd3b0dbe16b2509129aa /fs/verity
parentc987918a3fdf2d361c48839ec324f2547418f9d6 (diff)
downloadlinux-stable-8377e8a24bba1ae73b3869bc71ee9df16b6bef61.tar.gz
linux-stable-8377e8a24bba1ae73b3869bc71ee9df16b6bef61.tar.bz2
linux-stable-8377e8a24bba1ae73b3869bc71ee9df16b6bef61.zip
fs-verity: use kmap_local_page() instead of kmap()
Convert the use of kmap() to its recommended replacement kmap_local_page(). This avoids the overhead of doing a non-local mapping, which is unnecessary in this case. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20220818224010.43778-1-ebiggers@kernel.org
Diffstat (limited to 'fs/verity')
-rw-r--r--fs/verity/read_metadata.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/verity/read_metadata.c b/fs/verity/read_metadata.c
index 6ee849dc7bc1..2aefc5565152 100644
--- a/fs/verity/read_metadata.c
+++ b/fs/verity/read_metadata.c
@@ -53,14 +53,14 @@ static int fsverity_read_merkle_tree(struct inode *inode,
break;
}
- virt = kmap(page);
+ virt = kmap_local_page(page);
if (copy_to_user(buf, virt + offs_in_page, bytes_to_copy)) {
- kunmap(page);
+ kunmap_local(virt);
put_page(page);
err = -EFAULT;
break;
}
- kunmap(page);
+ kunmap_local(virt);
put_page(page);
retval += bytes_to_copy;