All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani <ritesh.list@gmail.com>
To: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org
Cc: Eric Biggers <ebiggers@kernel.org>, Theodore Ts'o <tytso@mit.edu>,
	Jan Kara <jack@suse.cz>, Ritesh Harjani <ritesh.list@gmail.com>
Subject: [RFC 5/6] ext4: Move all encryption related into a common #ifdef
Date: Thu, 21 Apr 2022 10:53:21 +0530	[thread overview]
Message-ID: <74855c5d50db92722213a738c0fb43a878dc6557.1650517532.git.ritesh.list@gmail.com> (raw)
In-Reply-To: <cover.1650517532.git.ritesh.list@gmail.com>

This just moves left over usages of #ifdef CONFIG_FS_ENCRYPTION
into a common place for function/macro definitions.

Signed-off-by: Ritesh Harjani <ritesh.list@gmail.com>
---
 fs/ext4/ext4.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index caf154db4680..2fb69c500063 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1440,12 +1440,6 @@ struct ext4_super_block {

 #ifdef __KERNEL__

-#ifdef CONFIG_FS_ENCRYPTION
-#define DUMMY_ENCRYPTION_ENABLED(sbi) ((sbi)->s_dummy_enc_policy.policy != NULL)
-#else
-#define DUMMY_ENCRYPTION_ENABLED(sbi) (0)
-#endif
-
 /* Number of quota types we support */
 #define EXT4_MAXQUOTAS 3

@@ -2740,6 +2734,8 @@ int ext4_fname_prepare_lookup(struct inode *dir, struct dentry *dentry,

 void ext4_fname_free_filename(struct ext4_filename *fname);

+#define DUMMY_ENCRYPTION_ENABLED(sbi) ((sbi)->s_dummy_enc_policy.policy != NULL)
+
 #else /* !CONFIG_FS_ENCRYPTION */
 static inline int ext4_fname_setup_filename(struct inode *dir,
 					    const struct qstr *iname,
@@ -2772,6 +2768,8 @@ static inline void ext4_fname_free_filename(struct ext4_filename *fname)
 	fname->cf_name.name = NULL;
 #endif
 }
+
+#define DUMMY_ENCRYPTION_ENABLED(sbi) (0)
 #endif /* !CONFIG_FS_ENCRYPTION */

 /* dir.c */
--
2.31.1


  parent reply	other threads:[~2022-04-21  5:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  5:23 [RFC 0/6] ext4: Move out crypto ops to ext4_crypto.c Ritesh Harjani
2022-04-21  5:23 ` [RFC 1/6] fscrypt: Provide definition of fscrypt_set_test_dummy_encryption Ritesh Harjani
2022-04-21  5:23 ` [RFC 2/6] ext4: Move ext4 crypto code to its own file ext4_crypto.c Ritesh Harjani
2022-04-21  5:23 ` [RFC 3/6] ext4: Directly opencode ext4_set_test_dummy_encryption Ritesh Harjani
2022-04-21  5:23 ` [RFC 4/6] ext4: Cleanup function defs from ext4.h into ext4_crypto.c Ritesh Harjani
2022-04-21  5:23 ` Ritesh Harjani [this message]
2022-04-21  5:23 ` [RFC 6/6] ext4: Use provided macro for checking dummy_enc_policy Ritesh Harjani
2022-04-21  7:24 ` [RFC 0/6] ext4: Move out crypto ops to ext4_crypto.c Eric Biggers
2022-04-21 15:07   ` Ritesh Harjani
2022-05-01  7:18 ` Eric Biggers
2022-05-02 14:26   ` Ritesh Harjani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74855c5d50db92722213a738c0fb43a878dc6557.1650517532.git.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.