+extern ino_t iexclude_list[IEXCLUDE_MAXNUM]; /* the inode exclude list */
+extern int iexclude_num; /* number of elements in the list */
+
+/*
+ * Determine if given inode should be dumped
+ */
+void
+mapfileino(ino_t ino, long *tapesize, int *dirskipped)
+{
+ register int mode;
+ register struct dinode *dp;
+
+ /*
+ * Skip inode if we've already marked it for dumping
+ */
+ if (TSTINO(ino, usedinomap))
+ return;
+ dp = getino(ino);
+ if ((mode = (dp->di_mode & IFMT)) == 0)
+ return;
+#ifdef __linux__
+ if (dp->di_nlink == 0 || dp->di_dtime != 0)
+ return;
+#endif
+ /*
+ * Put all dirs in dumpdirmap, inodes that are to be dumped in the
+ * used map. All inode but dirs who have the nodump attribute go
+ * to the usedinomap.
+ */
+ SETINO(ino, usedinomap);
+
+ /* 04-Feb-00 ILC */
+ if(iexclude_num) { /* if there are inodes in the exclude list */
+ int idx; /* then check this inode against it */
+ for (idx=0; idx<iexclude_num; idx++) {
+ if (ino == iexclude_list[idx]) {
+ msg("Excluding inode number %d\n", ino);
+ return; /* if in list then skip */
+ }
+ }
+ }
+
+ if (mode == IFDIR)
+ SETINO(ino, dumpdirmap);
+ if (WANTTODUMP(dp)) {
+ SETINO(ino, dumpinomap);
+ if (mode != IFREG && mode != IFDIR && mode != IFLNK)
+ *tapesize += 1;
+ else
+ *tapesize += blockest(dp);
+ return;
+ }
+ if (mode == IFDIR) {
+#ifdef UF_NODUMP
+ if (!nonodump && (dp->di_flags & UF_NODUMP))
+ CLRINO(ino, usedinomap);
+#endif
+ *dirskipped = 1;
+ }
+}
+