Commit 1493651b authored by Eric Biggers's avatar Eric Biggers Committed by Theodore Ts'o

fscrypt: split fscrypt_dummy_context_enabled() into supp/notsupp versions

fscrypt_dummy_context_enabled() accesses ->s_cop, which now is only set
when the filesystem is built with encryption support.  This didn't
actually matter because no filesystems called it.  However, it will
start being used soon, so fix it by moving it from fscrypt.h to
fscrypt_supp.h and stubbing it out in fscrypt_notsupp.h.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 542060c0
...@@ -75,14 +75,6 @@ struct fscrypt_operations { ...@@ -75,14 +75,6 @@ struct fscrypt_operations {
/* Maximum value for the third parameter of fscrypt_operations.set_context(). */ /* Maximum value for the third parameter of fscrypt_operations.set_context(). */
#define FSCRYPT_SET_CONTEXT_MAX_SIZE 28 #define FSCRYPT_SET_CONTEXT_MAX_SIZE 28
static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
{
if (inode->i_sb->s_cop->dummy_context &&
inode->i_sb->s_cop->dummy_context(inode))
return true;
return false;
}
static inline bool fscrypt_valid_enc_modes(u32 contents_mode, static inline bool fscrypt_valid_enc_modes(u32 contents_mode,
u32 filenames_mode) u32 filenames_mode)
{ {
......
...@@ -19,6 +19,11 @@ static inline bool fscrypt_has_encryption_key(const struct inode *inode) ...@@ -19,6 +19,11 @@ static inline bool fscrypt_has_encryption_key(const struct inode *inode)
return false; return false;
} }
static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
{
return false;
}
/* crypto.c */ /* crypto.c */
static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
gfp_t gfp_flags) gfp_t gfp_flags)
......
...@@ -31,6 +31,12 @@ static inline bool fscrypt_has_encryption_key(const struct inode *inode) ...@@ -31,6 +31,12 @@ static inline bool fscrypt_has_encryption_key(const struct inode *inode)
return (inode->i_crypt_info != NULL); return (inode->i_crypt_info != NULL);
} }
static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
{
return inode->i_sb->s_cop->dummy_context &&
inode->i_sb->s_cop->dummy_context(inode);
}
/* crypto.c */ /* crypto.c */
extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t); extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);
extern void fscrypt_release_ctx(struct fscrypt_ctx *); extern void fscrypt_release_ctx(struct fscrypt_ctx *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment