linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>,
	David Howells <dhowells@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 17/17] ext4: Remove unused code from old mount api
Date: Wed,  6 Nov 2019 11:14:57 +0100	[thread overview]
Message-ID: <20191106101457.11237-18-lczerner@redhat.com> (raw)
In-Reply-To: <20191106101457.11237-1-lczerner@redhat.com>

Additionally rename ext4_fill_super_fc to ext4_fill_super

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/super.c | 227 +-----------------------------------------------
 1 file changed, 2 insertions(+), 225 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2f3296e81837..ae7ee4a2c9b6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -74,12 +74,9 @@ static void ext4_mark_recovery_complete(struct super_block *sb,
 static void ext4_clear_journal_err(struct super_block *sb,
 				   struct ext4_super_block *es);
 static int ext4_sync_fs(struct super_block *sb, int wait);
-static int ext4_remount(struct super_block *sb, int *flags, char *data);
 static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int ext4_unfreeze(struct super_block *sb);
 static int ext4_freeze(struct super_block *sb);
-static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
-		       const char *dev_name, void *data);
 static inline int ext2_feature_set_ok(struct super_block *sb);
 static inline int ext3_feature_set_ok(struct super_block *sb);
 static int ext4_feature_set_ok(struct super_block *sb, int readonly);
@@ -1589,98 +1586,6 @@ static const struct fs_parameter_description ext4_fs_parameters = {
 	.enums		= ext4_param_enums,
 };
 
-static const match_table_t tokens = {
-	{Opt_bsd_df, "bsddf"},
-	{Opt_minix_df, "minixdf"},
-	{Opt_grpid, "grpid"},
-	{Opt_grpid, "bsdgroups"},
-	{Opt_nogrpid, "nogrpid"},
-	{Opt_nogrpid, "sysvgroups"},
-	{Opt_resgid, "resgid=%u"},
-	{Opt_resuid, "resuid=%u"},
-	{Opt_sb, "sb=%u"},
-	{Opt_err_cont, "errors=continue"},
-	{Opt_err_panic, "errors=panic"},
-	{Opt_err_ro, "errors=remount-ro"},
-	{Opt_nouid32, "nouid32"},
-	{Opt_debug, "debug"},
-	{Opt_removed, "oldalloc"},
-	{Opt_removed, "orlov"},
-	{Opt_user_xattr, "user_xattr"},
-	{Opt_nouser_xattr, "nouser_xattr"},
-	{Opt_acl, "acl"},
-	{Opt_noacl, "noacl"},
-	{Opt_noload, "norecovery"},
-	{Opt_noload, "noload"},
-	{Opt_removed, "nobh"},
-	{Opt_removed, "bh"},
-	{Opt_commit, "commit=%u"},
-	{Opt_min_batch_time, "min_batch_time=%u"},
-	{Opt_max_batch_time, "max_batch_time=%u"},
-	{Opt_journal_dev, "journal_dev=%u"},
-	{Opt_journal_path, "journal_path=%s"},
-	{Opt_journal_checksum, "journal_checksum"},
-	{Opt_nojournal_checksum, "nojournal_checksum"},
-	{Opt_journal_async_commit, "journal_async_commit"},
-	{Opt_abort, "abort"},
-	{Opt_data_journal, "data=journal"},
-	{Opt_data_ordered, "data=ordered"},
-	{Opt_data_writeback, "data=writeback"},
-	{Opt_data_err_abort, "data_err=abort"},
-	{Opt_data_err_ignore, "data_err=ignore"},
-	{Opt_offusrjquota, "usrjquota="},
-	{Opt_usrjquota, "usrjquota=%s"},
-	{Opt_offgrpjquota, "grpjquota="},
-	{Opt_grpjquota, "grpjquota=%s"},
-	{Opt_jqfmt_vfsold, "jqfmt=vfsold"},
-	{Opt_jqfmt_vfsv0, "jqfmt=vfsv0"},
-	{Opt_jqfmt_vfsv1, "jqfmt=vfsv1"},
-	{Opt_grpquota, "grpquota"},
-	{Opt_noquota, "noquota"},
-	{Opt_quota, "quota"},
-	{Opt_usrquota, "usrquota"},
-	{Opt_prjquota, "prjquota"},
-	{Opt_barrier, "barrier=%u"},
-	{Opt_barrier, "barrier"},
-	{Opt_nobarrier, "nobarrier"},
-	{Opt_i_version, "i_version"},
-	{Opt_dax, "dax"},
-	{Opt_stripe, "stripe=%u"},
-	{Opt_delalloc, "delalloc"},
-	{Opt_warn_on_error, "warn_on_error"},
-	{Opt_nowarn_on_error, "nowarn_on_error"},
-	{Opt_lazytime, "lazytime"},
-	{Opt_nolazytime, "nolazytime"},
-	{Opt_debug_want_extra_isize, "debug_want_extra_isize=%u"},
-	{Opt_nodelalloc, "nodelalloc"},
-	{Opt_removed, "mblk_io_submit"},
-	{Opt_removed, "nomblk_io_submit"},
-	{Opt_block_validity, "block_validity"},
-	{Opt_noblock_validity, "noblock_validity"},
-	{Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
-	{Opt_journal_ioprio, "journal_ioprio=%u"},
-	{Opt_auto_da_alloc, "auto_da_alloc=%u"},
-	{Opt_auto_da_alloc, "auto_da_alloc"},
-	{Opt_noauto_da_alloc, "noauto_da_alloc"},
-	{Opt_dioread_nolock, "dioread_nolock"},
-	{Opt_dioread_lock, "dioread_lock"},
-	{Opt_discard, "discard"},
-	{Opt_nodiscard, "nodiscard"},
-	{Opt_init_itable, "init_itable=%u"},
-	{Opt_init_itable, "init_itable"},
-	{Opt_noinit_itable, "noinit_itable"},
-	{Opt_max_dir_size_kb, "max_dir_size_kb=%u"},
-	{Opt_test_dummy_encryption, "test_dummy_encryption"},
-	{Opt_nombcache, "nombcache"},
-	{Opt_nombcache, "no_mbcache"},	/* for backward compatibility */
-	{Opt_removed, "check=none"},	/* mount option from ext2/3 */
-	{Opt_removed, "nocheck"},	/* mount option from ext2/3 */
-	{Opt_removed, "reservation"},	/* mount option from ext2/3 */
-	{Opt_removed, "noreservation"}, /* mount option from ext2/3 */
-	{Opt_removed, "journal=%u"},	/* mount option from ext2/3 */
-	{Opt_err, NULL},
-};
-
 #define DEFAULT_JOURNAL_IOPRIO (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 3))
 static const char deprecated_msg[] =
 	"Mount option \"%s\" will be removed by %s\n"
@@ -5173,87 +5078,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb,
 	return err ? err : ret;
 }
 
