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
This commit is contained in:
parent
c987918a3f
commit
8377e8a24b
fs/verity
|
@ -53,14 +53,14 @@ static int fsverity_read_merkle_tree(struct inode *inode,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
virt = kmap(page);
|
virt = kmap_local_page(page);
|
||||||
if (copy_to_user(buf, virt + offs_in_page, bytes_to_copy)) {
|
if (copy_to_user(buf, virt + offs_in_page, bytes_to_copy)) {
|
||||||
kunmap(page);
|
kunmap_local(virt);
|
||||||
put_page(page);
|
put_page(page);
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kunmap(page);
|
kunmap_local(virt);
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
|
||||||
retval += bytes_to_copy;
|
retval += bytes_to_copy;
|
||||||
|
|
Loading…
Reference in New Issue