summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-01-05 10:44:53 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-04-08 02:07:59 -0700
commitdfe0b3b1b67f6489ea857ef75135e27eb16638d4 (patch)
treeac467d8d8045376f539299372db4590eee954a34 /include/linux
parent3a2c7917782292956a32d4e1df8dc3dbecc01b25 (diff)
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fscrypt.h18
-rw-r--r--include/linux/fscrypt_notsupp.h5
-rw-r--r--include/linux/fscrypt_supp.h6
3 files changed, 13 insertions, 16 deletions
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 1e2343b46262..0961315a5fff 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -119,24 +119,10 @@ static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
}
#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>
-
-#else /* !__FS_HAS_ENCRYPTION */
-
-static inline struct page *fscrypt_control_page(struct page *page)
-{
- WARN_ON_ONCE(1);
- return ERR_PTR(-EINVAL);
-}
-
+#else
#include <linux/fscrypt_notsupp.h>
-#endif /* __FS_HAS_ENCRYPTION */
+#endif
/**
* fscrypt_require_key - require an inode's encryption key
diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h
index f8685c25b7b3..3d394a0737ed 100644
--- a/include/linux/fscrypt_notsupp.h
+++ b/include/linux/fscrypt_notsupp.h
@@ -47,6 +47,11 @@ static inline int fscrypt_decrypt_page(const struct inode *inode,
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)
{
diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h
index 1fb73a6892b1..95ea7265e25b 100644
--- a/include/linux/fscrypt_supp.h
+++ b/include/linux/fscrypt_supp.h
@@ -24,6 +24,12 @@ extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *,
u64, gfp_t);
extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int,
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 const struct dentry_operations fscrypt_d_ops;