Whamcloud - gitweb
LU-13717 sec: missing defs in includes for client encryption 21/45221/2
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 13 Oct 2021 09:35:01 +0000 (09:35 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 3 Nov 2021 02:38:23 +0000 (02:38 +0000)
Add a few missing definitions in lustre_crypto.h that are required
in case Lustre client encryption is built against the in-kernel
fscrypt library.

Fixes: 028281ae19 ("LU-13717 sec: rework includes for client encryption")
Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I1965503554dcf660770d201444cfafd54aa84dce
Reviewed-on: https://review.whamcloud.com/45221
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_crypto.h

index 284b9cc..c100028 100644 (file)
@@ -109,6 +109,13 @@ static inline int critical_decode(const u8 *src, int len, char *dst)
 #define __FS_HAS_ENCRYPTION 1
 #include <linux/fscrypt.h>
 
 #define __FS_HAS_ENCRYPTION 1
 #include <linux/fscrypt.h>
 
+#define LLCRYPT_FNAME_DIGEST_SIZE      FSCRYPT_FNAME_DIGEST_SIZE
+#define LLCRYPT_FNAME_DIGEST           FSCRYPT_FNAME_DIGEST
+#define llcrypt_name                   fscrypt_name
+#define llcrypt_str                    fscrypt_str
+#define LLTR_INIT                      FSTR_INIT
+#define LLCRYPT_FNAME_MAX_UNDIGESTED_SIZE \
+       FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE
 #define llcrypt_operations     fscrypt_operations
 #define llcrypt_symlink_data   fscrypt_symlink_data
 #define llcrypt_dummy_context_enabled(inode) \
 #define llcrypt_operations     fscrypt_operations
 #define llcrypt_symlink_data   fscrypt_symlink_data
 #define llcrypt_dummy_context_enabled(inode) \
@@ -161,6 +168,8 @@ static inline int critical_decode(const u8 *src, int len, char *dst)
        fscrypt_prepare_lookup(dir, dentry, fname)
 #define llcrypt_encrypt_symlink(inode, target, len, disk_link) \
        fscrypt_encrypt_symlink(inode, target, len, disk_link)
        fscrypt_prepare_lookup(dir, dentry, fname)
 #define llcrypt_encrypt_symlink(inode, target, len, disk_link) \
        fscrypt_encrypt_symlink(inode, target, len, disk_link)
+#define __llcrypt_encrypt_symlink(inode, target, len, disk_link) \
+       __fscrypt_encrypt_symlink(inode, target, len, disk_link)
 #define llcrypt_prepare_symlink(dir, target, len, max_len, disk_link)  \
        fscrypt_prepare_symlink(dir, target, len, max_len, disk_link)
 #define llcrypt_get_symlink(inode, caddr, max_size, done) \
 #define llcrypt_prepare_symlink(dir, target, len, max_len, disk_link)  \
        fscrypt_prepare_symlink(dir, target, len, max_len, disk_link)
 #define llcrypt_get_symlink(inode, caddr, max_size, done) \