fscrypt: trim down fscrypt.h includes
authorEric Biggers <ebiggers@google.com>
Fri, 5 Jan 2018 18:45:00 +0000 (10:45 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 12 Jan 2018 03:06:19 +0000 (22:06 -0500)
fscrypt.h included way too many other headers, given that it is included
by filesystems both with and without encryption support.  Trim down the
includes list by moving the needed includes into more appropriate
places, and removing the unneeded ones.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/crypto.c
fs/crypto/fname.c
fs/crypto/keyinfo.c
include/linux/fscrypt.h
include/linux/fscrypt_supp.h

index 732a786cce9deabe490410ee6dfb15c72fc8f048..ce654526c0fb0d48750be1f2ab306c5be4cc8dd1 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/dcache.h>
 #include <linux/namei.h>
 #include <crypto/aes.h>
+#include <crypto/skcipher.h>
 #include "fscrypt_private.h"
 
 static unsigned int num_prealloc_crypto_pages = 32;
index b8c5061553b1c167e83a225ef3e0d11fb81be51d..52d4dbe1e8e79c0a3af433f1d4f8778c541d6aa5 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/scatterlist.h>
 #include <linux/ratelimit.h>
+#include <crypto/skcipher.h>
 #include "fscrypt_private.h"
 
 static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
index 5e6e846f5a24dde322846fe54f642a40fbdc2f3c..c115eac4b4cfa1fed7f271880c84a42b033102e9 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/ratelimit.h>
 #include <crypto/aes.h>
 #include <crypto/sha.h>
+#include <crypto/skcipher.h>
 #include "fscrypt_private.h"
 
 static struct crypto_shash *essiv_hash_tfm;
index 3045fc49d3ca01b1fc441724cbed8db1c33c4d4c..071ebabfc287b28f289bcc05b8ed7d1b553250d4 100644 (file)
 #ifndef _LINUX_FSCRYPT_H
 #define _LINUX_FSCRYPT_H
 
-#include <linux/key.h>
 #include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/bio.h>
-#include <linux/dcache.h>
-#include <crypto/skcipher.h>
-#include <uapi/linux/fs.h>
 
 #define FS_CRYPTO_BLOCK_SIZE           16
 
index ce61caf26f40ff5051d1608434f28a7079364be3..562a9bc04560568dbfb4bab61461606096c2ce58 100644 (file)
@@ -11,6 +11,9 @@
 #ifndef _LINUX_FSCRYPT_SUPP_H
 #define _LINUX_FSCRYPT_SUPP_H
 
+#include <linux/mm.h>
+#include <linux/slab.h>
+
 /*
  * fscrypt superblock flags
  */