From 6e96adcb1c114599a02e2a701131ddbf5d334238 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 24 Nov 2001 16:10:52 -0500 Subject: [PATCH] debugfs.8.in: Update manual page to document the set_super_value and logdump commands, and move the "specifying files" section closer to the beginning of the man page so people won't miss it. setsuper.c (print_possible_fields): "set_super_value -l" now prints out the list of valid superblock fields which the ssv command can set. --- debugfs/ChangeLog | 11 ++++++ debugfs/debugfs.8.in | 101 +++++++++++++++++++++++++++++---------------------- debugfs/setsuper.c | 29 ++++++++++++++- 3 files changed, 97 insertions(+), 44 deletions(-) diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index ef6f1a1..ee60862 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,14 @@ +2001-11-24 Theodore Tso + + * debugfs.8.in: Update manual page to document the set_super_value + and logdump commands, and move the "specifying files" + section closer to the beginning of the man page so people + won't miss it. + + * setsuper.c (print_possible_fields): "set_super_value -l" now + prints out the list of valid superblock fields which the + ssv command can set. + 2001-09-20 Theodore Tso * Release of E2fsprogs 1.25 diff --git a/debugfs/debugfs.8.in b/debugfs/debugfs.8.in index ccc1aeb..77a893a 100644 --- a/debugfs/debugfs.8.in +++ b/debugfs/debugfs.8.in @@ -43,9 +43,8 @@ device .SH DESCRIPTION The .B debugfs -program -is a file system debugger. It can be used to examine and change the -state of an ext2 file system. +program is an interactive file system debugger. It can be used to +examine and change the state of an ext2 file system. .br .I device is the special file corresponding to the device containing the ext2 @@ -113,9 +112,37 @@ and then exit. print the version number of .B debugfs and exit. +.SH SPECIFYING FILES +Many +.B debugfs +commands take a +.I filespec +as an argument to specify an inode (as opposed to a pathname) +in the filesystem which is currently opened by +.BR debugfs . +The +.I filespec +argument may be specified in two forms. The first form is an inode +number surrounded by angle brackets, e.g., +.IR <2> . +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 +.BR debugfs . +If not, the pathname is +interpreted relative to the current working directory as maintained by +.BR debugfs . +This may be modified by using the +.B debugfs +command +.IR cd . +.\" +.\" +.\" .SH COMMANDS +This is a list of the commands which .B debugfs -is an interactive debugger. It understands a number of commands. +supports. .TP .I cat filespec Dump the contents of the inode @@ -209,6 +236,13 @@ entries (if any) to this inode. See the .BR rm (1) command if you wish to unlink a file. .TP +.I lcd directory +Change the current working directory of the +.B debugfs +process to +.I directory +on the native filesystem. +.TP .I ln filespec dest_file Create a link named .I dest_file @@ -216,6 +250,9 @@ which is a link to .IR filespec . Note this does not adjust the inode reference counts. .TP +.I logdump [-ac] [-b] [-i] [-f] [output_file] +Dump the contents of the ext3 journal. +.TP .I ls [-l] filespec Print a listing of the files in the directory .IR filespec . @@ -259,6 +296,14 @@ Print the current working directory. Quit .B debugfs .TP +.I rdump directory destination +Recursively dump +.I directory +and all its contents (including regular files, symbolic links, and other +directories) into the named +.I destination +which should be an existing directory on the native filesystem. +.TP .I rm pathname Unlink .IR pathname . @@ -283,6 +328,15 @@ Mark inode .I filespec as in use in the inode bitmap. .TP +.I set_super_value field value +Set the superblock field +.I field +to +.I value. +The list of valid superblock fields which can be set via this command +can be displayed by using the command: +.B set_super_value -l +.TP .I show_super_stats [-h] List the contents of the super block and the block group descriptors. If the .I -h @@ -313,45 +367,6 @@ Create a file in the filesystem named and copy the contents of .I source_file into the destination file. -.TP -.I lcd directory -Change the current working directory of the -.B debugfs -process to -.I directory -on the native filesystem. -.TP -.I rdump directory destination -Recursively dump -.I directory -and all its contents (including regular files, symbolic links, and other -directories) into the named -.I destination -which should be an existing directory on the native filesystem. -.SH SPECIFYING FILES -Many -.B debugfs -commands take a -.I filespec -as an argument to specify an inode (as opposed to a pathname) -in the filesystem which is currently opened by -.BR debugfs . -The -.I filespec -argument may be specified in two forms. The first form is an inode -number surrounded by angle brackets, e.g., -.IR <2> . -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 -.BR debugfs . -If not, the pathname is -interpreted relative to the current working directory as maintained by -.BR debugfs . -This may be modified by using the -.B debugfs -command -.IR cd . .SH AUTHOR .B debugfs was written by Theodore Ts'o . diff --git a/debugfs/setsuper.c b/debugfs/setsuper.c index c9cdb88..b9b2136 100644 --- a/debugfs/setsuper.c +++ b/debugfs/setsuper.c @@ -169,15 +169,42 @@ static errcode_t parse_string(struct super_set_info *info, char *arg) return 0; } +static void print_possible_fields() +{ + struct super_set_info *ss; + char *type; + + printf("Superblock fields supported by the set_super_value command:\n"); + for (ss = super_fields ; ss->name ; ss++) { + type = "unknown"; + if (ss->func == parse_string) + type = "string"; + else if (ss->func == parse_int) + type = "integer"; + else if (ss->func == parse_uint) + type = "unsigned integer"; + printf("\t%-20s\t%s\n", ss->name, type); + } +} + + void do_set_super(int argc, char *argv[]) { + const char *usage = "Usage: set_super \n" + "\t\"set_super -l\" will list the names of superblock fields " + "which\n\tcan be set."; static struct super_set_info *ss; + if ((argc == 2) && !strcmp(argv[1], "-l")) { + print_possible_fields(); + return; + } + if (check_fs_open(argv[0])) return; if (argc != 3) { - com_err(argv[0], 0, "Usage: set_super "); + com_err(argv[0], 0, usage); return; } -- 1.8.3.1