cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/5] gfs2-utils: Expressly expunge 'expert mode'
Date: Wed,  7 May 2014 15:33:38 +0100	[thread overview]
Message-ID: <1399473221-28521-2-git-send-email-anprice@redhat.com> (raw)
In-Reply-To: <1399473221-28521-1-git-send-email-anprice@redhat.com>

mkfs.gfs2 and gfs2_jadd used struct gfs2_sbd.expert to put them into an
undocumented 'expert mode' but didn't really do anything useful in that
mode. Remove that field and other 'expert' references.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/libgfs2.h |  2 --
 gfs2/mkfs/main_jadd.c  | 15 ++++-----------
 gfs2/mkfs/main_mkfs.c  | 23 +++++++----------------
 3 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3353f5f..b98d314 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -278,7 +278,6 @@ struct gfs2_sbd {
 
 	int debug;
 	int quiet;
-	int expert;
 	int override;
 
 	char device_name[PATH_MAX];
@@ -352,7 +351,6 @@ struct metapath {
 #define GFS2_MIN_GROW_SIZE          (10)
 #define GFS2_EXCESSIVE_RGS          (10000)
 
-#define GFS2_EXP_MIN_RGSIZE         (1)
 #define GFS2_MIN_RGSIZE             (32)
 #define GFS2_MAX_RGSIZE             (2048)
 
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 815dd52..47af055 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -117,10 +117,10 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
 {
 	int cont = TRUE;
 	int optchar;
-	
+
 	while (cont) {
-		optchar = getopt(argc, argv, "c:DhJ:j:qu:VX");
-		
+		optchar = getopt(argc, argv, "c:DhJ:j:qu:V");
+
 		switch (optchar) {
 		case 'c':
 			sdp->qcsize = atoi(optarg);
@@ -147,9 +147,6 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
 			printf(REDHAT_COPYRIGHT "\n");
 			exit(0);
 			break;
-		case 'X':
-			sdp->expert = TRUE;
-			break;
 		case ':':
 		case '?':
 			fprintf(stderr, _("Please use '-h' for help.\n"));
@@ -200,17 +197,13 @@ verify_arguments(struct gfs2_sbd *sdp)
  *
  */
 
-static void 
-print_results(struct gfs2_sbd *sdp)
+static void print_results(struct gfs2_sbd *sdp)
 {
 	if (sdp->debug)
 		printf("\n");
 	else if (sdp->quiet)
 		return;
 
-	if (sdp->expert)
-		printf(_("Expert mode:            on\n"));
-
 	printf( _("Filesystem: %s\n"), sdp->path_name);
 	printf( _("Old Journals: %u\n"), sdp->orig_journals);
 	printf( _("New Journals: %u\n"), sdp->md.journals);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 26aeba2..31b1e62 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -146,7 +146,6 @@ struct mkfs_opts {
 
 	unsigned override:1;
 	unsigned quiet:1;
-	unsigned expert:1;
 	unsigned debug:1;
 	unsigned confirm:1;
 	unsigned align:1;
@@ -294,7 +293,7 @@ static void opts_get(int argc, char *argv[], struct mkfs_opts *opts)
 {
 	int c;
 	while (1) {
-		c = getopt(argc, argv, "-b:c:DhJ:j:KOo:p:qr:t:VX");
+		c = getopt(argc, argv, "-b:c:DhJ:j:KOo:p:qr:t:V");
 		if (c == -1)
 			break;
 
@@ -351,9 +350,6 @@ static void opts_get(int argc, char *argv[], struct mkfs_opts *opts)
 			printf(REDHAT_COPYRIGHT "\n");
 			exit(EXIT_SUCCESS);
 			break;
-		case 'X':
-			opts->expert = 1;
-			break;
 		case ':':
 		case '?':
 			fprintf(stderr, _("Please use '-h' for help.\n"));
@@ -511,17 +507,12 @@ static void opts_check(struct mkfs_opts *opts)
 		exit(1);
 	}
 
-	if (!opts->expert)
-		test_locking(opts->lockproto, opts->locktable);
-	if (opts->expert) {
-		if (GFS2_EXP_MIN_RGSIZE > opts->rgsize || opts->rgsize > GFS2_MAX_RGSIZE)
-			/* Translators: gfs2 file systems are split into equal sized chunks called
-			   resource groups. We're checking that the user gave a valid size for them. */
-			die( _("bad resource group size\n"));
-	} else {
-		if (GFS2_MIN_RGSIZE > opts->rgsize || opts->rgsize > GFS2_MAX_RGSIZE)
-			die( _("bad resource group size\n"));
-	}
+	test_locking(opts->lockproto, opts->locktable);
+
+	if (GFS2_MIN_RGSIZE > opts->rgsize || opts->rgsize > GFS2_MAX_RGSIZE)
+		/* Translators: gfs2 file systems are split into equal sized chunks called
+		   resource groups. We're checking that the user gave a valid size for them. */
+		die( _("bad resource group size\n"));
 
 	if (!opts->journals)
 		die( _("no journals specified\n"));
-- 
1.9.0



  reply	other threads:[~2014-05-07 14:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 14:33 [Cluster-devel] [PATCH 1/5] fsck.gfs2: Log to syslog on start and exit Andrew Price
2014-05-07 14:33 ` Andrew Price [this message]
2014-05-07 14:48   ` [Cluster-devel] [PATCH 2/5] gfs2-utils: Expressly expunge 'expert mode' Bob Peterson
2014-05-07 15:01     ` Andrew Price
2014-05-07 14:33 ` [Cluster-devel] [PATCH 3/5] libgfs2: Remove UI fields from struct gfs2_sbd Andrew Price
2014-05-07 14:33 ` [Cluster-devel] [PATCH 4/5] libgfs2: Remove debug field from gfs2_sbd Andrew Price
2014-05-07 14:33 ` [Cluster-devel] [PATCH 5/5] libgfs2: Remove logging API Andrew Price
2014-05-07 14:48   ` Steven Whitehouse
2014-05-07 14:55   ` Bob Peterson
2014-05-07 15:07     ` Andrew Price
2014-05-07 15:17       ` Andrew Price
2014-05-07 14:39 ` [Cluster-devel] [PATCH 1/5] fsck.gfs2: Log to syslog on start and exit Steven Whitehouse
2014-05-07 15:15   ` Andrew Price

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=1399473221-28521-2-git-send-email-anprice@redhat.com \
    --to=anprice@redhat.com \
    /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).