All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" <tytso@mit.edu>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, Eric Biggers <ebiggers@google.com>
Subject: [PATCH v2 05/11] fscrypt: remove unneeded empty fscrypt_operations structs
Date: Mon,  9 Oct 2017 12:15:38 -0700	[thread overview]
Message-ID: <20171009191544.43656-6-ebiggers3@gmail.com> (raw)
In-Reply-To: <20171009191544.43656-1-ebiggers3@gmail.com>

From: Eric Biggers <ebiggers@google.com>

In the case where a filesystem has been configured without encryption
support, there is no longer any need to initialize ->s_cop at all, since
none of the methods are ever called.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/ext4/super.c  | 5 ++---
 fs/f2fs/super.c  | 5 ++---
 fs/ubifs/super.c | 7 ++-----
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index bc63cdf194e3..04f3670748e7 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1244,9 +1244,6 @@ static const struct fscrypt_operations ext4_cryptops = {
 	.empty_dir		= ext4_empty_dir,
 	.max_namelen		= ext4_max_namelen,
 };
-#else
-static const struct fscrypt_operations ext4_cryptops = {
-};
 #endif
 
 #ifdef CONFIG_QUOTA
@@ -3998,7 +3995,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_op = &ext4_sops;
 	sb->s_export_op = &ext4_export_ops;
 	sb->s_xattr = ext4_xattr_handlers;
+#ifdef CONFIG_EXT4_FS_ENCRYPTION
 	sb->s_cop = &ext4_cryptops;
+#endif
 #ifdef CONFIG_QUOTA
 	sb->dq_op = &ext4_quota_operations;
 	if (ext4_has_feature_quota(sb))
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 1cb41f711ab8..c1c7183b3527 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1597,9 +1597,6 @@ static const struct fscrypt_operations f2fs_cryptops = {
 	.empty_dir	= f2fs_empty_dir,
 	.max_namelen	= f2fs_max_namelen,
 };
-#else
-static const struct fscrypt_operations f2fs_cryptops = {
-};
 #endif
 
 static struct inode *f2fs_nfs_get_inode(struct super_block *sb,
@@ -2318,7 +2315,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 #endif
 
 	sb->s_op = &f2fs_sops;
+#ifdef CONFIG_F2FS_FS_ENCRYPTION
 	sb->s_cop = &f2fs_cryptops;
+#endif
 	sb->s_xattr = f2fs_xattr_handlers;
 	sb->s_export_op = &f2fs_export_ops;
 	sb->s_magic = F2FS_SUPER_MAGIC;
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index adaca6088836..7503e7cdf870 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2007,11 +2007,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
 	return c;
 }
 
-#ifndef CONFIG_UBIFS_FS_ENCRYPTION
-const struct fscrypt_operations ubifs_crypt_operations = {
-};
-#endif
-
 static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct ubifs_info *c = sb->s_fs_info;
@@ -2054,7 +2049,9 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
 		sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE;
 	sb->s_op = &ubifs_super_operations;
 	sb->s_xattr = ubifs_xattr_handlers;
+#ifdef CONFIG_UBIFS_FS_ENCRYPTION
 	sb->s_cop = &ubifs_crypt_operations;
+#endif
 
 	mutex_lock(&c->umount_mutex);
 	err = mount_ubifs(c);
-- 
2.14.2.920.gcf0c67979c-goog

  parent reply	other threads:[~2017-10-09 19:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 19:15 [PATCH v2 00/11] fscrypt: add some higher-level helper functions Eric Biggers
2017-10-09 19:15 ` [PATCH v2 01/11] fscrypt: clean up include file mess Eric Biggers
2017-10-09 19:15 ` [PATCH v2 02/11] fs, fscrypt: add an S_ENCRYPTED inode flag Eric Biggers
2017-10-09 19:15   ` Eric Biggers
2017-10-09 19:15 ` [PATCH v2 03/11] fscrypt: switch from ->is_encrypted() to IS_ENCRYPTED() Eric Biggers
2017-10-09 19:15 ` [PATCH v2 04/11] fscrypt: remove ->is_encrypted() Eric Biggers
2017-10-09 19:15 ` Eric Biggers [this message]
2017-10-09 19:15 ` [PATCH v2 06/11] fscrypt: new helper function - fscrypt_require_key() Eric Biggers
2017-10-09 19:15 ` [PATCH v2 07/11] fscrypt: new helper function - fscrypt_file_open() Eric Biggers
2017-10-09 19:15   ` Eric Biggers
2017-10-09 19:15 ` [PATCH v2 08/11] fscrypt: new helper function - fscrypt_prepare_link() Eric Biggers
2017-10-09 19:15   ` Eric Biggers
2017-10-09 19:15 ` [PATCH v2 09/11] fscrypt: new helper function - fscrypt_prepare_rename() Eric Biggers
2017-10-09 19:15   ` Eric Biggers
2017-10-09 19:15 ` [PATCH v2 10/11] fscrypt: new helper function - fscrypt_prepare_lookup() Eric Biggers
2017-10-09 19:15 ` [PATCH v2 11/11] fscrypt: new helper function - fscrypt_prepare_setattr() Eric Biggers
2017-10-20 19:44 ` [PATCH v2 00/11] fscrypt: add some higher-level helper functions Theodore Ts'o
2017-10-20 19:44   ` Theodore Ts'o

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=20171009191544.43656-6-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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.