]> git.wh0rd.org - dump.git/commitdiff
Fix the 'do not save directory entries to non-dumped inodes
authorStelian Pop <stelian@popies.net>
Tue, 25 Jan 2005 13:33:41 +0000 (13:33 +0000)
committerStelian Pop <stelian@popies.net>
Tue, 25 Jan 2005 13:33:41 +0000 (13:33 +0000)
(excluded from dump)' feature in order to also work for
regular files.

CHANGES
dump/traverse.c

diff --git a/CHANGES b/CHANGES
index a5cd0eaa7c84be0f047ea38fbf15997cc9ab6146..40e3dc1a7be77b29bd3541476b71d332447bcfd5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.270 2005/01/24 10:32:01 stelian Exp $
+$Id: CHANGES,v 1.271 2005/01/25 13:33:41 stelian Exp $
 
 Changes between versions 0.4b39 and 0.4b40 (released ????????????????)
 ======================================================================
 
 Changes between versions 0.4b39 and 0.4b40 (released ????????????????)
 ======================================================================
@@ -9,6 +9,12 @@ Changes between versions 0.4b39 and 0.4b40 (released ????????????????)
        to access it for example). Thanks to Kenneth Porter
        <shiva@sewingwitch.com> for the bug report.
 
        to access it for example). Thanks to Kenneth Porter
        <shiva@sewingwitch.com> for the bug report.
 
+2.     Re-done the 'do not save directory entries to non-dumped inodes
+       (excluded from dump)' feature. The previous implementation
+       worked well for excluded directories but not for regular files.
+       Thanks to Kenneth Porter <shiva@sewingwitch.com> for the bug
+       report.
+
 Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005)
 ======================================================================
 
 Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005)
 ======================================================================
 
index 147df5b60e11486f3ce80a0f72fbe2aea274ec96..fe5af09c2a839a74abcf76c5fdc3a065c91c42e4 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.64 2004/12/15 09:31:49 stelian Exp $";
+       "$Id: traverse.c,v 1.65 2005/01/25 13:33:44 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #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);
 
         */
        SETINO(ino, usedinomap);
 
+       if (NODUMP_FLAG(dp))
+               do_exclude_ino(ino, "nodump attribute");
+
        if (mode == IFDIR)
                SETINO(ino, dumpdirmap);
        if (WANTTODUMP(dp, ino)) {
        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) {
                return;
        }
        if (mode == IFDIR) {
-               if ( NODUMP_FLAG(dp) || exclude_ino(ino) )
+               if (exclude_ino(ino))
                        CLRINO(ino, usedinomap);
                *dirskipped = 1;
        }
                        CLRINO(ino, usedinomap);
                *dirskipped = 1;
        }
@@ -986,9 +989,7 @@ convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset),
        int reclen;
 
        /* do not save entries to excluded inodes */
        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)
+       if (exclude_ino(dirent->inode))
                return 0;
 
        p = (struct convert_dir_context *)private;
                return 0;
 
        p = (struct convert_dir_context *)private;