linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled
@ 2018-02-22 23:39 Eric Biggers
  0 siblings, 0 replies; only message in thread
From: Eric Biggers @ 2018-02-22 23:39 UTC (permalink / raw)
  To: linux-fscrypt, Theodore Y . Ts'o; +Cc: linux-fsdevel, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

Now that filesystems only set and use their fscrypt_operations when they
are built with encryption support, we can remove ->s_cop from
'struct super_block' when FS_ENCRYPTION is disabled.  This saves a few
bytes on some kernels and also makes it consistent with ->i_crypt_info.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 include/linux/fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2a815560fda0..ae0dae78d1c6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1361,9 +1361,9 @@ struct super_block {
 	void                    *s_security;
 #endif
 	const struct xattr_handler **s_xattr;
-
+#if IS_ENABLED(CONFIG_FS_ENCRYPTION)
 	const struct fscrypt_operations	*s_cop;
-
+#endif
 	struct hlist_bl_head	s_roots;	/* alternate root dentries for NFS */
 	struct list_head	s_mounts;	/* list of mounts; _not_ for fs use */
 	struct block_device	*s_bdev;
-- 
2.16.1.291.g4437f3f132-goog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-22 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 23:39 [PATCH] fs, fscrypt: only define ->s_cop when FS_ENCRYPTION is enabled Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).