From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2/edit hexedit.c
Date: 21 Jun 2007 22:15:34 -0000 [thread overview]
Message-ID: <20070621221534.3474.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-06-21 22:15:34
Modified files:
gfs2/edit : hexedit.c
Log message:
Make gfs2_edit handle small different block sizes.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&r1=1.13&r2=1.14
--- cluster/gfs2/edit/hexedit.c 2007/04/24 03:19:11 1.13
+++ cluster/gfs2/edit/hexedit.c 2007/06/21 22:15:34 1.14
@@ -1130,7 +1130,7 @@
sbd1 = (struct gfs_sb *)&sbd.sd_sb;
ioctl(fd, BLKFLSBUF, 0);
- do_lseek(fd, 0x10 * bufsize);
+ do_lseek(fd, 0x10 * 4096);
do_read(fd, buf, bufsize); /* read in the desired block */
memset(&sbd, 0, sizeof(struct gfs2_sbd));
sbd.device_fd = fd;
@@ -1160,6 +1160,8 @@
}
else
gfs1 = FALSE;
+ bufsize = sbd.sd_sb.sb_bsize;
+ block = 0x10 * (4096 / bufsize);
}
/* ------------------------------------------------------------------------ */
@@ -1203,7 +1205,7 @@
return 0;
indirect_blocks = 0;
lines_per_row[dmode] = 1;
- if (gfs2_struct_type == GFS2_METATYPE_SB || blk == 0x10) {
+ if (gfs2_struct_type == GFS2_METATYPE_SB || blk == 0x10 * (4096 / bufsize)) {
gfs2_sb_in(&sbd.sd_sb, buf); /* parse it out into the sb structure */
memset(&indirect, 0, sizeof(indirect));
indirect[0].block = sbd.sd_sb.sb_master_dir.no_addr;
@@ -1608,7 +1610,7 @@
edit_row[dmode] = 0;
}
else {
- block = 0x10;
+ block = 0x10 * (4096 / bufsize);
push_block(block);
offset = 0;
}
@@ -1882,7 +1884,7 @@
max_block, max_block);
else if (!strcmp(argv[i], "sb") ||
!strcmp(argv[i], "superblock"))
- push_block(0x10); /* superblock */
+ push_block(0x10 * (4096 / bufsize)); /* superblock */
else if (!strcmp(argv[i], "root") ||
!strcmp(argv[i], "rootdir"))
push_block(sbd.sd_sb.sb_root_dir.no_addr);
next reply other threads:[~2007-06-21 22:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 22:15 rpeterso [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-08 18:10 [Cluster-devel] cluster/gfs2/edit hexedit.c rpeterso
2007-11-07 15:07 rpeterso
2007-06-25 19:57 rpeterso
2007-04-24 3:19 rpeterso
2007-03-28 22:10 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=20070621221534.3474.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).