-static void cleanup_ctx(struct ext4_fs_context *ctx)
-{
-	int i;
-
-	if (!ctx)
-		return;
-
-	for (i = 0; i < EXT4_MAXQUOTAS; i++) {
-		kfree(ctx->s_qf_names[i]);
-	}
-}
-
-static int ext4_fill_super(struct super_block *sb, void *data, int silent)
-{
-	struct ext4_fs_context ctx;
-	struct ext4_sb_info *sbi;
-	struct fs_context fc;
-	const char *descr;
-	char *orig_data;
-	int ret = -ENOMEM;
-
-	orig_data = kstrdup(data, GFP_KERNEL);
-	if (data && !orig_data)
-		return -ENOMEM;
-
-	/* Cleanup superblock name */
-	strreplace(sb->s_id, '/', '!');
-
-	memset(&fc, 0, sizeof(fc));
-	memset(&ctx, 0, sizeof(ctx));
-	fc.fs_private = &ctx;
-
-	ret = parse_options(&fc, (char *) data);
-	if (ret < 0)
-		goto free_data;
-
-	sbi = ext4_alloc_sbi(sb);
-	if (!sbi) {
-		ret = -ENOMEM;
-		goto free_data;
-	}
-
-	fc.s_fs_info = sbi;
-
-	sbi->s_sb_block = 1;	/* Default super block location */
-	if (ctx.spec & EXT4_SPEC_s_sb_block)
-		sbi->s_sb_block = ctx.s_sb_block;
-
-	ret = __ext4_fill_super(&fc, sb, silent);
-	if (ret < 0)
-		goto free_sbi;
-
-	if (EXT4_SB(sb)->s_journal) {
-		if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
-			descr = " journalled data mode";
-		else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA)
-			descr = " ordered data mode";
-		else
-			descr = " writeback data mode";
-	} else
-		descr = "out journal";
-
-	if (___ratelimit(&ext4_mount_msg_ratelimit, "EXT4-fs mount"))
-		ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. "
-			 "Opts: %.*s%s%s", descr,
-			 (int) sizeof(sbi->s_es->s_mount_opts),
-			 sbi->s_es->s_mount_opts,
-			 *sbi->s_es->s_mount_opts ? "; " : "", (char *)orig_data);
-
-	kfree(orig_data);
-	cleanup_ctx(&ctx);
-	return 0;
-free_sbi:
-	ext4_free_sbi(sbi);
-free_data:
-	kfree(orig_data);
-	cleanup_ctx(&ctx);
-	return ret;
-}
-
-static int ext4_fill_super_fc(struct super_block *sb, struct fs_context *fc)
+static int ext4_fill_super(struct super_block *sb, struct fs_context *fc)
 {
 	struct ext4_fs_context *ctx = fc->fs_private;
 	struct ext4_sb_info *sbi;
@@ -5286,7 +5111,7 @@ static int ext4_fill_super_fc(struct super_block *sb, struct fs_context *fc)
 
 static int ext4_get_tree(struct fs_context *fc)
 {
-	return get_tree_bdev(fc, ext4_fill_super_fc);
+	return get_tree_bdev(fc, ext4_fill_super);
 }
 
 /*
@@ -6107,48 +5932,6 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb,
 	return err;
 }
 
-static int ext4_remount(struct super_block *sb, int *flags, char *data)
-{
-	struct ext4_sb_info *sbi = EXT4_SB(sb);
-	struct ext4_fs_context ctx;
-	struct fs_context fc;
-	char *orig_data;
-	int ret;
-
-	orig_data = kstrdup(data, GFP_KERNEL);
-	if (data && !orig_data)
-		return -ENOMEM;
-
-	memset(&fc, 0, sizeof(fc));
-	memset(&ctx, 0, sizeof(ctx));
-
-	fc.fs_private = &ctx;
-	fc.purpose = FS_CONTEXT_FOR_RECONFIGURE;
-	fc.s_fs_info = sbi;
-
-	ret = parse_options(&fc, (char *) data);
-	if (ret < 0)
-		goto err_out;
-
-	ret = ext4_check_opt_consistency(&fc, sb);
-	if (ret < 0)
-		goto err_out;
-
-	ret = __ext4_remount(&fc, sb, flags);
-	if (ret < 0)
-		goto err_out;
-
-	ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data);
-	cleanup_ctx(&ctx);
-	kfree(orig_data);
-	return 0;
-
-err_out:
-	cleanup_ctx(&ctx);
-	kfree(orig_data);
-	return ret;
-}
-
 static int ext4_reconfigure(struct fs_context *fc)
 {
 	struct super_block *sb = fc->root->d_sb;
@@ -6670,12 +6453,6 @@ static int ext4_get_next_id(struct super_block *sb, struct kqid *qid)
 }
 #endif
 
-static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
-		       const char *dev_name, void *data)
-{
-	return mount_bdev(fs_type, flags, dev_name, data, ext4_fill_super);
-}
-
 #if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT2)
 static inline void register_as_ext2(void)
 {
-- 
2.21.0


      parent reply	other threads:[~2019-11-06 10:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 10:14 ext4: new mount API conversion Lukas Czerner
2019-11-06 10:14 ` [PATCH 01/17] vfs: Handle fs_param_neg_with_empty Lukas Czerner
2019-11-06 10:14 ` [PATCH 02/17] ext4: Add fs parameter description Lukas Czerner
2019-12-17  0:44   ` Al Viro
2019-12-17 12:19     ` Lukas Czerner
2019-12-17 15:20       ` Al Viro
2019-12-17 16:34         ` Lukas Czerner
2019-12-24 17:18           ` Al Viro
2019-11-06 10:14 ` [PATCH 03/17] ext4: move option validation to a separate function Lukas Czerner
2019-11-06 10:14 ` [PATCH 04/17] ext4: Change handle_mount_opt() to use fs_parameter Lukas Czerner
2019-11-06 10:14 ` [PATCH 05/17] ext4: Allow sb to be NULL in ext4_msg() Lukas Czerner
2019-11-06 10:14 ` [PATCH 06/17] ext4: move quota configuration out of handle_mount_opt() Lukas Czerner
2019-11-06 10:14 ` [PATCH 07/17] ext4: check ext2/3 compatibility outside handle_mount_opt() Lukas Czerner
2019-11-06 10:14 ` [PATCH 08/17] ext4: get rid of super block and sbi from handle_mount_ops() Lukas Czerner
2019-11-06 10:14 ` [PATCH 09/17] ext4: parse Opt_sb in handle_mount_opt() Lukas Czerner
2019-11-06 10:14 ` [PATCH 10/17] ext4: clean up return values " Lukas Czerner
2019-11-06 10:14 ` [PATCH 11/17] ext4: add ext4_get_tree for the new mount API Lukas Czerner
2019-11-06 10:14 ` [PATCH 12/17] ext4: refactor ext4_remount() Lukas Czerner
2019-11-06 10:14 ` [PATCH 13/17] ext4: add ext4_reconfigure for the new mount API Lukas Czerner
2019-11-06 10:14 ` [PATCH 14/17] ext4: add ext4_fc_free " Lukas Czerner
2019-11-06 10:14 ` [PATCH 15/17] ext4: switch to " Lukas Czerner
2019-11-06 10:14 ` [PATCH 16/17] ext4: change token2str() to use ext4_param_specs Lukas Czerner
2019-11-06 10:14 ` Lukas Czerner [this message]

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=20191106101457.11237-18-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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 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).