[Ocfs-tools-commits]
smushran commits r160 - in trunk/ocfs2/debugfs.ocfs2: . include
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jul 16 19:41:38 CDT 2004
Author: smushran
Date: 2004-07-16 18:41:35 -0500 (Fri, 16 Jul 2004)
New Revision: 160
Modified:
trunk/ocfs2/debugfs.ocfs2/commands.c
trunk/ocfs2/debugfs.ocfs2/include/main.h
trunk/ocfs2/debugfs.ocfs2/main.c
trunk/ocfs2/debugfs.ocfs2/readfs.c
Log:
dump file works with raw device
Modified: trunk/ocfs2/debugfs.ocfs2/commands.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/commands.c 2004-07-16 22:49:39 UTC (rev 159)
+++ trunk/ocfs2/debugfs.ocfs2/commands.c 2004-07-16 23:41:35 UTC (rev 160)
@@ -413,6 +413,8 @@
*/
static void do_quit (char **args)
{
+ if (gbls.device)
+ do_close (NULL);
exit (0);
} /* do_quit */
Modified: trunk/ocfs2/debugfs.ocfs2/include/main.h
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/include/main.h 2004-07-16 22:49:39 UTC (rev 159)
+++ trunk/ocfs2/debugfs.ocfs2/include/main.h 2004-07-16 23:41:35 UTC (rev 160)
@@ -86,6 +86,7 @@
#define DBGFS_FATAL(fmt, arg...) ({ fprintf(stderr, "ERROR at %s, %d: " fmt ". EXITING!!!\n", \
__FILE__, __LINE__, ##arg); \
+ raise (SIGTERM); \
exit(1); \
})
Modified: trunk/ocfs2/debugfs.ocfs2/main.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/main.c 2004-07-16 22:49:39 UTC (rev 159)
+++ trunk/ocfs2/debugfs.ocfs2/main.c 2004-07-16 23:41:35 UTC (rev 160)
@@ -143,6 +143,7 @@
free (line);
} else {
printf ("\n");
+ raise (SIGTERM);
exit (0);
}
}
Modified: trunk/ocfs2/debugfs.ocfs2/readfs.c
===================================================================
--- trunk/ocfs2/debugfs.ocfs2/readfs.c 2004-07-16 22:49:39 UTC (rev 159)
+++ trunk/ocfs2/debugfs.ocfs2/readfs.c 2004-07-16 23:41:35 UTC (rev 160)
@@ -299,6 +299,7 @@
__u64 newlen = 0;
char *inode_buf = NULL;
__u64 buflen = 0;
+ __u64 rndup = 0;
int ret = -1;
arr = g_array_new(0, 1, sizeof(ocfs2_extent_rec));
@@ -340,10 +341,16 @@
while (len) {
buflen = min (newlen, len);
+ /* rndup is reqd because source is read o_direct */
+ rndup = buflen % 512;
+ rndup = (rndup ? 512 - rndup : 0);
+ buflen += rndup;
if ((pread64(fd, p, buflen, off)) == -1)
DBGFS_FATAL("%s", strerror(errno));
+ buflen -= rndup;
+
if (fdo != -1) {
if (!(write (fdo, p, buflen)))
DBGFS_FATAL("%s", strerror(errno));
More information about the Ocfs-tools-commits
mailing list