Add an option to debugfs to open filesystems in exclusive mode

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o 2006-03-18 19:58:13 -05:00
parent 39c47ce641
commit 98eb44bdb5
3 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2006-03-18 Theodore Ts'o <tytso@mit.edu>
* debugfs.c (do_open_filesys), debugfs.8.in: Add the -e option to
the open_filesystem command, which requests that the
filesystem be opened in exclusive mode.
2006-03-08 Theodore Ts'o <tytso@mit.edu>
* Fix bug in icheck which incorrectly reports the last valid inode

View File

@ -335,18 +335,17 @@ device numbers must be specified.
Take the requested list of inode numbers, and print a listing of pathnames
to those inodes.
.TP
.I open [-w] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
.I open [-w] [-e] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
Open a filesystem for editing. The
.I -w
flag causes the filesystem to be opened for writing. The
.I -f
flag forces the filesystem to be opened even if there are some unknown
or incompatible filesystem features which would normally
prevent the filesystem from being opened. The
.IR -c ", " -b ", " -i ", " and " -s
options behave the same as those to
.B debugfs
itself.
.I -e
flag causes the filesystem to be opened in exclusive mode. The
.IR -b ", " -c ", " -i ", " -s ", and " -w
options behave the same as the command-line options to
.BR debugfs .
.TP
.I pwd
Print the current working directory.

View File

@ -128,7 +128,7 @@ void do_open_filesys(int argc, char **argv)
char *data_filename = 0;
reset_getopt();
while ((c = getopt (argc, argv, "iwfcb:s:d:")) != EOF) {
while ((c = getopt (argc, argv, "iwfecb:s:d:")) != EOF) {
switch (c) {
case 'i':
open_flags |= EXT2_FLAG_IMAGE_FILE;
@ -139,6 +139,9 @@ void do_open_filesys(int argc, char **argv)
case 'f':
open_flags |= EXT2_FLAG_FORCE;
break;
case 'e':
open_flags |= EXT2_FLAG_EXCLUSIVE;
break;
case 'c':
catastrophic = 1;
break;