diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-26 08:52:31 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2019-05-07 21:58:31 +0200 |
commit | eea2c05d927b031034e222110a4fc34914d97ca4 (patch) | |
tree | a5fc633c4d6795d332e247aa7bdc280c32df7388 /fs/ubifs/sb.c | |
parent | 9ca2d732644484488db31123ecd3bf122b551566 (diff) | |
download | linux-eea2c05d927b031034e222110a4fc34914d97ca4.tar.bz2 |
ubifs: Remove #ifdef around CONFIG_FS_ENCRYPTION
ifdefs reduce readablity and compile coverage. This removes the ifdefs
around CONFIG_FS_ENCRYPTION by using IS_ENABLED and relying on static
inline wrappers. A new static inline wrapper for setting sb->s_cop is
introduced to allow filesystems to unconditionally compile in their
s_cop operations.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r-- | fs/ubifs/sb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 67fac1e8adfb..2afc8b1d4c3b 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -748,14 +748,12 @@ int ubifs_read_superblock(struct ubifs_info *c) goto out; } -#ifndef CONFIG_FS_ENCRYPTION - if (c->encrypted) { + if (!IS_ENABLED(CONFIG_UBIFS_FS_ENCRYPTION) && c->encrypted) { ubifs_err(c, "file system contains encrypted files but UBIFS" " was built without crypto support."); err = -EINVAL; goto out; } -#endif /* Automatically increase file system size to the maximum size */ c->old_leb_cnt = c->leb_cnt; @@ -943,6 +941,9 @@ int ubifs_enable_encryption(struct ubifs_info *c) int err; struct ubifs_sb_node *sup = c->sup_node; + if (!IS_ENABLED(CONFIG_UBIFS_FS_ENCRYPTION)) + return -EOPNOTSUPP; + if (c->encrypted) return 0; |