#ifndef lint
static const char rcsid[] =
- "$Id: traverse.c,v 1.9 1999/11/21 00:17:16 tiniou Exp $";
+ "$Id: traverse.c,v 1.12 2000/01/09 23:47:33 tiniou Exp $";
#endif /* not lint */
#include <sys/param.h>
#endif
static void mapfileino __P((ino_t ino, long *tapesize, int *dirskipped));
+/* #define EXT3_FEATURE_INCOMPAT_RECOVER */
+
+int dump_fs_open(const char *disk, ext2_filsys *fs)
+{
+ int retval;
+ struct ext2fs_sb *s;
+
+#ifdef EXT3_FEATURE_INCOMPAT_RECOVER
+ retval = ext2fs_open(disk, EXT2_FLAG_FORCE, 0, 0, unix_io_manager, fs);
+#else
+ retval = ext2fs_open(disk, 0, 0, 0, unix_io_manager, fs);
+#endif
+ if (!retval) {
+ s = (struct ext2fs_sb *) (*fs)->super;
+ if ((s->s_feature_compat & ~EXT2_LIB_FEATURE_COMPAT_SUPP) ||
+#ifdef EXT3_FEATURE_INCOMPAT_RECOVER
+ (s->s_feature_incompat & ~(EXT3_FEATURE_INCOMPAT_RECOVER | EXT2_LIB_FEATURE_INCOMPAT_SUPP))) {
+#else
+ (s->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP)) {
+#endif
+ retval = EXT2_ET_UNSUPP_FEATURE;
+ }
+ else if (s->s_feature_ro_compat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP) {
+ retval = EXT2_ET_RO_UNSUPP_FEATURE;
+ }
+ }
+ return retval;
+}
+
/*
* This is an estimation of the number of TP_BSIZE blocks in the file.
* It estimates the number of blocks in files with holes by assuming
dp = getino(dirent->inode);
mode = dp->di_mode & IFMT;
if (mode == IFDIR && dp->di_nlink != 0 && dp->di_dtime == 0) {
- if ((dirent->name[0] != '.' || dirent->name_len != 1) &&
+ if ((dirent->name[0] != '.' || ( dirent->name_len & 0xFF ) != 1) &&
(dirent->name[0] != '.' || dirent->name[1] != '.' ||
- dirent->name_len != 2)) {
+ ( dirent->name_len & 0xFF ) != 2)) {
retval = ext2fs_dir_iterate(fs, ino, 0, NULL,
mapfilesindir, private);
if (retval)
if (dp->inode == 0)
return 0;
if (dp->name[0] == '.') {
- if (dp->name_len == 1)
+ if (( dp->name_len & 0xFF ) == 1)
return 0;
- if (dp->name[1] == '.' && dp->name_len == 2)
+ if (dp->name[1] == '.' && ( dp->name_len & 0xFF ) == 2)
return 0;
}
if (mdc->nodump) {
if (bc.cnt > 0) {
blksout (bc.buf, bc.cnt, bc.ino);
}
+ free(bc.buf);
#else
for (ind_level = 0; ind_level < NIADDR; ind_level++) {
dmpindir(ino, dp->di_ib[ind_level], ind_level, &size);