[Cluster-devel] [PATCH 2/5] gfs2-utils: Expressly expunge 'expert mode'

Andrew Price anprice at redhat.com
Wed May 7 14:33:38 UTC 2014


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 at 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




More information about the Cluster-devel mailing list