shithub: lwext4

Download patch

ref: 8dccafbc15132ad5ecff064a19d36d31d72b11c7
parent: 58a418061b26a07e335a237af3882aba29d7ad4b
author: gkostka <kostka.grzegorz@gmail.com>
date: Wed Dec 30 20:12:20 EST 2015

lwext4_server: improve opt list

--- a/fs_test/lwext4_server.c
+++ b/fs_test/lwext4_server.c
@@ -70,15 +70,15 @@
 static char *ext4_fname = "ext2";
 
 /**@brief   Verbose mode*/
-static int verbose = 0;
+static bool verbose = false;
 
 /**@brief   Winpart mode*/
-static int winpart = 0;
+static bool winpart = false;
 
 /**@brief   Blockdev handle*/
 static struct ext4_blockdev *bd;
 
-static int cache_wb = 0;
+static bool cache_wb = false;
 
 static char read_buffer[MAX_RW_BUFFER];
 static char write_buffer[MAX_RW_BUFFER];
@@ -299,12 +299,12 @@
 	static struct option long_options[] = {
 	    {"image", required_argument, 0, 'i'},
 	    {"port", required_argument, 0, 'p'},
-	    {"verbose", required_argument, 0, 'v'},
-	    {"winpart", required_argument, 0, 'w'},
-	    {"cache_wb", required_argument, 0, 'c'},
+	    {"verbose", no_argument, 0, 'v'},
+	    {"winpart", no_argument, 0, 'w'},
+	    {"cache_wb", no_argument, 0, 'c'},
 	    {0, 0, 0, 0}};
 
-	while (-1 != (c = getopt_long(argc, argv, "c:i:p:v:w:", long_options,
+	while (-1 != (c = getopt_long(argc, argv, "i:p:vcw", long_options,
 				      &option_index))) {
 
 		switch (c) {
@@ -315,13 +315,13 @@
 			connection_port = atoi(optarg);
 			break;
 		case 'v':
-			verbose = atoi(optarg);
+			verbose = true;
 			break;
 		case 'c':
-			cache_wb = atoi(optarg);
+			cache_wb = true;
 			break;
 		case 'w':
-			winpart = atoi(optarg);
+			winpart = true;
 			break;
 		default:
 			printf("%s", usage);
@@ -410,6 +410,9 @@
 		printf("Param list error\n");
 		return -1;
 	}
+
+	if (verbose)
+		ext4_dmask_set(DEBUG_ALL);
 
 	rc = ext4_mount(dev_name, mount_point);
 	if (rc != EOK)