]> Git Repo - linux.git/commitdiff
fs-verity: use kmap_local_page() instead of kmap()
authorEric Biggers <[email protected]>
Thu, 18 Aug 2022 22:40:10 +0000 (15:40 -0700)
committerEric Biggers <[email protected]>
Fri, 19 Aug 2022 22:19:55 +0000 (15:19 -0700)
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 <[email protected]>
Reviewed-by: Fabio M. De Francesco <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
fs/verity/read_metadata.c

index 6ee849dc7bc183c0f55212cb5a5639fe2d134e19..2aefc5565152ad15e3abc46fe8b0cc9045faccaa 100644 (file)
@@ -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;
This page took 0.05506 seconds and 4 git commands to generate.