[Ocfs2-tools-devel] [patch 11/11] Some minor modification in other
files.take 2
tao.ma at oracle.com
tao.ma at oracle.com
Wed Aug 22 17:08:39 PDT 2007
===================================================================
--- quilt.ocfs2-tools.orig/fswreck/extent.c 2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/fswreck/extent.c 2007-08-22 05:51:42.000000000 -0400
@@ -84,7 +84,7 @@ static void custom_extend_allocation(ocf
{
errcode_t ret;
uint32_t n_clusters;
- uint32_t i;
+ uint32_t i, offset = 0;
uint64_t blkno;
uint64_t tmpblk;
@@ -103,7 +103,8 @@ static void custom_extend_allocation(ocf
* we insert each cluster in reverse. */
for(i = n_clusters; i; --i) {
tmpblk = blkno + ocfs2_clusters_to_blocks(fs, i - 1);
- ret = ocfs2_insert_extent(fs, ino, tmpblk, 1);
+ ret = ocfs2_insert_extent(fs, ino, offset++,
+ tmpblk, 1);
if (ret)
FSWRK_COM_FATAL(progname, ret);
}
@@ -311,14 +312,14 @@ static void mess_up_record(ocfs2_filesys
blkno, oldno, er->e_blkno);
break;
case EXTENT_CLUSTERS_OVERRUN:
- oldno = er->e_clusters;
- er->e_clusters = fs->fs_clusters + 1;
+ oldno = er->e_leaf_clusters;
+ er->e_leaf_clusters = fs->fs_clusters + 1;
er->e_blkno = ocfs2_clusters_to_blocks(fs,
fs->fs_clusters - 1);
fprintf(stdout, "EXTENT_CLUSTERS_OVERRUN: "
"Corrupt inode#%"PRIu64", "
"change cluster from %"PRIu64 " to %d\n",
- blkno, oldno, er->e_clusters);
+ blkno, oldno, er->e_leaf_clusters);
break;
case EXTENT_BLKNO_RANGE:
er->e_blkno = 1;
===================================================================
--- quilt.ocfs2-tools.orig/fswreck/symlink.c 2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/fswreck/symlink.c 2007-08-22 05:51:42.000000000 -0400
@@ -76,17 +76,13 @@ static void add_symlink(ocfs2_filesys *f
errcode_t ret = 0;
ocfs2_cached_inode *cinode = NULL;
uint64_t new_blk;
- int contig;
+ uint64_t contig;
char *buf = NULL;
ret = ocfs2_read_cached_inode(fs, blkno, &cinode);
if (ret)
FSWRK_COM_FATAL(progname, ret);
- ret = ocfs2_extent_map_init(fs, cinode);
- if (ret)
- FSWRK_COM_FATAL(progname, ret);
-
/* get first block of the file */
ret = ocfs2_extent_map_get_blocks(cinode, 0, 1,
&new_blk, &contig);
@@ -214,9 +210,9 @@ static void corrupt_symlink_file(ocfs2_f
er = el->l_recs;
fprintf(stdout, "LINK_BLOCKS: "
"Corrupt inode#%"PRIu64","
- "change e_clusters from %u to %u\n",
- blkno, er->e_clusters, (er->e_clusters + 1));
- er->e_clusters += 1;
+ "change e_leaf_clusters from %u to %u\n",
+ blkno, er->e_leaf_clusters, (er->e_leaf_clusters + 1));
+ er->e_leaf_clusters += 1;
break;
default:
FSWRK_FATAL("Invalid type[%d]\n", type);
===================================================================
--- quilt.ocfs2-tools.orig/sizetest/sizes.txt 2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/sizetest/sizes.txt 2007-08-22 05:51:42.000000000 -0400
@@ -1,6 +1,6 @@
[off] ocfs2_extent_rec [size]
0x000 e_cpos +0x04
-0x004 e_clusters +0x04
+0x004 e_int_clusters +0x04
0x008 e_blkno +0x08
Total 0x010
===================================================================
--- quilt.ocfs2-tools.orig/sizetest/sizetest.c 2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/sizetest/sizetest.c 2007-08-22 05:51:42.000000000 -0400
@@ -49,7 +49,7 @@ static void print_ocfs2_extent_rec(void)
START_TYPE(ocfs2_extent_rec);
SHOW_OFFSET(struct ocfs2_extent_rec, e_cpos);
- SHOW_OFFSET(struct ocfs2_extent_rec, e_clusters);
+ SHOW_OFFSET(struct ocfs2_extent_rec, e_int_clusters);
SHOW_OFFSET(struct ocfs2_extent_rec, e_blkno);
END_TYPE(struct ocfs2_extent_rec);
--
More information about the Ocfs2-tools-devel
mailing list