[Ocfs2-tools-commits] smushran commits r510 - trunk/debugfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Dec 23 14:40:48 CST 2004


Author: smushran
Date: 2004-12-23 14:40:45 -0600 (Thu, 23 Dec 2004)
New Revision: 510

Modified:
   trunk/debugfs.ocfs2/commands.c
   trunk/debugfs.ocfs2/debugfs.ocfs2.8.in
   trunk/debugfs.ocfs2/main.c
Log:
updated help and manpages in debugfs

Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c	2004-12-23 02:43:06 UTC (rev 509)
+++ trunk/debugfs.ocfs2/commands.c	2004-12-23 20:40:45 UTC (rev 510)
@@ -63,26 +63,26 @@
 dbgfs_gbls gbls;
 
 static Command commands[] = {
-	{ "open",	do_open },
-	{ "close",	do_close },
+	{ "cat",	do_cat },
 	{ "cd",		do_cd },
-	{ "ls",		do_ls },
 	{ "chroot",	do_chroot },
-	{ "lcd",	do_lcd },
+	{ "close",	do_close },
+	{ "curdev",	do_curdev },
+	{ "dump",	do_dump },
+	{ "extent",	do_extent },
+	{ "group",	do_group },
 	{ "help",	do_help },
 	{ "?",		do_help },
+	{ "lcd",	do_lcd },
+	{ "logdump",	do_logdump },
+	{ "ls",		do_ls },
+	{ "open",	do_open },
 	{ "quit",	do_quit },
 	{ "q",		do_quit },
 	{ "rdump",	do_rdump },
-	{ "dump",	do_dump },
-	{ "cat",	do_cat },
-	{ "curdev",	do_curdev },
-	{ "stats",	do_stats },
+	{ "slotmap",	do_slotmap },
 	{ "stat",	do_stat },
-	{ "logdump",	do_logdump },
-	{ "group",	do_group },
-	{ "extent",	do_extent },
-	{ "slotmap",	do_slotmap }
+	{ "stats",	do_stats }
 };
 
 /*
@@ -569,25 +569,24 @@
  */
 static void do_help (char **args)
 {
-	printf ("curdev\t\t\t\t\tShow current device\n");
-	printf ("open <device>\t\t\t\tOpen a device\n");
-	printf ("close\t\t\t\t\tClose a device\n");
-	printf ("stats [-h]\t\t\t\tShow superblock\n");
-	printf ("stat <filespec>\t\t\t\tShow inode\n");
-//	printf ("pwd\t\t\t\tPrint working directory\n");
-	printf ("ls [-l] <filespec>\t\t\tList directory\n");
+	printf ("cat <filespec>\t\t\t\tPrints file on stdout\n");
 	printf ("cd <filespec>\t\t\t\tChange directory\n");
-	printf ("lcd <filespec>\t\t\t\tChange directory on a mounted fs\n");
 	printf ("chroot <filespec>\t\t\tChange root\n");
-	printf ("cat <filespec>\t\t\t\tPrints file on stdout\n");
+	printf ("close\t\t\t\t\tClose a device\n");
+	printf ("curdev\t\t\t\t\tShow current device\n");
 	printf ("dump [-p] <filespec> <outfile>\t\tDumps file to outfile on a mounted fs\n");
-	printf ("rdump [-v] <filespec> <outdir>\t\tRecursively dumps from src to a dir on a mounted fs\n");
-	printf ("logdump <node#>\t\t\t\tPrints journal file for the node\n");
-	printf ("extent <inode#>\t\t\t\tShow extent block\n");
-	printf ("group <inode#>\t\t\t\tShow chain group\n");
-	printf ("slotmap\t\t\t\t\tShow slot map\n");
+	printf ("extent <block#>\t\t\t\tShow extent block\n");
+	printf ("group <block#>\t\t\t\tShow chain group\n");
 	printf ("help, ?\t\t\t\t\tThis information\n");
+	printf ("lcd <directory>\t\t\t\tChange directory on a mounted flesystem\n");
+	printf ("logdump <node#>\t\t\t\tPrints journal file for the node\n");
+	printf ("ls [-l] <filespec>\t\t\tList directory\n");
+	printf ("open <device>\t\t\t\tOpen a device\n");
 	printf ("quit, q\t\t\t\t\tExit the program\n");
+	printf ("rdump [-v] <filespec> <outdir>\t\tRecursively dumps from src to a dir on a mounted filesystem\n");
+	printf ("slotmap\t\t\t\t\tShow slot map\n");
+	printf ("stat <filespec>\t\t\t\tShow inode\n");
+	printf ("stats [-h]\t\t\t\tShow superblock\n");
 }
 
 /*

Modified: trunk/debugfs.ocfs2/debugfs.ocfs2.8.in
===================================================================
--- trunk/debugfs.ocfs2/debugfs.ocfs2.8.in	2004-12-23 02:43:06 UTC (rev 509)
+++ trunk/debugfs.ocfs2/debugfs.ocfs2.8.in	2004-12-23 20:40:45 UTC (rev 510)
@@ -1,14 +1,21 @@
-.TH "debugfs.ocfs2" "8" "July 2004" "Version @VERSION@" "OCFS2 Manual Pages"
+.TH "debugfs.ocfs2" "8" "Dec 2004" "Version @VERSION@" "OCFS2 Manual Pages"
 .SH "NAME"
 debugfs.ocfs2 \- OCFS2 file system debugger.
 .SH "SYNOPSIS"
-\fBdebugfs.ocfs2\fR [\fB\-V\fR] [\fB\-?\fR] [\fB\-w\fR] [\fB\-N\fR] \fIdevice\fR
+\fBdebugfs.ocfs2\fR [\fB\-V\fR] [\fB\-?\fR] [\fB\-w\fR] [\fB\-f cmdfile\fR] \fIdevice\fR
 .SH "DESCRIPTION"
 .PP 
-The \fBdebugfs.ocfs2\fR is an interactive file system debugger. It can be used to examine the state of an OCFS2 filesystem.
-\fIdevice\fR is the special file corresponding the device containing the OCFS2 filesystem (e.g /dev/hdxx). \fBdebugfs.ocfs2\fR will automatically bind the \fIdevice\fR to a raw device to perform the operations and unbind it when the program is terminated. It is recommended that the system have at least one free raw device (not bound to any block device) defined or \fIdebufs.ocfs2\fR will fail.
+The \fBdebugfs.ocfs2\fR is an interactive file system debugger. It can be used to examine the state of an OCFS2 filesystem. \fIdevice\fR is the special file corresponding the device containing the OCFS2 filesystem (e.g /dev/hdxx).
 .SH "OPTIONS"
 .TP
+\fB\-f cmdfile\fR 
+Causes \fBdebugfs.ocfs2\fR to read in commands from \fIcmdfile\fR and execute them. It exits after all the commands are executed.
+
+.TP
+\fB\-w\fR 
+Specifies that the filesystem should be opened in \fIread-write\fR mode. Without this option, the filesystem is opened in the \fIread-only\fR mode.
+
+.TP
 \fB\-V\fR 
 Print version information and exit.
 
@@ -16,85 +23,92 @@
 \fB\-?\fR 
 Displays help and exit.
 
-.TP
-\fB\-w\fR 
-Turn on write support.
+.SH "SPECIFYING FILES"
+Many \fBdebugfs.ocfs2\fR commands take a \fIfilespec\fR as an argument to specify an inode (as opposed to a pathname) in the filesystem which is currently opened by \fBdebugfs.ocfs\fR. The \fIfilespec\fR argument may be specified in two forms. The first form is an inode number surrounded by angle brackets, e.g., <32>. The second form is a pathname; if the pathname is prefixed by a forward slash ('/'), then it is interpreted relative to the root of the filesystem which is currently opened by \fBdebugfs.ocfs2\fR. If not, the path is interpreted relative to the current working directory as maintained by \fBdebugfs.ocfs2\fR, which can be modified using the command \fIcd\fR. If the pathname is prefixed by a double forward slash ('//'), then it is interpreted relative to the root of the system directory of the filesystem opened by \fBdebugfs.ocfs2\fR.
 
-.TP
-\fB\-N\fR 
-Do not bind \fIdevice\fR to raw.
-
 .SH "COMMANDS"
 This is a list of the commands which debugfs.ocfs2 supports.
 
 .TP
-\fIcurdev\fR
-Show current working device (raw device).
+\fIcat filespec\fR
+Dump the contents of inode \fIfilespec\fR to stdout.
 
 .TP
-\fIopen\fR <device>
-Open a device
+\fIcd filespec\fR
+Change the current working directory to \fIfilespec\fR.
 
 .TP
+\fIchroot filespec\fR
+Change the root directory to be the directory \fIfilespec\fR.
+
+.TP
 \fIclose\fR
-Close a device
+Close the currently opened filesystem.
 
 .TP
-\fIshow_super_stats, stats\fR \fI[-h]\fR
-Show superblock
+\fIcurdev\fR
+Show the currently open device.
 
 .TP
-\fIshow_inode_info, stat\fR \fI<blknum>\fR 
-Show inode
+\fIdump [-p] filespec outfile\fR
+Dump the contents of the inode \fIfilespec\fR to the output file \fIoutfile\fR. If the \fI-p\fR is given, set the owner, group, timestamps and permissions information on \fIoutfile\fR to match those of \fIfilespec\fR.
 
 .TP
-\fIpwd\fR
-Print working directory
+\fIextent <block#>\fR
+Display the contents of the extent structure at \fI<block#>\fR.
 
 .TP
-\fIls\fR <blknum>
-List directory
+\fIgroup <block#>\fR
+Display the contents of the group structure at \fI<block#>\fR.
 
 .TP
-\fIcat\fR \fI<blknum>\fR \fI[outfile]\fR
-Prints or concatenates file to stdout/outfile
+\fIhelp, ?\fR
+Print the list of commands understood by \fBdebugfs.ocfs2\fR.
 
 .TP
-\fIdump\fR \fI<blknum>\fR \fI<outfile>\fR
-Dumps file to outfile
+\fIlcd directory\fR
+Change the current working directory of the \fBdebugfs.ocfs2\fR process to the \fIdirectory\fR on the native filesystem.
 
 .TP
-\fInodes\fR
-List of nodes
+\fIlogdump <node#>\fR
+Display the contents of the journal for node \fI<node#>\fR.
 
 .TP
-\fIpublish\fR
-Publish blocks
+\fIls [-l] filespec\fR
+Print the listing  of the files in the directory \fIfilespec\fR. The \fI-l\fR flag will list files in the long format.
 
 .TP
-\fIvote\fR
-Vote blocks
+\fIopen device\fR
+Open the filesystem on \fIdevice\fR.
 
 .TP
-\fIlogdump\fR \fI<nodenum>\fR
-Prints journal file for the node
+\fIquit, q\fR
+Quit \fBdebugfs.ocfs2\fR.
 
 .TP
-\fIhelp, ?\fR
-This information
+\fIrdump [-v] filespec outdir\fR
+Recursively dump directory \fIfilespec\fR and all its contents (including regular files, symbolic links and other directories) into the \fIoutdir\fR which should be an existing directory on the native filesystem.
 
 .TP
-\fIquit, q\fR
-Exit the program
+\fIslotmap\fR
+Display the contents of the \fIslotmap\fR system file.
 
-.SH "BUGS"
-Stuff.
+.TP
+\fIstat filespec\fR
+Display the contents of the inode structure of the inode \fIfilespec\fR.
 
+.TP
+\fIstats\fR
+Display the contents of the super block.
+
+.SH "ACKNOWLEDGEMENT"
+This tool has been modelled after \fBdebugfs\fR, a debugging tool for ext2.
+
 .SH "SEE ALSO"
 .BR ocfs(5)
 
-.SH "AUTHORS"
+.SH "AUTHOR"
 Oracle Corporation
 
 .SH "COPYRIGHT"
-Copyright \(co 2002, 2004 Oracle Corporation
+Copyright \(co 2004 Oracle

Modified: trunk/debugfs.ocfs2/main.c
===================================================================
--- trunk/debugfs.ocfs2/main.c	2004-12-23 02:43:06 UTC (rev 509)
+++ trunk/debugfs.ocfs2/main.c	2004-12-23 20:40:45 UTC (rev 510)
@@ -35,12 +35,11 @@
  */
 static void usage (char *progname)
 {
-	g_print ("Usage: %s [OPTION]... [DEVICE]\n", progname);
-	g_print ("Options:\n");
-	g_print ("  -f, --file <cmd_file>	Execute commands in cmd_file\n");
-	g_print ("  -V, --version		Display version\n");
-	g_print ("  -?, --help			Display this help\n");
-	g_print ("  -w, --write			Enable writes\n");
+	g_print ("usage: %s [-f cmdfile] [-V] [-w] [-?] [device]\n", progname);
+	g_print ("\t-f, --file <cmdfile>\tExecute commands in cmdfile\n");
+	g_print ("\t-w, --write\t\tOpen in read-write mode instead of the default of read-only\n");
+	g_print ("\t-V, --version\t\tShow version\n");
+	g_print ("\t-?, --help\t\tShow this help\n");
 	exit (0);
 }					/* usage */
 
@@ -86,7 +85,8 @@
 			opts->allow_write = 1;
 			break;
 
-		case 'h':
+		case '?':
+			print_version(gbls.progname);
 			usage(gbls.progname);
 			exit(0);
 			break;



More information about the Ocfs2-tools-commits mailing list