fsverity: optimize fsverity_prepare_setattr() on non-verity files
authorEric Biggers <ebiggers@google.com>
Wed, 14 Dec 2022 22:43:02 +0000 (14:43 -0800)
committerEric Biggers <ebiggers@google.com>
Sun, 1 Jan 2023 23:46:48 +0000 (15:46 -0800)
commit01d90c07a592b532c7a673dfd8baa6d6e496273d
treecc7c24c3f7b9ea47812358d6acabd5e60e6115d2
parenta6528a960b78715d4c3d2c9cda85714b15a0faa4
fsverity: optimize fsverity_prepare_setattr() on non-verity files

Make fsverity_prepare_setattr() an inline function that does the
IS_VERITY() check, then (if needed) calls __fsverity_prepare_setattr()
to do the real work.  This reduces the overhead on non-verity files.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Link: https://lore.kernel.org/r/20221214224304.145712-3-ebiggers@kernel.org
fs/verity/open.c
include/linux/fsverity.h