mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
fscrypt: move fscrypt_control_page() to supp/notsupp headers
fscrypt_control_page() is already split into two versions depending on whether the filesystem is being built with encryption support or not. Move them into the appropriate headers. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
3d463f2856
commit
4fd4b15ccb
3 changed files with 13 additions and 16 deletions
|
@ -123,24 +123,10 @@ static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __FS_HAS_ENCRYPTION
|
#if __FS_HAS_ENCRYPTION
|
||||||
|
|
||||||
static inline struct page *fscrypt_control_page(struct page *page)
|
|
||||||
{
|
|
||||||
return ((struct fscrypt_ctx *)page_private(page))->w.control_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <linux/fscrypt_supp.h>
|
#include <linux/fscrypt_supp.h>
|
||||||
|
#else
|
||||||
#else /* !__FS_HAS_ENCRYPTION */
|
|
||||||
|
|
||||||
static inline struct page *fscrypt_control_page(struct page *page)
|
|
||||||
{
|
|
||||||
WARN_ON_ONCE(1);
|
|
||||||
return ERR_PTR(-EINVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <linux/fscrypt_notsupp.h>
|
#include <linux/fscrypt_notsupp.h>
|
||||||
#endif /* __FS_HAS_ENCRYPTION */
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fscrypt_require_key - require an inode's encryption key
|
* fscrypt_require_key - require an inode's encryption key
|
||||||
|
|
|
@ -48,6 +48,11 @@ static inline int fscrypt_decrypt_page(const struct inode *inode,
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline struct page *fscrypt_control_page(struct page *page)
|
||||||
|
{
|
||||||
|
WARN_ON_ONCE(1);
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void fscrypt_restore_control_page(struct page *page)
|
static inline void fscrypt_restore_control_page(struct page *page)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,12 @@ extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *,
|
||||||
u64, gfp_t);
|
u64, gfp_t);
|
||||||
extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int,
|
extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int,
|
||||||
unsigned int, u64);
|
unsigned int, u64);
|
||||||
|
|
||||||
|
static inline struct page *fscrypt_control_page(struct page *page)
|
||||||
|
{
|
||||||
|
return ((struct fscrypt_ctx *)page_private(page))->w.control_page;
|
||||||
|
}
|
||||||
|
|
||||||
extern void fscrypt_restore_control_page(struct page *);
|
extern void fscrypt_restore_control_page(struct page *);
|
||||||
|
|
||||||
extern const struct dentry_operations fscrypt_d_ops;
|
extern const struct dentry_operations fscrypt_d_ops;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue