]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fscrypt: move fscrypt_has_encryption_key() to supp/notsupp headers
authorEric Biggers <ebiggers@google.com>
Fri, 5 Jan 2018 18:44:52 +0000 (10:44 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 12 Jan 2018 03:06:17 +0000 (22:06 -0500)
fscrypt_has_encryption_key() 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>
include/linux/fscrypt.h
include/linux/fscrypt_notsupp.h
include/linux/fscrypt_supp.h

index 08b4b40c5aa83ac265f0d5dadbb06cde79641323..d1c891b5bd9cbee7a62d521eafe82afdf47966c7 100644 (file)
@@ -129,11 +129,6 @@ static inline struct page *fscrypt_control_page(struct page *page)
        return ((struct fscrypt_ctx *)page_private(page))->w.control_page;
 }
 
-static inline bool fscrypt_has_encryption_key(const struct inode *inode)
-{
-       return (inode->i_crypt_info != NULL);
-}
-
 #include <linux/fscrypt_supp.h>
 
 #else /* !__FS_HAS_ENCRYPTION */
@@ -144,11 +139,6 @@ static inline struct page *fscrypt_control_page(struct page *page)
        return ERR_PTR(-EINVAL);
 }
 
-static inline bool fscrypt_has_encryption_key(const struct inode *inode)
-{
-       return 0;
-}
-
 #include <linux/fscrypt_notsupp.h>
 #endif /* __FS_HAS_ENCRYPTION */
 
index 63e58808519aaeb60aea66287b40963668a8c6bc..52e3302854575cda9f521de858d9e95b2f3d365f 100644 (file)
 #ifndef _LINUX_FSCRYPT_NOTSUPP_H
 #define _LINUX_FSCRYPT_NOTSUPP_H
 
+static inline bool fscrypt_has_encryption_key(const struct inode *inode)
+{
+       return false;
+}
+
 /* crypto.c */
 static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
                                                  gfp_t gfp_flags)
index cf9e9fc02f0afe7348404ca769927d587a63ec64..79bb8beae018b34792144f58515224702311f94f 100644 (file)
 #ifndef _LINUX_FSCRYPT_SUPP_H
 #define _LINUX_FSCRYPT_SUPP_H
 
+static inline bool fscrypt_has_encryption_key(const struct inode *inode)
+{
+       return (inode->i_crypt_info != NULL);
+}
+
 /* crypto.c */
 extern struct kmem_cache *fscrypt_info_cachep;
 extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);