#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.67 2009/06/18 10:00:38 stelian Exp $";
+ "$Id: traverse.c,v 1.71 2010/06/10 12:17:35 stelian Exp $";
#endif /* not lint */
#include <config.h>
static void dmpindir __P((dump_ino_t ino, daddr_t blk, int level, fsizeT *size));
static int searchdir __P((dump_ino_t ino, daddr_t blkno, long size, long filesize));
#endif
-static void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped));
+static void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long long *tapesize, int *dirskipped));
static void dump_xattr __P((dump_ino_t ino, struct dinode *dp));
#ifdef HAVE_EXT2_JOURNAL_INUM
#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
* copy of the given inode, or be NULL (in which case it is fetched.)
*/
static void
-mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped)
+mapfileino(dump_ino_t ino, struct dinode const *dp, long long *tapesize, int *dirskipped)
{
int mode;
*/
#ifdef __linux__
int
-mapfiles(UNUSED(dump_ino_t maxino), long *tapesize)
+mapfiles(UNUSED(dump_ino_t maxino), long long *tapesize)
{
ext2_ino_t ino;
int anydirskipped = 0;
}
#else
int
-mapfiles(dump_ino_t maxino, long *tapesize)
+mapfiles(dump_ino_t maxino, long long *tapesize)
{
dump_ino_t ino;
int anydirskipped = 0;
#ifdef __linux__
int
-maponefile(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
+maponefile(UNUSED(dump_ino_t maxino), long long *tapesize, char *directory)
{
errcode_t retval;
ext2_ino_t dir_ino;
#ifdef __linux__
struct mapfile_context {
- long *tapesize;
+ long long *tapesize;
int *anydirskipped;
};
* the directories in the filesystem.
*/
int
-mapfilesfromdir(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
+mapfilesfromdir(UNUSED(dump_ino_t maxino), long long *tapesize, char *directory)
{
errcode_t retval;
struct mapfile_context mfc;
struct mapdirs_context {
int *ret;
int nodump;
- long *tapesize;
+ long long *tapesize;
};
#endif
* pass using this algorithm.
*/
int
-mapdirs(dump_ino_t maxino, long *tapesize)
+mapdirs(dump_ino_t maxino, long long *tapesize)
{
struct dinode *dp;
int isdir;
* 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__
{
struct mapdirs_context *mdc;
int *ret;
- long *tapesize;
+ long long *tapesize;
struct dinode *ip;
mdc = (struct mapdirs_context *)private;
spcl.c_flags |= DR_EXTATTRIBUTES;
spcl.c_extattributes = EXT_XATTR;
spcl.c_count = howmany(EXT2_INODE_SIZE(fs->super), TP_BSIZE);
+ for (i = 0; i < spcl.c_count; i++)
+ spcl.c_addr[i] = 1;
writeheader(ino);
for (i = 0, cp = xattr; i < spcl.c_count; i++, cp += TP_BSIZE)
writerec(cp, 0);
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 */