fscrypt: clean up include file mess
authorDave Chinner <dchinner@redhat.com>
Mon, 9 Oct 2017 19:15:34 +0000 (12:15 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 5 Jan 2018 00:17:03 +0000 (16:17 -0800)
commit8ec05db2542c76e0144519ce882409d4c1aa6959
tree4666da9fa06a1c116ff027606cc5118ec209e8fc
parent7b538c1c32e1af67d13ca5e3832bfe5df36a28a2
fscrypt: clean up include file mess

Filesystems have to include different header files based on whether they
are compiled with encryption support or not. That's nasty and messy.

Instead, rationalise the headers so we have a single include fscrypt.h
and let it decide what internal implementation to include based on the
__FS_HAS_ENCRYPTION define.  Filesystems set __FS_HAS_ENCRYPTION to 1
before including linux/fscrypt.h if they are built with encryption
support.  Otherwise, they must set __FS_HAS_ENCRYPTION to 0.

Add guards to prevent fscrypt_supp.h and fscrypt_notsupp.h from being
directly included by filesystems.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[EB: use 1 and 0 rather than defined/undefined]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/fscrypt_private.h
fs/ext4/ext4.h
fs/f2fs/f2fs.h
fs/ubifs/ubifs.h
include/linux/fscrypt.h [new file with mode: 0644]
include/linux/fscrypt_common.h [deleted file]
include/linux/fscrypt_notsupp.h
include/linux/fscrypt_supp.h