2001-02-05 00:52:02 +03:00
|
|
|
/* $NetBSD: vars.c,v 1.5 2001/02/04 21:52:04 christos Exp $ */
|
1999-07-03 23:55:03 +04:00
|
|
|
|
1999-03-18 05:02:18 +03:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <ufs/ufs/dinode.h>
|
|
|
|
#include <ufs/ufs/dir.h>
|
2000-05-23 05:48:52 +04:00
|
|
|
#include <sys/mount.h> /* XXX */
|
1999-03-18 05:02:18 +03:00
|
|
|
#include <ufs/lfs/lfs.h>
|
|
|
|
#include "fsck.h"
|
|
|
|
|
|
|
|
/* variables previously of file scope (from fsck.h) */
|
2000-05-23 05:48:52 +04:00
|
|
|
struct bufarea bufhead; /* head of list of other blks in filesys */
|
|
|
|
struct bufarea sblk; /* file system superblock */
|
|
|
|
struct bufarea iblk; /* ifile on-disk inode block */
|
1999-03-18 05:02:18 +03:00
|
|
|
struct bufarea *pdirbp; /* current directory contents */
|
|
|
|
struct bufarea *pbp; /* current inode block */
|
2000-05-23 05:48:52 +04:00
|
|
|
int iinooff; /* ifile inode offset in block of inodes */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
struct dups *duplist; /* head of dup list */
|
|
|
|
struct dups *muldup; /* end of unique duplicate dup block numbers */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
struct zlncnt *zlnhead; /* head of zero link count list */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-06-14 22:43:57 +04:00
|
|
|
daddr_t idaddr; /* inode block containing ifile inode */
|
2000-05-23 05:48:52 +04:00
|
|
|
long numdirs, listmax, inplast;
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
long dev_bsize; /* computed value of DEV_BSIZE */
|
|
|
|
long secsize; /* actual disk sector size */
|
|
|
|
char nflag; /* assume a no response */
|
|
|
|
char yflag; /* assume a yes response */
|
|
|
|
int bflag; /* location of alternate super block */
|
|
|
|
int debug; /* output debugging info */
|
1999-03-18 05:02:18 +03:00
|
|
|
#ifdef DEBUG_IFILE
|
2000-05-23 05:48:52 +04:00
|
|
|
int debug_ifile; /* cat the ifile and exit */
|
1999-03-18 05:02:18 +03:00
|
|
|
#endif
|
2000-05-23 05:48:52 +04:00
|
|
|
int cvtlevel; /* convert to newer file system format */
|
|
|
|
int doinglevel1; /* converting to new cylinder group format */
|
|
|
|
int doinglevel2; /* converting to new inode format */
|
|
|
|
int exitonfail;
|
|
|
|
int newinofmt; /* filesystem has new inode format */
|
|
|
|
int preen; /* just fix normal inconsistencies */
|
|
|
|
char havesb; /* superblock has been read */
|
|
|
|
char skipclean; /* skip clean file systems if preening */
|
|
|
|
int fsmodified; /* 1 => write done to file system */
|
|
|
|
int fsreadfd; /* file descriptor for reading file system */
|
|
|
|
int fswritefd; /* file descriptor for writing file system */
|
|
|
|
int rerun; /* rerun fsck. Only used in non-preen mode */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
daddr_t maxfsblock; /* number of blocks in the file system */
|
1999-03-18 05:02:18 +03:00
|
|
|
#ifndef VERBOSE_BLOCKMAP
|
2000-05-23 05:48:52 +04:00
|
|
|
char *blockmap; /* ptr to primary blk allocation map */
|
1999-03-18 05:02:18 +03:00
|
|
|
#else
|
2000-05-23 05:48:52 +04:00
|
|
|
ino_t *blockmap;
|
1999-03-18 05:02:18 +03:00
|
|
|
#endif
|
2000-05-23 05:48:52 +04:00
|
|
|
ino_t maxino; /* number of inodes in file system */
|
|
|
|
ino_t lastino; /* last inode in use */
|
|
|
|
char *statemap; /* ptr to inode state table */
|
|
|
|
char *typemap; /* ptr to inode type table */
|
|
|
|
int16_t *lncntp; /* ptr to link count table */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
ino_t lfdir; /* lost & found directory inode number */
|
|
|
|
char *lfname; /* lost & found directory name */
|
|
|
|
int lfmode; /* lost & found directory creation mode */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
daddr_t n_blks; /* number of blocks in use */
|
|
|
|
daddr_t n_files; /* number of files in use */
|
1999-03-18 05:02:18 +03:00
|
|
|
|
2000-05-23 05:48:52 +04:00
|
|
|
struct dinode zino;
|