X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftraverse.c;h=f762cf4b1c455c985ee2473b9536d1bd3578f7b0;hb=refs%2Fheads%2Fmaster;hp=491d43ad28169b5b949817d656ed9398b2351348;hpb=c5e38bc12e0a29762e7a4561c815ab8a7c8ade56;p=dump.git diff --git a/dump/traverse.c b/dump/traverse.c index 491d43a..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.69 2010/04/28 09:29:50 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 @@ -240,7 +241,7 @@ blockest(struct dinode const *dp) #define MSINCE(dp, t) \ ((dp)->di_mtime >= (t)) #define CHANGEDSINCE(dp, t) \ - (CSINCE(dp, t) || MSINCE(dp, t)) + CSINCE(dp, t) /* The NODUMP_FLAG macro tests if a file has the nodump flag. */ #ifdef UF_NODUMP @@ -574,9 +575,10 @@ mapdirs(dump_ino_t maxino, long long *tapesize) * in usedinomap, but we have to go through it anyway * to propagate the nodump attribute. */ + if ((isdir & 1) == 0) + continue; nodump = (TSTINO(ino, usedinomap) == 0); - if ((isdir & 1) == 0 || - (TSTINO(ino, dumpinomap) && nodump == 0)) + if (TSTINO(ino, dumpinomap) && nodump == 0) continue; dp = getino(ino); #ifdef __linux__ @@ -867,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; @@ -912,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; @@ -991,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 */ @@ -1099,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; } @@ -1202,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); } @@ -1347,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);