[Ocfs2-tools-commits] smushran commits r1191 - trunk/debugfs.ocfs2
svn-commits@oss.oracle.com
svn-commits at oss.oracle.com
Mon May 1 20:36:01 CDT 2006
Author: smushran
Signed-off-by: mfasheh
Date: 2006-05-01 20:36:01 -0500 (Mon, 01 May 2006)
New Revision: 1191
Modified:
trunk/debugfs.ocfs2/commands.c
Log:
decode command shows the blocknum for a given lockname
Signed-off-by: mfasheh
Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c 2006-05-02 01:34:46 UTC (rev 1190)
+++ trunk/debugfs.ocfs2/commands.c 2006-05-02 01:36:01 UTC (rev 1191)
@@ -62,6 +62,7 @@
static void do_chroot (char **args);
static void do_slotmap (char **args);
static void do_encode_lockres (char **args);
+static void do_decode_lockres (char **args);
static void do_locate (char **args);
static void do_fs_locks (char **args);
@@ -93,7 +94,8 @@
{ "slotmap", do_slotmap },
{ "stat", do_stat },
{ "stats", do_stats },
- { "encode", do_encode_lockres }
+ { "encode", do_encode_lockres },
+ { "decode", do_decode_lockres }
};
/*
@@ -604,6 +606,7 @@
printf ("chroot <filespec>\t\t\tChange root\n");
printf ("close\t\t\t\t\tClose a device\n");
printf ("curdev\t\t\t\t\tShow current device\n");
+ printf ("decode <lockname#> ...\t\t\tDecode block#(s) from the lockname(s)\n");
printf ("dump [-p] <filespec> <outfile>\t\tDumps file to outfile on a mounted fs\n");
printf ("encode <filespec>\t\t\tShow lock name\n");
printf ("extent <block#>\t\t\t\tShow extent block\n");
@@ -1152,6 +1155,24 @@
}
/*
+ * do_decode_lockres()
+ *
+ */
+static void do_decode_lockres(char **args)
+{
+ uint64_t blkno[MAX_BLOCKS];
+ int count;
+ int i;
+
+ count = process_inodestr_args(args, MAX_BLOCKS, blkno);
+ if (count < 1)
+ return ;
+
+ for (i = 0; i < count; ++i)
+ printf("\t%s\t%"PRIu64"\n", args[i + 1], blkno[i]);
+}
+
+/*
* do_locate()
*
*/
More information about the Ocfs2-tools-commits
mailing list