Merge tag 'for-f2fs-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
[platform/kernel/linux-starfive.git] / fs / f2fs / f2fs.h
index 7e29249..d148313 100644 (file)
 #include <linux/vmalloc.h>
 #include <linux/bio.h>
 #include <linux/blkdev.h>
-#include <linux/fscrypto.h>
+#ifdef CONFIG_F2FS_FS_ENCRYPTION
+#include <linux/fscrypt_supp.h>
+#else
+#include <linux/fscrypt_notsupp.h>
+#endif
 #include <crypto/hash.h>
 
 #ifdef CONFIG_F2FS_CHECK_FS
@@ -787,10 +791,6 @@ enum {
        MAX_TIME,
 };
 
-#ifdef CONFIG_F2FS_FS_ENCRYPTION
-#define F2FS_KEY_DESC_PREFIX "f2fs:"
-#define F2FS_KEY_DESC_PREFIX_SIZE 5
-#endif
 struct f2fs_sb_info {
        struct super_block *sb;                 /* pointer to VFS super block */
        struct proc_dir_entry *s_proc;          /* proc entry */
@@ -798,11 +798,6 @@ struct f2fs_sb_info {
        int valid_super_block;                  /* valid super block no */
        unsigned long s_flag;                           /* flags for sbi */
 
-#ifdef CONFIG_F2FS_FS_ENCRYPTION
-       u8 key_prefix[F2FS_KEY_DESC_PREFIX_SIZE];
-       u8 key_prefix_size;
-#endif
-
 #ifdef CONFIG_BLK_DEV_ZONED
        unsigned int blocks_per_blkz;           /* F2FS blocks per zone */
        unsigned int log_blocks_per_blkz;       /* log2 F2FS blocks per zone */
@@ -2638,28 +2633,4 @@ static inline bool f2fs_may_encrypt(struct inode *inode)
 #endif
 }
 
-#ifndef CONFIG_F2FS_FS_ENCRYPTION
-#define fscrypt_set_d_op(i)
-#define fscrypt_get_ctx                        fscrypt_notsupp_get_ctx
-#define fscrypt_release_ctx            fscrypt_notsupp_release_ctx
-#define fscrypt_encrypt_page           fscrypt_notsupp_encrypt_page
-#define fscrypt_decrypt_page           fscrypt_notsupp_decrypt_page
-#define fscrypt_decrypt_bio_pages      fscrypt_notsupp_decrypt_bio_pages
-#define fscrypt_pullback_bio_page      fscrypt_notsupp_pullback_bio_page
-#define fscrypt_restore_control_page   fscrypt_notsupp_restore_control_page
-#define fscrypt_zeroout_range          fscrypt_notsupp_zeroout_range
-#define fscrypt_ioctl_set_policy       fscrypt_notsupp_ioctl_set_policy
-#define fscrypt_ioctl_get_policy       fscrypt_notsupp_ioctl_get_policy
-#define fscrypt_has_permitted_context  fscrypt_notsupp_has_permitted_context
-#define fscrypt_inherit_context                fscrypt_notsupp_inherit_context
-#define fscrypt_get_encryption_info    fscrypt_notsupp_get_encryption_info
-#define fscrypt_put_encryption_info    fscrypt_notsupp_put_encryption_info
-#define fscrypt_setup_filename         fscrypt_notsupp_setup_filename
-#define fscrypt_free_filename          fscrypt_notsupp_free_filename
-#define fscrypt_fname_encrypted_size   fscrypt_notsupp_fname_encrypted_size
-#define fscrypt_fname_alloc_buffer     fscrypt_notsupp_fname_alloc_buffer
-#define fscrypt_fname_free_buffer      fscrypt_notsupp_fname_free_buffer
-#define fscrypt_fname_disk_to_usr      fscrypt_notsupp_fname_disk_to_usr
-#define fscrypt_fname_usr_to_disk      fscrypt_notsupp_fname_usr_to_disk
-#endif
 #endif