Skip to content

Commit

Permalink
fs-verity: use kmap_local_page() instead of kmap()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
ebiggers committed Aug 19, 2022
1 parent c987918 commit 8377e8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/verity/read_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8377e8a

Please sign in to comment.