xref: /illumos-gate/usr/src/cmd/fs.d/ufs/fsck/fsck.h (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
3*7c478bd9Sstevel@tonic-gate 
4*7c478bd9Sstevel@tonic-gate /*
5*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
6*7c478bd9Sstevel@tonic-gate  * All rights reserved.
7*7c478bd9Sstevel@tonic-gate  *
8*7c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms are permitted
9*7c478bd9Sstevel@tonic-gate  * provided that: (1) source distributions retain this entire copyright
10*7c478bd9Sstevel@tonic-gate  * notice and comment, and (2) distributions including binaries display
11*7c478bd9Sstevel@tonic-gate  * the following acknowledgement:  ``This product includes software
12*7c478bd9Sstevel@tonic-gate  * developed by the University of California, Berkeley and its contributors''
13*7c478bd9Sstevel@tonic-gate  * in the documentation or other materials provided with the distribution
14*7c478bd9Sstevel@tonic-gate  * and in all advertising materials mentioning features or use of this
15*7c478bd9Sstevel@tonic-gate  * software. Neither the name of the University nor the names of its
16*7c478bd9Sstevel@tonic-gate  * contributors may be used to endorse or promote products derived
17*7c478bd9Sstevel@tonic-gate  * from this software without specific prior written permission.
18*7c478bd9Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19*7c478bd9Sstevel@tonic-gate  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20*7c478bd9Sstevel@tonic-gate  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate /*
24*7c478bd9Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
25*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
26*7c478bd9Sstevel@tonic-gate  */
27*7c478bd9Sstevel@tonic-gate 
28*7c478bd9Sstevel@tonic-gate #ifndef	_FSCK_FSCK_H
29*7c478bd9Sstevel@tonic-gate #define	_FSCK_FSCK_H
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.3   */
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
34*7c478bd9Sstevel@tonic-gate extern "C" {
35*7c478bd9Sstevel@tonic-gate #endif
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #define	MAXDUP		10	/* limit on dup blks (per inode) */
38*7c478bd9Sstevel@tonic-gate #define	MAXBAD		10	/* limit on bad blks (per inode) */
39*7c478bd9Sstevel@tonic-gate #define	MaxCPG		100000	/* sanity limit on # of cylinders / group */
40*7c478bd9Sstevel@tonic-gate #define	MAXBUFSPACE	40*1024	/* maximum space to allocate to buffers */
41*7c478bd9Sstevel@tonic-gate #define	INOBUFSIZE	56*1024	/* size of buffer to read inodes in pass1 */
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate #ifndef BUFSIZ
44*7c478bd9Sstevel@tonic-gate #define	BUFSIZ 1024
45*7c478bd9Sstevel@tonic-gate #endif
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate #define	USTATE	01		/* inode not allocated */
48*7c478bd9Sstevel@tonic-gate #define	FSTATE	02		/* inode is file */
49*7c478bd9Sstevel@tonic-gate #define	DSTATE	03		/* inode is directory */
50*7c478bd9Sstevel@tonic-gate #define	DFOUND	04		/* directory found during descent */
51*7c478bd9Sstevel@tonic-gate #define	DCLEAR	05		/* directory is to be cleared */
52*7c478bd9Sstevel@tonic-gate #define	FCLEAR	06		/* file is to be cleared */
53*7c478bd9Sstevel@tonic-gate #define	SSTATE	07		/* inode is a shadow */
54*7c478bd9Sstevel@tonic-gate #define	SCLEAR	10		/* shadow is to be cleared */
55*7c478bd9Sstevel@tonic-gate 
56*7c478bd9Sstevel@tonic-gate /*
57*7c478bd9Sstevel@tonic-gate  * buffer cache structure.
58*7c478bd9Sstevel@tonic-gate  */
59*7c478bd9Sstevel@tonic-gate struct bufarea {
60*7c478bd9Sstevel@tonic-gate 	struct bufarea	*b_next;		/* free list queue */
61*7c478bd9Sstevel@tonic-gate 	struct bufarea	*b_prev;		/* free list queue */
62*7c478bd9Sstevel@tonic-gate 	diskaddr_t	b_bno;
63*7c478bd9Sstevel@tonic-gate 	int	b_size;
64*7c478bd9Sstevel@tonic-gate 	int	b_errs;
65*7c478bd9Sstevel@tonic-gate 	int	b_flags;
66*7c478bd9Sstevel@tonic-gate 	int	b_cnt;				/* reference cnt */
67*7c478bd9Sstevel@tonic-gate 	union {
68*7c478bd9Sstevel@tonic-gate 		char	*b_buf;			/* buffer space */
69*7c478bd9Sstevel@tonic-gate 		daddr32_t	*b_indir;	/* indirect block */
70*7c478bd9Sstevel@tonic-gate 		struct	fs *b_fs;		/* super block */
71*7c478bd9Sstevel@tonic-gate 		struct	cg *b_cg;		/* cylinder group */
72*7c478bd9Sstevel@tonic-gate 		struct	dinode *b_dinode;	/* inode block */
73*7c478bd9Sstevel@tonic-gate 	} b_un;
74*7c478bd9Sstevel@tonic-gate 	char	b_dirty;
75*7c478bd9Sstevel@tonic-gate };
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate #define	B_INUSE 1
78*7c478bd9Sstevel@tonic-gate 
79*7c478bd9Sstevel@tonic-gate #define	MINBUFS		5	/* minimum number of buffers required */
80*7c478bd9Sstevel@tonic-gate struct bufarea bufhead;		/* head of list of other blks in filesys */
81*7c478bd9Sstevel@tonic-gate struct bufarea sblk;		/* file system superblock */
82*7c478bd9Sstevel@tonic-gate struct bufarea cgblk;		/* cylinder group blocks */
83*7c478bd9Sstevel@tonic-gate struct bufarea *pbp;		/* pointer to inode data in buffer pool */
84*7c478bd9Sstevel@tonic-gate struct bufarea *pdirbp;		/* pointer to directory data in buffer pool */
85*7c478bd9Sstevel@tonic-gate struct bufarea *getdatablk(daddr32_t, int);
86*7c478bd9Sstevel@tonic-gate 
87*7c478bd9Sstevel@tonic-gate #define	dirty(bp)	(bp)->b_dirty = isdirty = 1
88*7c478bd9Sstevel@tonic-gate #define	initbarea(bp) \
89*7c478bd9Sstevel@tonic-gate 	(bp)->b_dirty = 0; \
90*7c478bd9Sstevel@tonic-gate 	(bp)->b_bno = -1LL; \
91*7c478bd9Sstevel@tonic-gate 	(bp)->b_flags = 0;	\
92*7c478bd9Sstevel@tonic-gate 	(bp)->b_cnt = 0;
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate #define	sbdirty()	sblk.b_dirty = isdirty = 1
95*7c478bd9Sstevel@tonic-gate #define	cgdirty()	cgblk.b_dirty = isdirty = 1
96*7c478bd9Sstevel@tonic-gate #define	sblock		(*sblk.b_un.b_fs)
97*7c478bd9Sstevel@tonic-gate #define	cgrp		(*cgblk.b_un.b_cg)
98*7c478bd9Sstevel@tonic-gate 
99*7c478bd9Sstevel@tonic-gate enum fixstate {DONTKNOW, NOFIX, FIX};
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate struct inodesc {
102*7c478bd9Sstevel@tonic-gate 	enum fixstate id_fix;	/* policy on fixing errors */
103*7c478bd9Sstevel@tonic-gate 	int (*id_func)();	/* function to be applied to blocks of inode */
104*7c478bd9Sstevel@tonic-gate 	ino_t id_number;	/* inode number described */
105*7c478bd9Sstevel@tonic-gate 	ino_t id_parent;	/* for DATA nodes, their parent */
106*7c478bd9Sstevel@tonic-gate 	ino_t id_client;	/* base file for attribute */
107*7c478bd9Sstevel@tonic-gate 	daddr32_t id_blkno;	/* current block number being examined */
108*7c478bd9Sstevel@tonic-gate 	int id_numfrags;	/* number of frags contained in block */
109*7c478bd9Sstevel@tonic-gate 	offset_t id_filesize;	/* for DATA nodes, the size of the directory */
110*7c478bd9Sstevel@tonic-gate 	uint_t id_loc;	/* for DATA nodes, current location in dir */
111*7c478bd9Sstevel@tonic-gate 	uint_t id_entryno;	/* for DATA nodes, current entry number */
112*7c478bd9Sstevel@tonic-gate 	int id_hasholes;	/* for DATA inode, 1 == dir has holes */
113*7c478bd9Sstevel@tonic-gate 	int id_llbna;		/* for DATA nodes, last logical block alloc'd */
114*7c478bd9Sstevel@tonic-gate 	struct direct *id_dirp;	/* for DATA nodes, ptr to current entry */
115*7c478bd9Sstevel@tonic-gate 	char *id_name;		/* for DATA nodes, name to find or enter */
116*7c478bd9Sstevel@tonic-gate 	char id_type;		/* type of descriptor, DATA or ADDR */
117*7c478bd9Sstevel@tonic-gate };
118*7c478bd9Sstevel@tonic-gate /* file types */
119*7c478bd9Sstevel@tonic-gate #define	DATA	1
120*7c478bd9Sstevel@tonic-gate #define	ADDR	2
121*7c478bd9Sstevel@tonic-gate #define	ACL	3
122*7c478bd9Sstevel@tonic-gate 
123*7c478bd9Sstevel@tonic-gate /*
124*7c478bd9Sstevel@tonic-gate  * Linked list of duplicate blocks.
125*7c478bd9Sstevel@tonic-gate  *
126*7c478bd9Sstevel@tonic-gate  * The list is composed of two parts. The first part of the
127*7c478bd9Sstevel@tonic-gate  * list (from duplist through the node pointed to by muldup)
128*7c478bd9Sstevel@tonic-gate  * contains a single copy of each duplicate block that has been
129*7c478bd9Sstevel@tonic-gate  * found. The second part of the list (from muldup to the end)
130*7c478bd9Sstevel@tonic-gate  * contains duplicate blocks that have been found more than once.
131*7c478bd9Sstevel@tonic-gate  * To check if a block has been found as a duplicate it is only
132*7c478bd9Sstevel@tonic-gate  * necessary to search from duplist through muldup. To find the
133*7c478bd9Sstevel@tonic-gate  * total number of times that a block has been found as a duplicate
134*7c478bd9Sstevel@tonic-gate  * the entire list must be searched for occurences of the block
135*7c478bd9Sstevel@tonic-gate  * in question. The following diagram shows a sample list where
136*7c478bd9Sstevel@tonic-gate  * w (found twice), x (found once), y (found three times), and z
137*7c478bd9Sstevel@tonic-gate  * (found once) are duplicate block numbers:
138*7c478bd9Sstevel@tonic-gate  *
139*7c478bd9Sstevel@tonic-gate  *    w -> y -> x -> z -> y -> w -> y
140*7c478bd9Sstevel@tonic-gate  *    ^		     ^
141*7c478bd9Sstevel@tonic-gate  *    |              |
142*7c478bd9Sstevel@tonic-gate  * duplist	  muldup
143*7c478bd9Sstevel@tonic-gate  */
144*7c478bd9Sstevel@tonic-gate struct dups {
145*7c478bd9Sstevel@tonic-gate 	struct dups *next;
146*7c478bd9Sstevel@tonic-gate 	daddr32_t dup;
147*7c478bd9Sstevel@tonic-gate };
148*7c478bd9Sstevel@tonic-gate struct dups *duplist;		/* head of dup list */
149*7c478bd9Sstevel@tonic-gate struct dups *muldup;		/* end of unique duplicate dup block numbers */
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate /*
152*7c478bd9Sstevel@tonic-gate  * Linked list of inodes with zero link counts.
153*7c478bd9Sstevel@tonic-gate  */
154*7c478bd9Sstevel@tonic-gate struct zlncnt {
155*7c478bd9Sstevel@tonic-gate 	struct zlncnt *next;
156*7c478bd9Sstevel@tonic-gate 	ino_t zlncnt;
157*7c478bd9Sstevel@tonic-gate };
158*7c478bd9Sstevel@tonic-gate struct zlncnt *zlnhead;		/* head of zero link count list */
159*7c478bd9Sstevel@tonic-gate 
160*7c478bd9Sstevel@tonic-gate /*
161*7c478bd9Sstevel@tonic-gate  * Inode cache data structures.
162*7c478bd9Sstevel@tonic-gate  */
163*7c478bd9Sstevel@tonic-gate struct inoinfo {
164*7c478bd9Sstevel@tonic-gate 	struct	inoinfo *i_nexthash;	/* next entry in hash chain */
165*7c478bd9Sstevel@tonic-gate 	ino_t	i_number;		/* inode number of this entry */
166*7c478bd9Sstevel@tonic-gate 	ino_t	i_parent;		/* inode number of parent */
167*7c478bd9Sstevel@tonic-gate 	ino_t	i_dotdot;		/* inode number of `..' */
168*7c478bd9Sstevel@tonic-gate 	ino_t	i_extattr;		/* inode of hidden attr dir */
169*7c478bd9Sstevel@tonic-gate 	offset_t i_isize;		/* size of inode */
170*7c478bd9Sstevel@tonic-gate 	uint_t	i_numblks;		/* size of block array in bytes */
171*7c478bd9Sstevel@tonic-gate 	daddr32_t	i_blks[1];	/* actually longer */
172*7c478bd9Sstevel@tonic-gate } **inphead, **inpsort;
173*7c478bd9Sstevel@tonic-gate int64_t numdirs, listmax, inplast;
174*7c478bd9Sstevel@tonic-gate 
175*7c478bd9Sstevel@tonic-gate /*
176*7c478bd9Sstevel@tonic-gate  * Acl cache data structures.
177*7c478bd9Sstevel@tonic-gate  */
178*7c478bd9Sstevel@tonic-gate struct aclinfo {
179*7c478bd9Sstevel@tonic-gate 	struct	aclinfo *i_nexthash;	/* next entry in hash chain */
180*7c478bd9Sstevel@tonic-gate 	ino_t	i_number;		/* inode number of this entry */
181*7c478bd9Sstevel@tonic-gate 	offset_t i_isize;		/* size of inode */
182*7c478bd9Sstevel@tonic-gate 	uint_t	i_numblks;		/* size of block array in bytes */
183*7c478bd9Sstevel@tonic-gate 	daddr32_t	i_blks[1];		/* actually longer */
184*7c478bd9Sstevel@tonic-gate } **aclphead, **aclpsort;
185*7c478bd9Sstevel@tonic-gate int64_t numacls, aclmax, aclplast;
186*7c478bd9Sstevel@tonic-gate 
187*7c478bd9Sstevel@tonic-gate /*
188*7c478bd9Sstevel@tonic-gate  * shadowclients and shadowclientinfo are structures for keeping track of
189*7c478bd9Sstevel@tonic-gate  * shadow inodes that exist, and which regular inodes use them (i.e. are
190*7c478bd9Sstevel@tonic-gate  * their clients).
191*7c478bd9Sstevel@tonic-gate  */
192*7c478bd9Sstevel@tonic-gate 
193*7c478bd9Sstevel@tonic-gate struct shadowclients {
194*7c478bd9Sstevel@tonic-gate 	ino_t *client;	/* an array of inode numbers */
195*7c478bd9Sstevel@tonic-gate 	int nclients; /* how many inodes in the array are in use (valid) */
196*7c478bd9Sstevel@tonic-gate 	struct shadowclients *next; /* link to more client inode numbers */
197*7c478bd9Sstevel@tonic-gate };
198*7c478bd9Sstevel@tonic-gate struct shadowclientinfo {
199*7c478bd9Sstevel@tonic-gate 	ino_t shadow;		/* the shadow inode that this info is for */
200*7c478bd9Sstevel@tonic-gate 	int totalClients;	/* how many inodes total refer to this */
201*7c478bd9Sstevel@tonic-gate 	struct shadowclients *clients; /* a linked list of wads of clients */
202*7c478bd9Sstevel@tonic-gate 	struct shadowclientinfo *next; /* link to the next shadow inode */
203*7c478bd9Sstevel@tonic-gate };
204*7c478bd9Sstevel@tonic-gate /* global pointer to this shadow/client information */
205*7c478bd9Sstevel@tonic-gate extern struct shadowclientinfo *shadowclientinfo;
206*7c478bd9Sstevel@tonic-gate extern struct shadowclientinfo *attrclientinfo;
207*7c478bd9Sstevel@tonic-gate /* granularity -- how many client inodes do we make space for at a time */
208*7c478bd9Sstevel@tonic-gate /* initialized in setup.c; changable with adb should anyone ever have a need */
209*7c478bd9Sstevel@tonic-gate extern int maxshadowclients;
210*7c478bd9Sstevel@tonic-gate void registershadowclients(ino_t, ino_t, struct shadowclientinfo **);
211*7c478bd9Sstevel@tonic-gate 
212*7c478bd9Sstevel@tonic-gate char	*devname;		/* name of device being checked */
213*7c478bd9Sstevel@tonic-gate int	dev_bsize;		/* computed value of DEV_BSIZE */
214*7c478bd9Sstevel@tonic-gate int	secsize;		/* actual disk sector size */
215*7c478bd9Sstevel@tonic-gate char	nflag;			/* assume a no response */
216*7c478bd9Sstevel@tonic-gate char	yflag;			/* assume a yes response */
217*7c478bd9Sstevel@tonic-gate int	bflag;			/* location of alternate super block */
218*7c478bd9Sstevel@tonic-gate int	debug;			/* output debugging info */
219*7c478bd9Sstevel@tonic-gate int	rflag;			/* check raw file systems */
220*7c478bd9Sstevel@tonic-gate int	wflag;			/* check only writable filesystems */
221*7c478bd9Sstevel@tonic-gate int	fflag;			/* check regardless of clean flag (force) */
222*7c478bd9Sstevel@tonic-gate int	cvtflag;		/* convert to old file system format */
223*7c478bd9Sstevel@tonic-gate char	preen;			/* just fix normal inconsistencies */
224*7c478bd9Sstevel@tonic-gate char	mountedfs;		/* checking mounted device */
225*7c478bd9Sstevel@tonic-gate int	exitstat;		/* exit status (set to 8 if 'No' response) */
226*7c478bd9Sstevel@tonic-gate char	hotroot;		/* checking root device */
227*7c478bd9Sstevel@tonic-gate char	havesb;			/* superblock has been read */
228*7c478bd9Sstevel@tonic-gate int	fsmodified;		/* 1 => write done to file system */
229*7c478bd9Sstevel@tonic-gate int	fsreadfd;		/* file descriptor for reading file system */
230*7c478bd9Sstevel@tonic-gate int	fswritefd;		/* file descriptor for writing file system */
231*7c478bd9Sstevel@tonic-gate 
232*7c478bd9Sstevel@tonic-gate int	iscorrupt;		/* known to be corrupt/inconsistent */
233*7c478bd9Sstevel@tonic-gate int	isdirty;		/* 1 => write pending to file system */
234*7c478bd9Sstevel@tonic-gate int	isconvert;		/* converting */
235*7c478bd9Sstevel@tonic-gate 
236*7c478bd9Sstevel@tonic-gate int	dirholes;		/* Found dirs with holes in indirect blks */
237*7c478bd9Sstevel@tonic-gate 
238*7c478bd9Sstevel@tonic-gate int	islog;			/* logging file system */
239*7c478bd9Sstevel@tonic-gate int	islogok;		/* log is okay */
240*7c478bd9Sstevel@tonic-gate int	ismdd;			/* metadevice */
241*7c478bd9Sstevel@tonic-gate int	isreclaim;		/* reclaiming is set in the superblock */
242*7c478bd9Sstevel@tonic-gate int	willreclaim;		/* reclaim thread will run at mount */
243*7c478bd9Sstevel@tonic-gate 
244*7c478bd9Sstevel@tonic-gate int	errorlocked;		/* set => mounted fs has been error-locked */
245*7c478bd9Sstevel@tonic-gate 				/* implies fflag "force check flag" */
246*7c478bd9Sstevel@tonic-gate char	*elock_combuf;		/* error lock comment buffer */
247*7c478bd9Sstevel@tonic-gate char	*elock_mountp;		/* mount point; used to unlock error-lock */
248*7c478bd9Sstevel@tonic-gate int	pid;			/* fsck's process id (put in lockfs comment) */
249*7c478bd9Sstevel@tonic-gate int	needs_reclaim;		/* files were deleted, hence reclaim needed */
250*7c478bd9Sstevel@tonic-gate int	mountfd;		/* fd of mount point */
251*7c478bd9Sstevel@tonic-gate struct lockfs	*lfp;		/* current lockfs status */
252*7c478bd9Sstevel@tonic-gate 
253*7c478bd9Sstevel@tonic-gate daddr32_t	maxfsblock;	/* number of blocks in the file system */
254*7c478bd9Sstevel@tonic-gate char	*blockmap;		/* ptr to primary blk allocation map */
255*7c478bd9Sstevel@tonic-gate ino_t	maxino;			/* number of inodes in file system */
256*7c478bd9Sstevel@tonic-gate ino_t	lastino;		/* last inode in use */
257*7c478bd9Sstevel@tonic-gate char	*statemap;		/* ptr to inode state table */
258*7c478bd9Sstevel@tonic-gate short	*lncntp;		/* ptr to link count table */
259*7c478bd9Sstevel@tonic-gate 
260*7c478bd9Sstevel@tonic-gate ino_t	lfdir;			/* lost & found directory inode number */
261*7c478bd9Sstevel@tonic-gate char	*lfname;		/* lost & found directory name */
262*7c478bd9Sstevel@tonic-gate int	lfmode;			/* lost & found directory creation mode */
263*7c478bd9Sstevel@tonic-gate 
264*7c478bd9Sstevel@tonic-gate char	*aclbuf;		/* hold acl's for parsing */
265*7c478bd9Sstevel@tonic-gate int64_t	aclbufoff;		/* offset into aclbuf */
266*7c478bd9Sstevel@tonic-gate 
267*7c478bd9Sstevel@tonic-gate daddr32_t	n_blks;			/* number of blocks in use */
268*7c478bd9Sstevel@tonic-gate daddr32_t	n_files;		/* number of files in use */
269*7c478bd9Sstevel@tonic-gate 
270*7c478bd9Sstevel@tonic-gate #define	clearinode(dp)	(*(dp) = zino), (needs_reclaim = errorlocked)
271*7c478bd9Sstevel@tonic-gate struct	dinode zino;
272*7c478bd9Sstevel@tonic-gate 
273*7c478bd9Sstevel@tonic-gate #define	setbmap(blkno)	setbit(blockmap, blkno)
274*7c478bd9Sstevel@tonic-gate #define	testbmap(blkno)	isset(blockmap, blkno)
275*7c478bd9Sstevel@tonic-gate #define	clrbmap(blkno)	clrbit(blockmap, blkno)
276*7c478bd9Sstevel@tonic-gate 
277*7c478bd9Sstevel@tonic-gate #define	STOP	0x01
278*7c478bd9Sstevel@tonic-gate #define	SKIP	0x02
279*7c478bd9Sstevel@tonic-gate #define	KEEPON	0x04
280*7c478bd9Sstevel@tonic-gate #define	ALTERED	0x08
281*7c478bd9Sstevel@tonic-gate #define	FOUND	0x10
282*7c478bd9Sstevel@tonic-gate 
283*7c478bd9Sstevel@tonic-gate time_t time();
284*7c478bd9Sstevel@tonic-gate struct dinode *ginode(ino_t);
285*7c478bd9Sstevel@tonic-gate struct inoinfo *getinoinfo(ino_t);
286*7c478bd9Sstevel@tonic-gate struct bufarea *getblk(struct bufarea *, daddr32_t, int);
287*7c478bd9Sstevel@tonic-gate ino_t allocino(ino_t, int);
288*7c478bd9Sstevel@tonic-gate int findino(struct inodesc *);
289*7c478bd9Sstevel@tonic-gate char *setup(char *);
290*7c478bd9Sstevel@tonic-gate struct bufarea *getdirblk(daddr32_t blkno, int size);
291*7c478bd9Sstevel@tonic-gate struct bufarea *getdatablk(daddr32_t blkno, int size);
292*7c478bd9Sstevel@tonic-gate daddr32_t allocblk(int frags);
293*7c478bd9Sstevel@tonic-gate extern int bread(int, char *, diskaddr_t, long);
294*7c478bd9Sstevel@tonic-gate extern int bwrite(int, char *, diskaddr_t, long);
295*7c478bd9Sstevel@tonic-gate extern int reply(char *);
296*7c478bd9Sstevel@tonic-gate extern int errexit();
297*7c478bd9Sstevel@tonic-gate extern int pfatal();
298*7c478bd9Sstevel@tonic-gate extern int pwarn();
299*7c478bd9Sstevel@tonic-gate extern int mounted(char *);
300*7c478bd9Sstevel@tonic-gate extern int do_errorlock(int);
301*7c478bd9Sstevel@tonic-gate extern int printclean(void);
302*7c478bd9Sstevel@tonic-gate extern int bufinit(void);
303*7c478bd9Sstevel@tonic-gate extern int ckfini(void);
304*7c478bd9Sstevel@tonic-gate 
305*7c478bd9Sstevel@tonic-gate 
306*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
307*7c478bd9Sstevel@tonic-gate }
308*7c478bd9Sstevel@tonic-gate #endif
309*7c478bd9Sstevel@tonic-gate 
310*7c478bd9Sstevel@tonic-gate #endif	/* _FSCK_FSCK_H */
311