From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2/edit gfs2hex.c hexedit.c hexedit.h
Date: 14 Nov 2006 20:13:37 -0000 [thread overview]
Message-ID: <20061114201337.32146.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2006-11-14 20:13:36
Modified files:
gfs2/edit : gfs2hex.c hexedit.c hexedit.h
Log message:
Ability for gfs2_edit to handle gfs1 indirect metapointers.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/gfs2hex.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.1&r2=1.4.2.2
--- cluster/gfs2/edit/gfs2hex.c 2006/11/09 15:31:01 1.5.2.1
+++ cluster/gfs2/edit/gfs2hex.c 2006/11/14 20:13:36 1.5.2.2
@@ -291,23 +291,20 @@
unsigned int x, y;
uint64_t p;
- eol(0);
- printf("Pointers");
- eol(0);
- eol(0);
-
- for (x = sizeof(struct gfs2_meta_header), y = 0; x < bufsize; x += 8, y++)
- {
+ indirect_blocks = 0;
+ memset(&indirect, 0, sizeof(indirect));
+ for (x = sizeof(struct gfs_indirect), y = 0;
+ x < bufsize;
+ x += sizeof(uint64_t), y++) {
p = be64_to_cpu(*(uint64_t *)(buf + x));
-
if (p) {
- printf(" %u -> %" PRIu64, y, p);
- eol(0);
+ indirect[indirect_blocks].block = p;
+ indirect[indirect_blocks].is_dir = FALSE;
+ indirect_blocks++;
}
}
}
-
/******************************************************************************
*******************************************************************************
**
--- cluster/gfs2/edit/hexedit.c 2006/11/09 15:31:01 1.6.2.1
+++ cluster/gfs2/edit/hexedit.c 2006/11/14 20:13:36 1.6.2.2
@@ -44,6 +44,7 @@
int display(enum dsp_mode display_mode, int identify_only);
extern void eol(int col);
+extern void do_indirect_extended(char *buf);
/* ------------------------------------------------------------------------ */
/* UpdateSize - screen size changed, so update it */
@@ -684,10 +685,11 @@
move(line, 1);
}
if (indir_blocks == indirect_blocks) {
- print_gfs2("%d => ", e + 1);
+ print_gfs2("%d => ", e);
if (termlines)
move(line,9);
- print_gfs2("0x%llx", indirect[e].block);
+ print_gfs2("0x%llx / %lld", indirect[e].block,
+ indirect[e].block);
if (termlines) {
if (edit_row[display_mode] >= 0 &&
line - start_line - 2 == edit_row[display_mode]) {
@@ -893,6 +895,9 @@
gfs2_dinode_in(&di, buf); /* parse disk inode into structure */
do_dinode_extended(&di, buf); /* get extended data, if any */
}
+ else if (gfs2_struct_type == GFS2_METATYPE_IN) { /* indirect block list */
+ do_indirect_extended(buf);
+ }
else if (gfs2_struct_type == GFS2_METATYPE_LF) { /* directory leaf */
int x;
struct gfs2_dirent de;
--- cluster/gfs2/edit/hexedit.h 2006/11/09 15:31:01 1.4.2.1
+++ cluster/gfs2/edit/hexedit.h 2006/11/14 20:13:36 1.4.2.2
@@ -106,6 +106,12 @@
struct gfs2_dirents dirent[64];
};
+struct gfs_indirect {
+ struct gfs2_meta_header in_header;
+
+ char in_reserved[64];
+};
+
struct blkstack_info {
uint64_t block;
int edit_row[DISPLAY_MODES];
next reply other threads:[~2006-11-14 20:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-14 20:13 rpeterso [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-13 17:22 [Cluster-devel] cluster/gfs2/edit gfs2hex.c hexedit.c hexedit.h rpeterso
2007-02-28 21:58 rpeterso
2007-02-13 1:07 rpeterso
2007-02-08 5:41 rpeterso
2006-11-14 20:11 rpeterso
2006-11-09 15:31 rpeterso
2006-11-09 15:29 rpeterso
2006-06-19 20:49 rpeterso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061114201337.32146.qmail@sourceware.org \
--to=rpeterso@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).