From eea2c05d927b031034e222110a4fc34914d97ca4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 26 Mar 2019 08:52:31 +0100 Subject: ubifs: Remove #ifdef around CONFIG_FS_ENCRYPTION ifdefs reduce readablity and compile coverage. This removes the ifdefs around CONFIG_FS_ENCRYPTION by using IS_ENABLED and relying on static inline wrappers. A new static inline wrapper for setting sb->s_cop is introduced to allow filesystems to unconditionally compile in their s_cop operations. Signed-off-by: Sascha Hauer Signed-off-by: Richard Weinberger --- include/linux/fscrypt.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/fscrypt.h') diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index e5194fc3983e..9a5792dac16a 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -230,6 +230,11 @@ extern int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, extern const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, unsigned int max_size, struct delayed_call *done); +static inline void fscrypt_set_ops(struct super_block *sb, + const struct fscrypt_operations *s_cop) +{ + sb->s_cop = s_cop; +} #else /* !CONFIG_FS_ENCRYPTION */ static inline bool fscrypt_has_encryption_key(const struct inode *inode) @@ -446,6 +451,12 @@ static inline const char *fscrypt_get_symlink(struct inode *inode, { return ERR_PTR(-EOPNOTSUPP); } + +static inline void fscrypt_set_ops(struct super_block *sb, + const struct fscrypt_operations *s_cop) +{ +} + #endif /* !CONFIG_FS_ENCRYPTION */ /** -- cgit v1.2.3