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