linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: tytso@mit.edu
Cc: linux-ext4@vger.kernel.org, Andreas Dilger <adilger@dilger.ca>
Subject: [PATCH] mke2fs: sort option parsing, deprecate "-R"
Date: Mon, 29 Apr 2013 18:16:01 -0600	[thread overview]
Message-ID: <1367280961-16458-1-git-send-email-adilger@dilger.ca> (raw)

A minor cleanup to order the command-line option parsing in
alphabetical order, except for "-E" and "-R", which need to
be co-located.

Print a message that the "-R" option is deprecated.  It has
been deprecated since 2005 (commit c6a44136b9b).

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
---
 misc/mke2fs.c           |   81 ++++++++++++++++++++++++----------------------
 tests/m_raid_opt/script |    2 +-
 2 files changed, 43 insertions(+), 40 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index fe5ce7d..ac5071c 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1357,6 +1357,16 @@ profile_error:
 		case 'D':
 			direct_io = 1;
 			break;
+		case 'R':
+			com_err(program_name, 0,
+				_("'-R' is deprecated, use '-E' instead"));
+			/* fallthrough */
+		case 'E':
+			extended_opts = optarg;
+			break;
+		case 'F':
+			force++;
+			break;
 		case 'g':
 			fs_param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
 			if (*tmp) {
@@ -1396,6 +1406,18 @@ profile_error:
 				exit(1);
 			}
 			break;
+		case 'I':
+			inode_size = strtoul(optarg, &tmp, 0);
+			if (*tmp) {
+				com_err(program_name, 0,
+					_("invalid inode size - %s"), optarg);
+				exit(1);
+			}
+			break;
+		case 'j':
+			if (!journal_size)
+				journal_size = -1;
+			break;
 		case 'J':
 			parse_journal_opts(optarg);
 			break;
@@ -1406,10 +1428,6 @@ profile_error:
 					  "instead!\n"));
 			discard = 0;
 			break;
-		case 'j':
-			if (!journal_size)
-				journal_size = -1;
-			break;
 		case 'l':
 			bad_blocks_filename = malloc(strlen(optarg)+1);
 			if (!bad_blocks_filename) {
@@ -1419,6 +1437,9 @@ profile_error:
 			}
 			strcpy(bad_blocks_filename, optarg);
 			break;
+		case 'L':
+			volume_label = optarg;
+			break;
 		case 'm':
 			reserved_ratio = strtod(optarg, &tmp);
 			if ( *tmp || reserved_ratio > 50 ||
@@ -1429,12 +1450,26 @@ profile_error:
 				exit(1);
 			}
 			break;
+		case 'M':
+			mount_dir = optarg;
+			break;
 		case 'n':
 			noaction++;
 			break;
+		case 'N':
+			num_inodes = strtoul(optarg, &tmp, 0);
+			if (*tmp) {
+				com_err(program_name, 0,
+					_("bad num inodes - %s"), optarg);
+					exit(1);
+			}
+			break;
 		case 'o':
 			creator_os = optarg;
 			break;
+		case 'O':
+			fs_features = optarg;
+			break;
 		case 'q':
 			quiet = 1;
 			break;
@@ -1450,41 +1485,6 @@ profile_error:
 		case 's':	/* deprecated */
 			s_opt = atoi(optarg);
 			break;
-		case 'I':
-			inode_size = strtoul(optarg, &tmp, 0);
-			if (*tmp) {
-				com_err(program_name, 0,
-					_("invalid inode size - %s"), optarg);
-				exit(1);
-			}
-			break;
-		case 'v':
-			verbose = 1;
-			break;
-		case 'F':
-			force++;
-			break;
-		case 'L':
-			volume_label = optarg;
-			break;
-		case 'M':
-			mount_dir = optarg;
-			break;
-		case 'N':
-			num_inodes = strtoul(optarg, &tmp, 0);
-			if (*tmp) {
-				com_err(program_name, 0,
-					_("bad num inodes - %s"), optarg);
-					exit(1);
-			}
-			break;
-		case 'O':
-			fs_features = optarg;
-			break;
-		case 'E':
-		case 'R':
-			extended_opts = optarg;
-			break;
 		case 'S':
 			super_only = 1;
 			break;
@@ -1507,6 +1507,9 @@ profile_error:
 		case 'U':
 			fs_uuid = optarg;
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		case 'V':
 			/* Print version number and exit */
 			show_version_only++;
diff --git a/tests/m_raid_opt/script b/tests/m_raid_opt/script
index 1e47cc1..296fe94 100644
--- a/tests/m_raid_opt/script
+++ b/tests/m_raid_opt/script
@@ -1,4 +1,4 @@
 DESCRIPTION="raid options"
 FS_SIZE=131072
-MKE2FS_OPTS="-R stride=13 -O sparse_super -g 1024"
+MKE2FS_OPTS="-E stride=13 -O sparse_super -g 1024"
 . $cmd_dir/run_mke2fs
-- 
1.7.3.4


             reply	other threads:[~2013-04-30  0:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30  0:16 Andreas Dilger [this message]
2013-06-15 22:48 ` [PATCH] mke2fs: sort option parsing, deprecate "-R" 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=1367280961-16458-1-git-send-email-adilger@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=linux-ext4@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 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).