X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Ftraverse.c;h=147df5b60e11486f3ce80a0f72fbe2aea274ec96;hp=b0a1f145ddbb8f8e9323767fb0ec8101cfbd5b49;hb=dba36a3e9b1fb9e7c207ab8b5f7cb7f502867780;hpb=e5916e4b30bb009709fe2a3a6f63ac16e986de6f diff --git a/dump/traverse.c b/dump/traverse.c index b0a1f14..147df5b 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.60 2004/03/10 16:26:30 stelian Exp $"; + "$Id: traverse.c,v 1.64 2004/12/15 09:31:49 stelian Exp $"; #endif /* not lint */ #include @@ -771,7 +771,7 @@ dumponeblock(UNUSED(ext2_filsys fs), blk_t *blocknr, e2_blkcnt_t blockcnt, UNUSED(blk_t ref_block), UNUSED(int ref_offset), void * private) { struct block_context *p; - int i; + e2_blkcnt_t i; if (blockcnt < NDADDR) return 0; @@ -985,6 +985,12 @@ convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), struct direct *dp; int reclen; + /* do not save entries to excluded inodes */ + if (TSTINO(dirent->inode, dumpinomap) == 0 && + TSTINO(dirent->inode, dumpdirmap) == 0 && + TSTINO(dirent->inode, usedinomap) == 0) + return 0; + p = (struct convert_dir_context *)private; reclen = EXT2_DIR_REC_LEN((dirent->name_len & 0xFF) + 1); @@ -1198,9 +1204,9 @@ dmpindir(dump_ino_t ino, daddr_t blk, int ind_level, fsizeT *size) * Collect up the data into tape record sized buffers and output them. */ void -blksout(daddr_t *blkp, int frags, dump_ino_t ino) +blksout(blk_t *blkp, int frags, dump_ino_t ino) { - daddr_t *bp; + blk_t *bp; int i, j, count, blks, tbperdb; blks = howmany(frags * sblock->fs_fsize, TP_BSIZE); @@ -1241,6 +1247,7 @@ dumpmap(char *map, int type, dump_ino_t ino) spcl.c_type = type; spcl.c_count = howmany(mapsize * sizeof(char), TP_BSIZE); + spcl.c_dinode.di_size = mapsize; writeheader(ino); for (i = 0, cp = map; i < spcl.c_count; i++, cp += TP_BSIZE) writerec(cp, 0); @@ -1325,14 +1332,14 @@ getino(dump_ino_t inum) int breaderrors = 0; void -bread(daddr_t blkno, char *buf, int size) +bread(ext2_loff_t blkno, char *buf, int size) { int cnt, i; loop: #ifdef __linux__ - if (ext2fs_llseek(diskfd, (((ext2_loff_t)blkno) << dev_bshift), 0) != - (((ext2_loff_t)blkno) << dev_bshift)) + if (ext2fs_llseek(diskfd, (blkno << dev_bshift), 0) != + (blkno << dev_bshift)) #else if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) != ((off_t)blkno << dev_bshift)) @@ -1378,8 +1385,8 @@ loop: memset(buf, 0, size); for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) { #ifdef __linux__ - if (ext2fs_llseek(diskfd, (((ext2_loff_t)blkno) << dev_bshift), 0) != - (((ext2_loff_t)blkno) << dev_bshift)) + if (ext2fs_llseek(diskfd, (blkno << dev_bshift), 0) != + (blkno << dev_bshift)) #else if (lseek(diskfd, ((off_t)blkno << dev_bshift), 0) != ((off_t)blkno << dev_bshift))