1 1.4 perseant /* $NetBSD: vars.c,v 1.4 2000/06/14 18:44:01 perseant Exp $ */ 2 1.2 kleink 3 1.1 perseant #include <sys/param.h> 4 1.1 perseant #include <sys/time.h> 5 1.1 perseant #include <ufs/ufs/dinode.h> 6 1.1 perseant #include <ufs/ufs/dir.h> 7 1.3 perseant #include <sys/mount.h> /* XXX */ 8 1.1 perseant #include <ufs/lfs/lfs.h> 9 1.1 perseant #include "fsck.h" 10 1.1 perseant 11 1.1 perseant /* variables previously of file scope (from fsck.h) */ 12 1.3 perseant struct bufarea bufhead; /* head of list of other blks in filesys */ 13 1.3 perseant struct bufarea sblk; /* file system superblock */ 14 1.3 perseant struct bufarea iblk; /* ifile on-disk inode block */ 15 1.1 perseant struct bufarea *pdirbp; /* current directory contents */ 16 1.1 perseant struct bufarea *pbp; /* current inode block */ 17 1.3 perseant struct bufarea *getdatablk(daddr_t, long); 18 1.3 perseant int iinooff; /* ifile inode offset in block of inodes */ 19 1.1 perseant 20 1.3 perseant struct dups *duplist; /* head of dup list */ 21 1.3 perseant struct dups *muldup; /* end of unique duplicate dup block numbers */ 22 1.1 perseant 23 1.3 perseant struct zlncnt *zlnhead; /* head of zero link count list */ 24 1.1 perseant 25 1.4 perseant daddr_t idaddr; /* inode block containing ifile inode */ 26 1.3 perseant long numdirs, listmax, inplast; 27 1.3 perseant 28 1.3 perseant long dev_bsize; /* computed value of DEV_BSIZE */ 29 1.3 perseant long secsize; /* actual disk sector size */ 30 1.3 perseant char nflag; /* assume a no response */ 31 1.3 perseant char yflag; /* assume a yes response */ 32 1.3 perseant int bflag; /* location of alternate super block */ 33 1.3 perseant int debug; /* output debugging info */ 34 1.1 perseant #ifdef DEBUG_IFILE 35 1.3 perseant int debug_ifile; /* cat the ifile and exit */ 36 1.1 perseant #endif 37 1.3 perseant int cvtlevel; /* convert to newer file system format */ 38 1.3 perseant int doinglevel1; /* converting to new cylinder group format */ 39 1.3 perseant int doinglevel2; /* converting to new inode format */ 40 1.3 perseant int exitonfail; 41 1.3 perseant int newinofmt; /* filesystem has new inode format */ 42 1.3 perseant int preen; /* just fix normal inconsistencies */ 43 1.3 perseant char havesb; /* superblock has been read */ 44 1.3 perseant char skipclean; /* skip clean file systems if preening */ 45 1.3 perseant int fsmodified; /* 1 => write done to file system */ 46 1.3 perseant int fsreadfd; /* file descriptor for reading file system */ 47 1.3 perseant int fswritefd; /* file descriptor for writing file system */ 48 1.3 perseant int rerun; /* rerun fsck. Only used in non-preen mode */ 49 1.1 perseant 50 1.3 perseant daddr_t maxfsblock; /* number of blocks in the file system */ 51 1.1 perseant #ifndef VERBOSE_BLOCKMAP 52 1.3 perseant char *blockmap; /* ptr to primary blk allocation map */ 53 1.1 perseant #else 54 1.3 perseant ino_t *blockmap; 55 1.1 perseant #endif 56 1.3 perseant ino_t maxino; /* number of inodes in file system */ 57 1.3 perseant ino_t lastino; /* last inode in use */ 58 1.3 perseant char *statemap; /* ptr to inode state table */ 59 1.3 perseant char *typemap; /* ptr to inode type table */ 60 1.3 perseant int16_t *lncntp; /* ptr to link count table */ 61 1.3 perseant 62 1.3 perseant ino_t lfdir; /* lost & found directory inode number */ 63 1.3 perseant char *lfname; /* lost & found directory name */ 64 1.3 perseant int lfmode; /* lost & found directory creation mode */ 65 1.1 perseant 66 1.3 perseant daddr_t n_blks; /* number of blocks in use */ 67 1.3 perseant daddr_t n_files; /* number of files in use */ 68 1.1 perseant 69 1.3 perseant struct dinode zino; 70