From a1b67fc50f87e9febfd56bd2a7089eb569b852f6 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Tue, 20 Mar 2001 10:02:48 +0000 Subject: [PATCH] Changed ino_t to dump_ino_t. --- compat/include/bsdcompat.h | 4 +- compat/include/protocols/dumprestore.h | 6 ++- dump/dump.h | 23 +++++----- dump/main.c | 8 ++-- dump/tape.c | 4 +- dump/traverse.c | 63 +++++++++++++------------- restore/dirs.c | 32 ++++++------- restore/extern.h | 30 ++++++------ restore/interactive.c | 6 +-- restore/main.c | 6 +-- restore/restore.c | 26 +++++------ restore/restore.h | 8 ++-- restore/symtab.c | 18 ++++---- restore/tape.c | 4 +- restore/utilities.c | 14 +++--- 15 files changed, 128 insertions(+), 124 deletions(-) diff --git a/compat/include/bsdcompat.h b/compat/include/bsdcompat.h index 96ce8b4..5afe0c7 100644 --- a/compat/include/bsdcompat.h +++ b/compat/include/bsdcompat.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - Alcôve , 2000 * - * $Id: bsdcompat.h,v 1.14 2001/03/20 09:14:58 stelian Exp $ + * $Id: bsdcompat.h,v 1.15 2001/03/20 10:02:48 stelian Exp $ */ #include @@ -22,7 +22,7 @@ #define MIN(a,b) ((a < b) ? a : b) #endif -#define WINO ((ino_t)1) +#define WINO 1 #define DEV_BSIZE 512 #define DEV_BSHIFT 9 #define MAXBSIZE EXT2_MAX_BLOCK_SIZE diff --git a/compat/include/protocols/dumprestore.h b/compat/include/protocols/dumprestore.h index f5f34d8..a2750cd 100644 --- a/compat/include/protocols/dumprestore.h +++ b/compat/include/protocols/dumprestore.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - Alcôve , 2000 * - * $Id: dumprestore.h,v 1.11 2001/03/18 15:35:44 stelian Exp $ + * $Id: dumprestore.h,v 1.12 2001/03/20 10:02:48 stelian Exp $ */ /* @@ -74,6 +74,8 @@ #define NFS_MAGIC (int)60012 #define CHECKSUM (int)84446 +typedef u_int32_t dump_ino_t; + union u_spcl { char dummy[TP_BSIZE]; struct s_spcl { @@ -82,7 +84,7 @@ union u_spcl { int32_t c_ddate; /* date of previous dump */ int32_t c_volume; /* dump volume number */ daddr_t c_tapea; /* logical block of this record */ - ino_t c_inumber; /* number of inode */ + dump_ino_t c_inumber; /* number of inode */ int32_t c_magic; /* magic number (see above) */ int32_t c_checksum; /* record checksum */ #ifdef __linux__ diff --git a/dump/dump.h b/dump/dump.h index 4e3fada..5485ec4 100644 --- a/dump/dump.h +++ b/dump/dump.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - Alcôve , 2000 * - * $Id: dump.h,v 1.21 2001/03/19 13:22:48 stelian Exp $ + * $Id: dump.h,v 1.22 2001/03/20 10:02:48 stelian Exp $ */ /*- @@ -42,6 +42,7 @@ */ #include +#include #define MAXINOPB (MAXBSIZE / sizeof(struct dinode)) #define MAXNINDIR (MAXBSIZE / sizeof(daddr_t)) @@ -78,7 +79,7 @@ char *eot_script; /* end of volume script fiag */ int diskfd; /* disk file descriptor */ int tapefd; /* tape file descriptor */ int pipeout; /* true => output to standard output */ -ino_t curino; /* current inumber; used globally */ +dump_ino_t curino; /* current inumber; used globally */ int newtape; /* new tape flag */ int density; /* density in 0.1" units */ long tapesize; /* estimated tape size, blocks */ @@ -128,21 +129,21 @@ time_t unctime __P((const char *str)); /* mapping rouintes */ struct dinode; long blockest __P((struct dinode const *dp)); -int mapfiles __P((ino_t maxino, long *tapesize)); +int mapfiles __P((dump_ino_t maxino, long *tapesize)); #ifdef __linux__ -int mapfilesfromdir __P((ino_t maxino, long *tapesize, char *directory)); +int mapfilesfromdir __P((dump_ino_t maxino, long *tapesize, char *directory)); #endif -int mapdirs __P((ino_t maxino, long *tapesize)); +int mapdirs __P((dump_ino_t maxino, long *tapesize)); /* file dumping routines */ -void blksout __P((daddr_t *blkp, int frags, ino_t ino)); +void blksout __P((daddr_t *blkp, int frags, dump_ino_t ino)); void bread __P((daddr_t blkno, char *buf, int size)); -void dumpino __P((struct dinode *dp, ino_t ino)); +void dumpino __P((struct dinode *dp, dump_ino_t ino)); #ifdef __linux__ -void dumpdirino __P((struct dinode *dp, ino_t ino)); +void dumpdirino __P((struct dinode *dp, dump_ino_t ino)); #endif -void dumpmap __P((char *map, int type, ino_t ino)); -void writeheader __P((ino_t ino)); +void dumpmap __P((char *map, int type, dump_ino_t ino)); +void writeheader __P((dump_ino_t ino)); /* tape writing routines */ int alloctape __P((void)); @@ -158,7 +159,7 @@ void dumpabort __P((int signo)); void getfstab __P((void)); const char *rawname __P((const char *cp)); -struct dinode *getino __P((ino_t inum)); +struct dinode *getino __P((dump_ino_t inum)); /* rdump routines */ #ifdef RDUMP diff --git a/dump/main.c b/dump/main.c index 04ec6f0..289f1e2 100644 --- a/dump/main.c +++ b/dump/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.36 2001/03/20 09:14:58 stelian Exp $"; + "$Id: main.c,v 1.37 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -107,20 +107,20 @@ static long numarg __P((const char *, long, long)); static void obsolete __P((int *, char **[])); static void usage __P((void)); -ino_t iexclude_list[IEXCLUDE_MAXNUM]; /* the inode exclude list */ +dump_ino_t iexclude_list[IEXCLUDE_MAXNUM];/* the inode exclude list */ int iexclude_num = 0; /* number of elements in the list */ int main(int argc, char *argv[]) { - register ino_t ino; + register dump_ino_t ino; register int dirty; register struct dinode *dp; register struct fstab *dt; register char *map; register int ch; int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; - ino_t maxino; + dump_ino_t maxino; #ifdef __linux__ errcode_t retval; char directory[MAXPATHLEN]; diff --git a/dump/tape.c b/dump/tape.c index 8cf9ce1..7851719 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.35 2001/03/20 09:14:58 stelian Exp $"; + "$Id: tape.c,v 1.36 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -884,7 +884,7 @@ restore_check_point: spcl.c_flags |= DR_NEWHEADER; if (compressed) spcl.c_flags |= DR_COMPRESSED; - writeheader((ino_t)slp->inode); + writeheader((dump_ino_t)slp->inode); spcl.c_flags &=~ DR_NEWHEADER; msg("Volume %d started with block %ld at: %s", tapeno, spcl.c_tapea, ctime(&tstart_volume)); diff --git a/dump/traverse.c b/dump/traverse.c index 3da18d3..8e4a6b6 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.27 2001/03/20 09:14:58 stelian Exp $"; + "$Id: traverse.c,v 1.28 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -93,13 +93,13 @@ typedef long fsizeT; static int searchdir __P((struct ext2_dir_entry *dp, int offset, int blocksize, char *buf, void *private)); #else -static int dirindir __P((ino_t ino, daddr_t blkno, int level, long *size)); -static void dmpindir __P((ino_t ino, daddr_t blk, int level, fsizeT *size)); -static int searchdir __P((ino_t ino, daddr_t blkno, long size, long filesize)); +static int dirindir __P((dump_ino_t ino, daddr_t blkno, int level, long *size)); +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((ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped)); -static int exclude_ino __P((ino_t ino)); -extern ino_t iexclude_list[IEXCLUDE_MAXNUM]; /* the inode exclude list */ +static void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped)); +static int exclude_ino __P((dump_ino_t ino)); +extern dump_ino_t iexclude_list[IEXCLUDE_MAXNUM]; /* the inode exclude list */ extern int iexclude_num; /* number of elements in list */ /* Temporary fix waiting for Andreas fixes... */ @@ -153,8 +153,9 @@ int dump_fs_open(const char *disk, ext2_filsys *fs) } else if (es->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL && - journal_ino && !exclude_ino(journal_ino)) { - iexclude_list[iexclude_num++] = journal_ino; + journal_ino && + !exclude_ino((dump_ino_t)journal_ino)) { + iexclude_list[iexclude_num++] = (dump_ino_t)journal_ino; msg("Added ext3 journal inode %d to exclude list\n", journal_ino); } @@ -216,7 +217,7 @@ blockest(struct dinode const *dp) * This tests whether an inode is in the exclude list */ int -exclude_ino(ino_t ino) +exclude_ino(dump_ino_t ino) { /* 04-Feb-00 ILC */ if (iexclude_num) { /* if there are inodes in the exclude list */ @@ -250,7 +251,7 @@ exclude_ino(ino_t ino) * copy of the given inode, or be NULL (in which case it is fetched.) */ static void -mapfileino(ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped) +mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped) { register int mode; @@ -300,7 +301,7 @@ mapfileino(ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped) */ #ifdef __linux__ int -mapfiles(ino_t maxino, long *tapesize) +mapfiles(dump_ino_t maxino, long *tapesize) { ext2_ino_t ino; int anydirskipped = 0; @@ -344,9 +345,9 @@ mapfiles(ino_t maxino, long *tapesize) } #else int -mapfiles(ino_t maxino, long *tapesize) +mapfiles(dump_ino_t maxino, long *tapesize) { - register ino_t ino; + register dump_ino_t ino; int anydirskipped = 0; for (ino = ROOTINO; ino < maxino; ino++) @@ -404,7 +405,7 @@ mapfilesindir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *bu * the directories in the filesystem. */ int -mapfilesfromdir(ino_t maxino, long *tapesize, char *directory) +mapfilesfromdir(dump_ino_t maxino, long *tapesize, char *directory) { errcode_t retval; struct mapfile_context mfc; @@ -483,12 +484,12 @@ struct mapdirs_context { * pass using this algorithm. */ int -mapdirs(ino_t maxino, long *tapesize) +mapdirs(dump_ino_t maxino, long *tapesize) { register struct dinode *dp; register int isdir; register char *map; - register ino_t ino; + register dump_ino_t ino; #ifndef __linux__ register int i; long filesize; @@ -566,7 +567,7 @@ mapdirs(ino_t maxino, long *tapesize) * require the directory to be dumped. */ static int -dirindir(ino_t ino, daddr_t blkno, int ind_level, long *filesize) +dirindir(dump_ino_t ino, daddr_t blkno, int ind_level, long *filesize) { int ret = 0; register int i; @@ -652,7 +653,7 @@ searchdir(struct ext2_dir_entry *dp, int offset, int blocksize, char *buf, void #else /* __linux__ */ static int -searchdir(ino_t ino, daddr_t blkno, long size, long filesize) +searchdir(dump_ino_t ino, daddr_t blkno, long size, long filesize) { register struct direct *dp; register long loc, ret = 0; @@ -694,7 +695,7 @@ searchdir(ino_t ino, daddr_t blkno, long size, long filesize) #ifdef __linux__ struct block_context { - ino_t ino; + ext2_ino_t ino; int *buf; int cnt; int max; @@ -737,7 +738,7 @@ dumponeblock(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt, * Dump the contents of an inode to tape. */ void -dumpino(struct dinode *dp, ino_t ino) +dumpino(struct dinode *dp, dump_ino_t ino) { unsigned long cnt; fsizeT size; @@ -858,7 +859,7 @@ dumpino(struct dinode *dp, ino_t ino) bc.ino = ino; bc.next_block = NDADDR; - ext2fs_block_iterate2(fs, ino, 0, NULL, dumponeblock, (void *)&bc); + ext2fs_block_iterate2(fs, (ext2_ino_t)ino, 0, NULL, dumponeblock, (void *)&bc); if (bc.cnt > 0) { blksout (bc.buf, bc.cnt, bc.ino); } @@ -921,7 +922,7 @@ convert_dir(struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, * Dumps a directory to tape after converting it to the BSD format */ void -dumpdirino(struct dinode *dp, ino_t ino) +dumpdirino(struct dinode *dp, dump_ino_t ino) { fsizeT size; char buf[TP_BSIZE]; @@ -950,7 +951,7 @@ dumpdirino(struct dinode *dp, ino_t ino) cdc.prev_offset = 0; cdc.bs = MIN(DIRBLKSIZ, TP_BSIZE); /* Do the conversion */ - retval = ext2fs_dir_iterate(fs, ino, 0, NULL, convert_dir, (void *)&cdc); + retval = ext2fs_dir_iterate(fs, (ext2_ino_t)ino, 0, NULL, convert_dir, (void *)&cdc); if (retval) { com_err(disk, retval, "while converting directory #%ld\n", (long)ino); exit(X_ABORT); @@ -1024,7 +1025,7 @@ dumpdirino(struct dinode *dp, ino_t ino) * Read indirect blocks, and pass the data blocks to be dumped. */ static void -dmpindir(ino_t ino, daddr_t blk, int ind_level, fsizeT *size) +dmpindir(dump_ino_t ino, daddr_t blk, int ind_level, fsizeT *size) { int i, cnt; #ifdef __linux__ @@ -1079,7 +1080,7 @@ dmpindir(ino_t ino, daddr_t blk, int ind_level, fsizeT *size) * Collect up the data into tape record sized buffers and output them. */ void -blksout(daddr_t *blkp, int frags, ino_t ino) +blksout(daddr_t *blkp, int frags, dump_ino_t ino) { register daddr_t *bp; int i, j, count, blks, tbperdb; @@ -1115,7 +1116,7 @@ blksout(daddr_t *blkp, int frags, ino_t ino) * Dump a map to the tape. */ void -dumpmap(char *map, int type, ino_t ino) +dumpmap(char *map, int type, dump_ino_t ino) { register int i; char *cp; @@ -1134,7 +1135,7 @@ dumpmap(char *map, int type, ino_t ino) #define int32_t __s32 #endif void -writeheader(ino_t ino) +writeheader(dump_ino_t ino) { register int32_t sum, cnt, *lp; @@ -1156,13 +1157,13 @@ writeheader(ino_t ino) #ifdef __linux__ struct dinode * -getino(ino_t inum) +getino(dump_ino_t inum) { static struct dinode dinode; errcode_t err; curino = inum; - err = ext2fs_read_inode(fs, inum, (struct ext2_inode *) &dinode); + err = ext2fs_read_inode(fs, (ext2_ino_t)inum, (struct ext2_inode *) &dinode); if (err) { com_err(disk, err, "while reading inode #%ld\n", (long)inum); exit(X_ABORT); @@ -1171,7 +1172,7 @@ getino(ino_t inum) } #else /* __linux__ */ struct dinode * -getino(ino_t inum) +getino(dump_ino_t inum) { static daddr_t minino, maxino; static struct dinode inoblock[MAXINOPB]; diff --git a/restore/dirs.c b/restore/dirs.c index eb90558..6398f87 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dirs.c,v 1.13 2000/12/21 11:14:54 stelian Exp $"; + "$Id: dirs.c,v 1.14 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -87,7 +87,7 @@ static const char rcsid[] = #define INOHASH(val) (val % HASHSIZE) struct inotab { struct inotab *t_next; - ino_t t_ino; + dump_ino_t t_ino; int32_t t_seekpt; int32_t t_size; }; @@ -97,7 +97,7 @@ static struct inotab *inotab[HASHSIZE]; * Information retained about directories. */ struct modeinfo { - ino_t ino; + dump_ino_t ino; struct timeval timep[2]; mode_t mode; uid_t uid; @@ -137,19 +137,19 @@ struct odirect { }; #ifdef __linux__ -static struct inotab *allocinotab __P((ino_t, struct new_bsd_inode *, long)); +static struct inotab *allocinotab __P((dump_ino_t, struct new_bsd_inode *, long)); #else -static struct inotab *allocinotab __P((ino_t, struct dinode *, long)); +static struct inotab *allocinotab __P((dump_ino_t, struct dinode *, long)); #endif static void dcvt __P((struct odirect *, struct direct *)); static void flushent __P((void)); -static struct inotab *inotablookup __P((ino_t)); +static struct inotab *inotablookup __P((dump_ino_t)); static RST_DIR *opendirfile __P((const char *)); static void putdir __P((char *, size_t)); static void putent __P((struct direct *)); static void rst_seekdir __P((RST_DIR *, long, long)); static long rst_telldir __P((RST_DIR *)); -static struct direct *searchdir __P((ino_t, char *)); +static struct direct *searchdir __P((dump_ino_t, char *)); /* * Extract directory contents, building up a directory structure @@ -246,7 +246,7 @@ skipdirs(void) * pname and pass them off to be processed. */ void -treescan(char *pname, ino_t ino, long (*todo) __P((char *, ino_t, int))) +treescan(char *pname, dump_ino_t ino, long (*todo) __P((char *, dump_ino_t, int))) { register struct inotab *itp; register struct direct *dp; @@ -311,7 +311,7 @@ treescan(char *pname, ino_t ino, long (*todo) __P((char *, ino_t, int))) struct direct * pathsearch(const char *pathname) { - ino_t ino; + dump_ino_t ino; struct direct *dp; char *path, *name, buffer[MAXPATHLEN]; @@ -334,7 +334,7 @@ pathsearch(const char *pathname) * Return its inode number if found, zero if it does not exist. */ static struct direct * -searchdir(ino_t inum, char *name) +searchdir(dump_ino_t inum, char *name) { register struct direct *dp; register struct inotab *itp; @@ -547,7 +547,7 @@ rst_opendir(const char *name) { struct inotab *itp; RST_DIR *dirp; - ino_t ino; + dump_ino_t ino; if ((ino = dirlookup(name)) > 0 && (itp = inotablookup(ino)) != NULL) { @@ -668,7 +668,7 @@ setdirmodes(int flags) * Generate a literal copy of a directory. */ int -genliteraldir(char *name, ino_t ino) +genliteraldir(char *name, dump_ino_t ino) { register struct inotab *itp; int ofile, dp, i, size; @@ -705,7 +705,7 @@ genliteraldir(char *name, ino_t ino) * Determine the type of an inode */ int -inodetype(ino_t ino) +inodetype(dump_ino_t ino) { struct inotab *itp; @@ -721,9 +721,9 @@ inodetype(ino_t ino) */ static struct inotab * #ifdef __linux__ -allocinotab(ino_t ino, struct new_bsd_inode *dip, long seekpt) +allocinotab(dump_ino_t ino, struct new_bsd_inode *dip, long seekpt) #else -allocinotab(ino_t ino, struct dinode *dip, long seekpt) +allocinotab(dump_ino_t ino, struct dinode *dip, long seekpt) #endif { register struct inotab *itp; @@ -763,7 +763,7 @@ allocinotab(ino_t ino, struct dinode *dip, long seekpt) * Look up an inode in the table of directories */ static struct inotab * -inotablookup(ino_t ino) +inotablookup(dump_ino_t ino) { register struct inotab *itp; diff --git a/restore/extern.h b/restore/extern.h index 3bf83f1..e63a136 100644 --- a/restore/extern.h +++ b/restore/extern.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - Alcôve , 2000 * - * $Id: extern.h,v 1.11 2000/12/21 11:14:54 stelian Exp $ + * $Id: extern.h,v 1.12 2001/03/20 10:02:48 stelian Exp $ */ /*- @@ -43,8 +43,8 @@ #include -struct entry *addentry __P((char *, ino_t, int)); -long addfile __P((char *, ino_t, int)); +struct entry *addentry __P((char *, dump_ino_t, int)); +long addfile __P((char *, dump_ino_t, int)); int addwhiteout __P((char *)); void badentry __P((struct entry *, const char *)); void canon __P((char *, char *, int)); @@ -56,10 +56,10 @@ void compareleaves __P((void)); void createfiles __P((void)); void createleaves __P((char *)); void createlinks __P((void)); -long deletefile __P((char *, ino_t, int)); -void deleteino __P((ino_t)); +long deletefile __P((char *, dump_ino_t, int)); +void deleteino __P((dump_ino_t)); void delwhiteout __P((struct entry *)); -ino_t dirlookup __P((const char *)); +dump_ino_t dirlookup __P((const char *)); void dumpsymtable __P((char *, long)); void extractdirs __P((int)); int extractfile __P((char *)); @@ -67,24 +67,24 @@ void findunreflinks __P((void)); char *flagvalues __P((struct entry *)); void freeentry __P((struct entry *)); void freename __P((char *)); -int genliteraldir __P((char *, ino_t)); +int genliteraldir __P((char *, dump_ino_t)); char *gentempname __P((struct entry *)); void getfile __P((void (*)(char *, size_t), void (*)(char *, size_t))); void getvol __P((long)); void initsymtable __P((char *)); -int inodetype __P((ino_t)); +int inodetype __P((dump_ino_t)); int linkit __P((char *, char *, int)); -struct entry *lookupino __P((ino_t)); +struct entry *lookupino __P((dump_ino_t)); struct entry *lookupname __P((char *)); -long listfile __P((char *, ino_t, int)); -ino_t lowerbnd __P((ino_t)); +long listfile __P((char *, dump_ino_t, int)); +dump_ino_t lowerbnd __P((dump_ino_t)); void mktempname __P((struct entry *)); void moveentry __P((struct entry *, char *)); void msg __P((const char *, ...)); char *myname __P((struct entry *)); void newnode __P((struct entry *)); void newtapebuf __P((long)); -long nodeupdates __P((char *, ino_t, int)); +long nodeupdates __P((char *, dump_ino_t, int)); void onintr __P((int)); void panic __P((const char *, ...)); void pathcheck __P((char *)); @@ -108,9 +108,9 @@ void skipdirs __P((void)); void skipfile __P((void)); void skipmaps __P((void)); void swabst __P((u_char *, u_char *)); -void treescan __P((char *, ino_t, long (*)(char *, ino_t, int))); -ino_t upperbnd __P((ino_t)); -long verifyfile __P((char *, ino_t, int)); +void treescan __P((char *, dump_ino_t, long (*)(char *, dump_ino_t, int))); +dump_ino_t upperbnd __P((dump_ino_t)); +long verifyfile __P((char *, dump_ino_t, int)); void xtrnull __P((char *, size_t)); /* From ../dump/dumprmt.c */ diff --git a/restore/interactive.c b/restore/interactive.c index 40c0ba5..3b184fc 100644 --- a/restore/interactive.c +++ b/restore/interactive.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: interactive.c,v 1.15 2000/12/21 11:14:54 stelian Exp $"; + "$Id: interactive.c,v 1.16 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -97,7 +97,7 @@ static int pflag = 0; /* prompt mode */ * Structure and routines associated with listing directories. */ struct afile { - ino_t fnum; /* inode number of file */ + dump_ino_t fnum; /* inode number of file */ char *fname; /* file name */ short len; /* name length */ char prefix; /* prefix character */ @@ -126,7 +126,7 @@ void runcmdshell(void) { register struct entry *np; - ino_t ino; + dump_ino_t ino; struct arglist arglist; char curdir[MAXPATHLEN]; char name[MAXPATHLEN]; diff --git a/restore/main.c b/restore/main.c index 703266c..9b2ea0f 100644 --- a/restore/main.c +++ b/restore/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.17 2001/03/20 09:14:58 stelian Exp $"; + "$Id: main.c,v 1.18 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -83,7 +83,7 @@ long volno = 0; long ntrec; char *dumpmap; char *usedinomap; -ino_t maxino; +dump_ino_t maxino; time_t dumptime; time_t dumpdate; FILE *terminal; @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) { int ch; - ino_t ino; + dump_ino_t ino; char *inputdev = _PATH_DEFTAPE; char *symtbl = "./restoresymtable"; char *p, name[MAXPATHLEN]; diff --git a/restore/restore.c b/restore/restore.c index 7197a3d..bc38b65 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.13 2000/12/21 11:14:54 stelian Exp $"; + "$Id: restore.c,v 1.14 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -73,7 +73,7 @@ static char *keyval __P((int)); * List entries on the tape. */ long -listfile(char *name, ino_t ino, int type) +listfile(char *name, dump_ino_t ino, int type) { long descend = hflag ? GOOD : FAIL; @@ -89,7 +89,7 @@ listfile(char *name, ino_t ino, int type) * Request that new entries be extracted. */ long -addfile(char *name, ino_t ino, int type) +addfile(char *name, dump_ino_t ino, int type) { register struct entry *ep, *np; long descend = hflag ? GOOD : FAIL; @@ -135,7 +135,7 @@ addfile(char *name, ino_t ino, int type) */ /* ARGSUSED */ long -deletefile(char *name, ino_t ino, int type) +deletefile(char *name, dump_ino_t ino, int type) { long descend = hflag ? GOOD : FAIL; struct entry *ep; @@ -176,7 +176,7 @@ void removeoldleaves(void) { register struct entry *ep, *nextep; - register ino_t i, mydirino; + register dump_ino_t i, mydirino; Vprintf(stdout, "Mark entries to be removed.\n"); if ((ep = lookupino(WINO))) { @@ -230,7 +230,7 @@ removeoldleaves(void) * Renames are done at the same time. */ long -nodeupdates(char *name, ino_t ino, int type) +nodeupdates(char *name, dump_ino_t ino, int type) { register struct entry *ep, *np, *ip; long descend = GOOD; @@ -542,7 +542,7 @@ void findunreflinks(void) { register struct entry *ep, *np; - register ino_t i; + register dump_ino_t i; Vprintf(stdout, "Find unreferenced names.\n"); for (i = ROOTINO; i < maxino; i++) { @@ -633,7 +633,7 @@ void compareleaves(void) { register struct entry *ep; - ino_t first; + dump_ino_t first; long curvol; first = lowerbnd(ROOTINO); @@ -701,7 +701,7 @@ void createleaves(char *symtabfile) { register struct entry *ep; - ino_t first; + dump_ino_t first; long curvol; if (command == 'R') { @@ -779,7 +779,7 @@ createleaves(char *symtabfile) void createfiles(void) { - register ino_t first, next, last; + register dump_ino_t first, next, last; register struct entry *ep; long curvol; @@ -868,7 +868,7 @@ void createlinks(void) { register struct entry *np, *ep; - register ino_t i; + register dump_ino_t i; char name[BUFSIZ]; if ((ep = lookupino(WINO))) { @@ -912,7 +912,7 @@ void checkrestore(void) { register struct entry *ep; - register ino_t i; + register dump_ino_t i; Vprintf(stdout, "Check the symbol table.\n"); for (i = WINO; i < maxino; i++) { @@ -931,7 +931,7 @@ checkrestore(void) * A paranoid check that things are as they should be. */ long -verifyfile(char *name, ino_t ino, int type) +verifyfile(char *name, dump_ino_t ino, int type) { struct entry *np, *ep; long descend = GOOD; diff --git a/restore/restore.h b/restore/restore.h index 562b910..6c77e5a 100644 --- a/restore/restore.h +++ b/restore/restore.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - Alcôve , 2000 * - * $Id: restore.h,v 1.13 2001/02/21 16:13:05 stelian Exp $ + * $Id: restore.h,v 1.14 2001/03/20 10:02:48 stelian Exp $ */ /* @@ -67,7 +67,7 @@ extern int zflag; /* tape is in compressed format */ */ extern char *dumpmap; /* map of inodes on this dump tape */ extern char *usedinomap; /* map of inodes that are in use on this fs */ -extern ino_t maxino; /* highest numbered inode in this file system */ +extern dump_ino_t maxino; /* highest numbered inode in this file system */ extern long dumpnum; /* location of the dump on this tape */ extern long volno; /* current volume being read */ extern long ntrec; /* number of TP_BSIZE records per tape block */ @@ -93,7 +93,7 @@ struct entry { u_char e_namlen; /* length of this name */ char e_type; /* type of this entry, see below */ short e_flags; /* status flags, see below */ - ino_t e_ino; /* inode number in previous file sys */ + dump_ino_t e_ino; /* inode number in previous file sys */ long e_index; /* unique index (for dumpped table) */ struct entry *e_parent; /* pointer to parent directory (..) */ struct entry *e_sibling; /* next element in this directory (.) */ @@ -125,7 +125,7 @@ struct entry { */ struct context { char *name; /* name of file */ - ino_t ino; /* inumber of file */ + dump_ino_t ino; /* inumber of file */ #ifdef __linux__ struct new_bsd_inode *dip; /* pointer to inode */ #else diff --git a/restore/symtab.c b/restore/symtab.c index a72b1cb..abf8d7a 100644 --- a/restore/symtab.c +++ b/restore/symtab.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: symtab.c,v 1.12 2000/12/21 11:14:54 stelian Exp $"; + "$Id: symtab.c,v 1.13 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ /* @@ -91,7 +91,7 @@ static const char rcsid[] = static struct entry **entry; static long entrytblsize; -static void addino __P((ino_t, struct entry *)); +static void addino __P((dump_ino_t, struct entry *)); static struct entry *lookupparent __P((char *)); static void removeentry __P((struct entry *)); @@ -99,7 +99,7 @@ static void removeentry __P((struct entry *)); * Look up an entry by inode number */ struct entry * -lookupino(ino_t inum) +lookupino(dump_ino_t inum) { register struct entry *ep; @@ -115,7 +115,7 @@ lookupino(ino_t inum) * Add an entry into the entry table */ static void -addino(ino_t inum, struct entry *np) +addino(dump_ino_t inum, struct entry *np) { struct entry **epp; @@ -135,7 +135,7 @@ addino(ino_t inum, struct entry *np) * Delete an entry from the entry table */ void -deleteino(ino_t inum) +deleteino(dump_ino_t inum) { register struct entry *next; struct entry **prev; @@ -236,7 +236,7 @@ static struct entry *freelist = NULL; * add an entry to the symbol table */ struct entry * -addentry(char *name, ino_t inum, int type) +addentry(char *name, dump_ino_t inum, int type) { register struct entry *np, *ep; @@ -287,7 +287,7 @@ void freeentry(struct entry *ep) { register struct entry *np; - ino_t inum; + dump_ino_t inum; if (ep->e_flags != REMOVED) badentry(ep, "not marked REMOVED"); @@ -446,7 +446,7 @@ struct symtableheader { int32_t entrytblsize; time_t dumptime; time_t dumpdate; - ino_t maxino; + dump_ino_t maxino; int32_t ntrec; }; @@ -457,7 +457,7 @@ void dumpsymtable(char *filename, long checkpt) { register struct entry *ep, *tep; - register ino_t i; + register dump_ino_t i; struct entry temp, *tentry; long mynum = 1, stroff = 0; FILE *fd; diff --git a/restore/tape.c b/restore/tape.c index 1bb6d8c..d4a46ed 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.28 2001/03/20 09:14:58 stelian Exp $"; + "$Id: tape.c,v 1.29 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -1981,7 +1981,7 @@ good: static void accthdr(struct s_spcl *header) { - static ino_t previno = 0x7fffffff; + static dump_ino_t previno = 0x7fffffff; static int prevtype; static long predict; long blks, i; diff --git a/restore/utilities.c b/restore/utilities.c index a7164fb..34f9f8d 100644 --- a/restore/utilities.c +++ b/restore/utilities.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: utilities.c,v 1.12 2001/03/19 13:22:49 stelian Exp $"; + "$Id: utilities.c,v 1.13 2001/03/20 10:02:48 stelian Exp $"; #endif /* not lint */ #include @@ -311,8 +311,8 @@ delwhiteout(struct entry *ep) /* * find lowest number file (above "start") that needs to be extracted */ -ino_t -lowerbnd(ino_t start) +dump_ino_t +lowerbnd(dump_ino_t start) { register struct entry *ep; @@ -329,8 +329,8 @@ lowerbnd(ino_t start) /* * find highest number file (below "start") that needs to be extracted */ -ino_t -upperbnd(ino_t start) +dump_ino_t +upperbnd(dump_ino_t start) { register struct entry *ep; @@ -397,11 +397,11 @@ flagvalues(struct entry *ep) /* * Check to see if a name is on a dump tape. */ -ino_t +dump_ino_t dirlookup(const char *name) { struct direct *dp; - ino_t ino; + dump_ino_t ino; ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino; -- 2.39.5