summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/fsck.h
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2001-03-21 09:48:03 +0000
committermckusick <mckusick@FreeBSD.org>2001-03-21 09:48:03 +0000
commitdc0e22cfaf1b407ad08776ab7386543ad024a76c (patch)
treec406042339ede0ab9e543e4797322cadaef35d82 /sbin/fsck_ffs/fsck.h
parent37fbaa04c47b8d96f06c60428b244c77e3597218 (diff)
downloadFreeBSD-src-dc0e22cfaf1b407ad08776ab7386543ad024a76c.zip
FreeBSD-src-dc0e22cfaf1b407ad08776ab7386543ad024a76c.tar.gz
Additions to run checks on live filesystems. This change will not
affect current systems until fsck is modified to use these new facilities. To try out this change, set the fsck passno to zero in /etc/fstab to cause the filesystem to be mounted without running fsck, then run `fsck_ffs -p -B <filesystem>' after the system has been brought up multiuser to run a background cleanup on <filesystem>. Note that the <filesystem> in question must have soft updates enabled.
Diffstat (limited to 'sbin/fsck_ffs/fsck.h')
-rw-r--r--sbin/fsck_ffs/fsck.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h
index 7365767..e598b35 100644
--- a/sbin/fsck_ffs/fsck.h
+++ b/sbin/fsck_ffs/fsck.h
@@ -102,14 +102,18 @@ struct bufarea cgblk; /* cylinder group blocks */
struct bufarea *pdirbp; /* current directory contents */
struct bufarea *pbp; /* current inode block */
-#define dirty(bp) (bp)->b_dirty = 1
+#define dirty(bp) \
+ if (fswritefd < 0) \
+ pfatal("SETTING DIRTY FLAG IN READ_ONLY MODE\n"); \
+ else \
+ (bp)->b_dirty = 1
#define initbarea(bp) \
(bp)->b_dirty = 0; \
(bp)->b_bno = (ufs_daddr_t)-1; \
(bp)->b_flags = 0;
-#define sbdirty() sblk.b_dirty = 1
-#define cgdirty() cgblk.b_dirty = 1
+#define sbdirty() dirty(&sblk)
+#define cgdirty() dirty(&cgblk)
#define sblock (*sblk.b_un.b_fs)
#define cgrp (*cgblk.b_un.b_cg)
@@ -188,12 +192,21 @@ struct inoinfo {
long numdirs, dirhash, listmax, inplast;
long countdirs; /* number of directories we actually found */
+#define MIBSIZE 3 /* size of fsck sysctl MIBs */
+int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */
+int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */
+int freefiles[MIBSIZE]; /* MIB command to free a set of files */
+int freedirs[MIBSIZE]; /* MIB command to free a set of directories */
+int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */
+struct fsck_cmd cmd; /* sysctl filesystem update commands */
+char snapname[BUFSIZ]; /* when doing snapshots, the name of the file */
char *cdevname; /* name of device being checked */
long dev_bsize; /* computed value of DEV_BSIZE */
long secsize; /* actual disk sector size */
char fflag; /* force check, ignore clean flag */
char nflag; /* assume a no response */
char yflag; /* assume a yes response */
+int bkgrdflag; /* use a snapshot to run on an active system */
int bflag; /* location of alternate super block */
int debug; /* output debugging info */
int cvtlevel; /* convert to newer file system format */
@@ -205,7 +218,6 @@ char preen; /* just fix normal inconsistencies */
char rerun; /* rerun fsck. Only used in non-preen mode */
int returntosingle; /* 1 => return to single user mode on exit */
char resolved; /* cleared if unresolved changes => not clean */
-int markclean; /* mark file system clean when done */
char havesb; /* superblock has been read */
char skipclean; /* skip clean file systems if preening */
int fsmodified; /* 1 => write done to file system */
@@ -302,6 +314,7 @@ void pinode __P((ino_t ino));
void propagate __P((void));
void pwarn __P((const char *fmt, ...));
int reply __P((char *question));
+void rwerror __P((char *mesg, ufs_daddr_t blk));
void setinodebuf __P((ino_t));
int setup __P((char *dev));
void voidquit __P((int));
OpenPOWER on IntegriCloud