From: Stelian Pop Date: Tue, 25 Jan 2005 13:33:41 +0000 (+0000) Subject: Fix the 'do not save directory entries to non-dumped inodes X-Git-Tag: release_0_4b40~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=979da669432983d6fedecbd004d6dd20f46486dc;p=dump.git Fix the 'do not save directory entries to non-dumped inodes (excluded from dump)' feature in order to also work for regular files. --- diff --git a/CHANGES b/CHANGES index a5cd0ea..40e3dc1 100644 --- 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 ????????????????) ====================================================================== @@ -9,6 +9,12 @@ Changes between versions 0.4b39 and 0.4b40 (released ????????????????) to access it for example). Thanks to Kenneth Porter 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 for the bug + report. + Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005) ====================================================================== diff --git a/dump/traverse.c b/dump/traverse.c index 147df5b..fe5af09 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -37,7 +37,7 @@ #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 @@ -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,9 +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 && - TSTINO(dirent->inode, usedinomap) == 0) + if (exclude_ino(dirent->inode)) return 0; p = (struct convert_dir_context *)private;