]> git.wh0rd.org - dump.git/blobdiff - dump/traverse.c
Fix the 'do not save directory entries to non-dumped inodes
[dump.git] / dump / traverse.c
index 9e68fdd596fbb16df9b6952062f59ec250142cd6..fe5af09c2a839a74abcf76c5fdc3a065c91c42e4 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.62 2004/11/22 10:22:43 stelian Exp $";
+       "$Id: traverse.c,v 1.65 2005/01/25 13:33:44 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -283,6 +283,9 @@ mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskip
         */
        SETINO(ino, usedinomap);
 
+       if (NODUMP_FLAG(dp))
+               do_exclude_ino(ino, "nodump attribute");
+
        if (mode == IFDIR)
                SETINO(ino, dumpdirmap);
        if (WANTTODUMP(dp, ino)) {
@@ -296,7 +299,7 @@ mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskip
                return;
        }
        if (mode == IFDIR) {
-               if ( NODUMP_FLAG(dp) || exclude_ino(ino) )
+               if (exclude_ino(ino))
                        CLRINO(ino, usedinomap);
                *dirskipped = 1;
        }
@@ -986,8 +989,7 @@ convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset),
        int reclen;
 
        /* do not save entries to excluded inodes */
-       if (TSTINO(dirent->inode, dumpinomap) == 0 &&
-           TSTINO(dirent->inode, dumpdirmap) == 0)
+       if (exclude_ino(dirent->inode))
                return 0;
 
        p = (struct convert_dir_context *)private;
@@ -1246,6 +1248,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);