fscrypt: introduce fscrypt_prepare_readdir()
authorEric Biggers <ebiggers@google.com>
Thu, 3 Dec 2020 02:20:37 +0000 (18:20 -0800)
committerEric Biggers <ebiggers@google.com>
Thu, 3 Dec 2020 02:25:01 +0000 (18:25 -0800)
commitec0caa974cd092549ab282deb8ec7ea73b36eba0
tree9609384a2e6542df8862a9f2d903e62dbc4e10c8
parent91d0d89241b4201d612bfac623199c84363286e9
fscrypt: introduce fscrypt_prepare_readdir()

The last remaining use of fscrypt_get_encryption_info() from filesystems
is for readdir (->iterate_shared()).  Every other call is now in
fs/crypto/ as part of some other higher-level operation.

We need to add a new argument to fscrypt_get_encryption_info() to
indicate whether the encryption policy is allowed to be unrecognized or
not.  Doing this is easier if we can work with high-level operations
rather than direct filesystem use of fscrypt_get_encryption_info().

So add a function fscrypt_prepare_readdir() which wraps the call to
fscrypt_get_encryption_info() for the readdir use case.

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20201203022041.230976-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/hooks.c
fs/ext4/dir.c
fs/ext4/namei.c
fs/f2fs/dir.c
fs/ubifs/dir.c
include/linux/fscrypt.h