X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Ftraverse.c;h=f762cf4b1c455c985ee2473b9536d1bd3578f7b0;hp=6ed1d287f3d572cbb7ec7f08cc4538ba9f36bc9e;hb=70deb804d2211535f1f188a14e8fc867db9c6625;hpb=b0e0d7757fe7cdc08be0269f37a7193e07fb1bb3 diff --git a/dump/traverse.c b/dump/traverse.c index 6ed1d28..f762cf4 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.71 2010/06/10 12:17:35 stelian Exp $"; + "$Id: traverse.c,v 1.74 2011/06/10 13:41:41 stelian Exp $"; #endif /* not lint */ #include @@ -77,6 +77,7 @@ static const char rcsid[] = #include #include "dump.h" +#include "indexer.h" #define HASDUMPEDFILE 0x1 #define HASSUBDIRS 0x2 @@ -868,8 +869,9 @@ dump_xattr(dump_ino_t ino, struct dinode *dp) { void dumpino(struct dinode *dp, dump_ino_t ino, int metaonly) { - unsigned long cnt; - fsizeT size, remaining; + //unsigned long cnt; + //fsizeT size; + fsizeT remaining; char buf[TP_BSIZE]; struct new_bsd_inode nbi; int i; @@ -913,6 +915,8 @@ dumpino(struct dinode *dp, dump_ino_t ino, int metaonly) spcl.c_type = TS_INODE; spcl.c_count = 0; + indexer->addInode(dp, ino, metaonly); + if (metaonly && (dp->di_mode & S_IFMT)) { spcl.c_flags |= DR_METAONLY; spcl.c_count = 0; @@ -992,7 +996,7 @@ dumpino(struct dinode *dp, dump_ino_t ino, int metaonly) bc.buf = (int *)malloc (bc.max * sizeof (int)); bc.cnt = 0; bc.ino = ino; - bc.next_block = NDADDR; + bc.next_block = 0; ext2fs_block_iterate2(fs, (ext2_ino_t)ino, BLOCK_FLAG_DATA_ONLY, NULL, dumponeblock, (void *)&bc); /* deal with holes at the end of the inode */ @@ -1100,6 +1104,8 @@ convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), p->prev_offset = p->offset; p->offset += reclen; + //indexer->addDirEntry(dirent, offset, blocksize, buf, private); + return 0; } @@ -1203,6 +1209,8 @@ dumpdirino(struct dinode *dp, dump_ino_t ino) spcl.c_type = TS_ADDR; } + indexer->addInode(dp, ino, 0); + (void)free(cdc.buf); dump_xattr(ino, dp); } @@ -1348,6 +1356,7 @@ mkchecksum(union u_spcl *tmpspcl) void writeheader(dump_ino_t ino) { + char *state; /* need to have some place to put this! */ spcl.c_inumber = ino; spcl.c_magic = NFS_MAGIC; mkchecksum((union u_spcl *)&spcl);