shithub: gefs

Download patch

ref: 10751c463369951caaa071b1a3e1ea0d3b20f30a
parent: 6b77f30c1b243f87562906e44332f5a9b6c328e0
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Apr 29 15:19:45 EDT 2023

cons: fix up documentation, clarify commands

--- a/cons.c
+++ b/cons.c
@@ -235,12 +235,12 @@
 permflip(int fd, char **ap, int)
 {
 	if(strcmp(ap[0], "on") == 0)
-		permissive = 0;
-	else if(strcmp(ap[0], "off") == 0)
 		permissive = 1;
+	else if(strcmp(ap[0], "off") == 0)
+		permissive = 0;
 	else
-		fprint(fd, "unknown permissive mode %s\n", ap[0]);
-	fprint(fd, "permission checking: %d → %d\n", !permissive, permissive);
+		fprint(2, "unknown permissive %s\n", ap[0]);
+	fprint(fd, "permissive: %d → %d\n", !permissive, permissive);
 }
 
 static void
@@ -249,16 +249,20 @@
 	char *msg =
 		"help\n"
 		"	show this help"
-		"sync\n"
-		"	flush all p[ending writes to disk\n"
-		"snap old new\n"
-		"	create or update a new snapshot based off old\n"
 		"check\n"
 		"	run a consistency check on the file system\n"
+		"df\n"
+		"	show disk usage stats\n"
+		"halt\n"
+		"	stop all writers, sync, and go read-only\n"
+		"perm [on|off]\n"
+		"	switch to/from permissive mode"
+		"snap (-d old | old new)\n"
+		"	delete, create or update a new snapshot based off old\n"
+		"sync\n"
+		"	flush all p[ending writes to disk\n"
 		"users\n"
 		"	reload user table from /adm/users in the main snap\n"
-		"disallow\n"
-		"	turn off permissive mode\n"
 		"show\n"
 		"	show debug debug information, the following dumps\n"
 		"	are supported:\n"
@@ -281,26 +285,26 @@
 
 Cmd cmdtab[] = {
 	/* admin */
-	{.name="sync",	.sub=nil,	.minarg=0, .maxarg=0, .fn=syncfs},
-	{.name="halt",	.sub=nil,	.minarg=0, .maxarg=0, .fn=haltfs},
-	{.name="snap",	.sub=nil,	.minarg=2, .maxarg=2, .fn=snapfs},
-	{.name="check",	.sub=nil,	.minarg=0, .maxarg=0, .fn=fsckfs},
-	{.name="perm",	.sub=nil,	.minarg=1, .maxarg=1, .fn=permflip},
-	{.name="help",	.sub=nil,	.minarg=0, .maxarg=0, .fn=help},
-	{.name="df",	.sub=nil, 	.minarg=0, .maxarg=0, .fn=showdf},
-	{.name="users",	.sub=nil,	.minarg=0, .maxarg=1, .fn=refreshusers},
-	{.name="stats", .sub=nil,	.minarg=0, .maxarg=0, .fn=stats},
+	{.name="check",		.sub=nil,	.minarg=0, .maxarg=0, .fn=fsckfs},
+	{.name="df",		.sub=nil, 	.minarg=0, .maxarg=0, .fn=showdf},
+	{.name="halt",		.sub=nil,	.minarg=0, .maxarg=0, .fn=haltfs},
+	{.name="help",		.sub=nil,	.minarg=0, .maxarg=0, .fn=help},
+	{.name="permissive",	.sub=nil,	.minarg=1, .maxarg=1, .fn=permflip},
+	{.name="snap",		.sub=nil,	.minarg=2, .maxarg=2, .fn=snapfs},
+	{.name="stats", 	.sub=nil,	.minarg=0, .maxarg=0, .fn=stats},
+	{.name="sync",		.sub=nil,	.minarg=0, .maxarg=0, .fn=syncfs},
+	{.name="users",		.sub=nil,	.minarg=0, .maxarg=1, .fn=refreshusers},
 
 	/* debugging */
-	{.name="show",	.sub="cache",	.minarg=0, .maxarg=0, .fn=showcache},
-	{.name="show",	.sub="dlist",	.minarg=0, .maxarg=0, .fn=showdlist},
-	{.name="show",	.sub="ent",	.minarg=1, .maxarg=2, .fn=showent},
-	{.name="show",	.sub="fid",	.minarg=0, .maxarg=0, .fn=showfid},
-	{.name="show",	.sub="free",	.minarg=0, .maxarg=0, .fn=showfree},
-	{.name="show",	.sub="snap",	.minarg=0, .maxarg=1, .fn=showsnap},
-	{.name="show",	.sub="tree",	.minarg=0, .maxarg=1, .fn=showtree},
-	{.name="show",	.sub="users",	.minarg=0, .maxarg=0, .fn=showusers},
-	{.name="debug",	.sub=nil,	.minarg=0, .maxarg=1, .fn=setdbg},
+	{.name="show",		.sub="cache",	.minarg=0, .maxarg=0, .fn=showcache},
+	{.name="show",		.sub="dlist",	.minarg=0, .maxarg=0, .fn=showdlist},
+	{.name="show",		.sub="ent",	.minarg=1, .maxarg=2, .fn=showent},
+	{.name="show",		.sub="fid",	.minarg=0, .maxarg=0, .fn=showfid},
+	{.name="show",		.sub="free",	.minarg=0, .maxarg=0, .fn=showfree},
+	{.name="show",		.sub="snap",	.minarg=0, .maxarg=1, .fn=showsnap},
+	{.name="show",		.sub="tree",	.minarg=0, .maxarg=1, .fn=showtree},
+	{.name="show",		.sub="users",	.minarg=0, .maxarg=0, .fn=showusers},
+	{.name="debug",		.sub=nil,	.minarg=0, .maxarg=1, .fn=setdbg},
 
 	{.name=nil, .sub=nil},
 };