]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
fscrypt: export fscrypt_fname_encrypt and fscrypt_fname_encrypted_size
authorJeff Layton <jlayton@kernel.org>
Fri, 8 Jan 2021 20:34:38 +0000 (15:34 -0500)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 14:42:34 +0000 (10:42 -0400)
commit3d8818a3c3ceb63897a86fd1f30e9f13554e2a3a
treee57b39f59436a3c2c4ef1d281d2da1b726d2fd15
parentc4a9c116dbbbb39ab8d8cfca6809a2a661b99765
fscrypt: export fscrypt_fname_encrypt and fscrypt_fname_encrypted_size

For ceph, we want to use our own scheme for handling filenames that are
are longer than NAME_MAX after encryption and Base64 encoding. This
allows us to have a consistent view of the encrypted filenames for
clients that don't support fscrypt and clients that do but that don't
have the key.

Currently, fs/crypto only supports encrypting filenames using
fscrypt_setup_filename, but that also handles encoding nokey names. Ceph
can't use that because it handles nokey names in a different way.

Export fscrypt_fname_encrypt. Rename fscrypt_fname_encrypted_size to
__fscrypt_fname_encrypted_size and add a new wrapper called
fscrypt_fname_encrypted_size that takes an inode argument rather than a
pointer to a fscrypt_policy union.

Acked-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/crypto/fname.c
fs/crypto/fscrypt_private.h
fs/crypto/hooks.c
include/linux/fscrypt.h