]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/fsck_ffs/fsck.h
zfs: merge OpenZFS master-436ab35a5
[FreeBSD/FreeBSD.git] / sbin / fsck_ffs / fsck.h
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause and BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2002 Networks Associates Technology, Inc.
5  * All rights reserved.
6  *
7  * This software was developed for the FreeBSD Project by Marshall
8  * Kirk McKusick and Network Associates Laboratories, the Security
9  * Research Division of Network Associates, Inc. under DARPA/SPAWAR
10  * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
11  * research program.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  *
34  * Copyright (c) 1980, 1986, 1993
35  *      The Regents of the University of California.  All rights reserved.
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions
39  * are met:
40  * 1. Redistributions of source code must retain the above copyright
41  *    notice, this list of conditions and the following disclaimer.
42  * 2. Redistributions in binary form must reproduce the above copyright
43  *    notice, this list of conditions and the following disclaimer in the
44  *    documentation and/or other materials provided with the distribution.
45  * 3. Neither the name of the University nor the names of its contributors
46  *    may be used to endorse or promote products derived from this software
47  *    without specific prior written permission.
48  *
49  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59  * SUCH DAMAGE.
60  *
61  *      @(#)fsck.h      8.4 (Berkeley) 5/9/95
62  * $FreeBSD$
63  */
64
65 #ifndef _FSCK_H_
66 #define _FSCK_H_
67
68 #include <unistd.h>
69 #include <stdlib.h>
70 #include <stdio.h>
71
72 #include <sys/queue.h>
73
74 #define MAXDUP          10      /* limit on dup blks (per inode) */
75 #define MAXBAD          10      /* limit on bad blks (per inode) */
76 #define MINBUFS         100     /* minimum number of buffers required */
77 #define INOBUFSIZE      64*1024 /* size of buffer to read inodes in pass1 */
78 #define ZEROBUFSIZE     (dev_bsize * 128) /* size of zero buffer used by -Z */
79
80 union dinode {
81         struct ufs1_dinode dp1;
82         struct ufs2_dinode dp2;
83 };
84 #define DIP(dp, field) \
85         ((sblock.fs_magic == FS_UFS1_MAGIC) ? \
86         (dp)->dp1.field : (dp)->dp2.field)
87
88 #define DIP_SET(dp, field, val) do { \
89         if (sblock.fs_magic == FS_UFS1_MAGIC) \
90                 (dp)->dp1.field = (val); \
91         else \
92                 (dp)->dp2.field = (val); \
93         } while (0)
94
95 /*
96  * Each inode on the file system is described by the following structure.
97  * The linkcnt is initially set to the value in the inode. Each time it
98  * is found during the descent in passes 2, 3, and 4 the count is
99  * decremented. Any inodes whose count is non-zero after pass 4 needs to
100  * have its link count adjusted by the value remaining in ino_linkcnt.
101  */
102 struct inostat {
103         u_char  ino_state;      /* state of inode, see below */
104         u_char  ino_type:4;     /* type of inode */
105         u_char  ino_idtype:4;   /* idesc id_type, SNAP or ADDR */
106         u_short ino_linkcnt;    /* number of links not found */
107 };
108 /*
109  * Inode states.
110  */
111 #define USTATE  0x1             /* inode not allocated */
112 #define FSTATE  0x2             /* inode is file */
113 #define FZLINK  0x3             /* inode is file with a link count of zero */
114 #define DSTATE  0x4             /* inode is directory */
115 #define DZLINK  0x5             /* inode is directory with a zero link count  */
116 #define DFOUND  0x6             /* directory found during descent */
117 /*              0x7                UNUSED - see S_IS_DVALID() definition */
118 #define DCLEAR  0x8             /* directory is to be cleared */
119 #define FCLEAR  0x9             /* file is to be cleared */
120 /*      DUNFOUND === (state == DSTATE || state == DZLINK) */
121 #define S_IS_DUNFOUND(state)    (((state) & ~0x1) == DSTATE)
122 /*      DVALID   === (state == DSTATE || state == DZLINK || state == DFOUND) */
123 #define S_IS_DVALID(state)      (((state) & ~0x3) == DSTATE)
124 #define INO_IS_DUNFOUND(ino)    S_IS_DUNFOUND(inoinfo(ino)->ino_state)
125 #define INO_IS_DVALID(ino)      S_IS_DVALID(inoinfo(ino)->ino_state)
126 /*
127  * Inode state information is contained on per cylinder group lists
128  * which are described by the following structure.
129  */
130 extern struct inostatlist {
131         long    il_numalloced;  /* number of inodes allocated in this cg */
132         struct inostat *il_stat;/* inostat info for this cylinder group */
133 } *inostathead;
134
135 /*
136  * Structure to reference a dinode.
137  */
138 struct inode {
139         struct bufarea *i_bp;   /* buffer containing the dinode */
140         union dinode *i_dp;     /* pointer to dinode in buffer */
141         ino_t i_number;         /* inode number */
142 };
143
144 /*
145  * Size of hash tables
146  */
147 #define HASHSIZE        2048
148 #define HASH(x)         ((x * 2654435761) & (HASHSIZE - 1))
149
150 /*
151  * buffer cache structure.
152  */
153 struct bufarea {
154         TAILQ_ENTRY(bufarea) b_list;            /* LRU buffer queue */
155         LIST_ENTRY(bufarea) b_hash;             /* hash list */
156         ufs2_daddr_t b_bno;                     /* disk block number */
157         int b_size;                             /* size of I/O */
158         int b_errs;                             /* I/O error */
159         int b_flags;                            /* B_ flags below */
160         int b_type;                             /* BT_ type below */
161         int b_refcnt;                           /* ref count of users */
162         int b_index;                            /* for BT_LEVEL, ptr index */
163                                                 /* for BT_INODES, first inum */
164         union {
165                 char *b_buf;                    /* buffer space */
166                 ufs1_daddr_t *b_indir1;         /* UFS1 indirect block */
167                 ufs2_daddr_t *b_indir2;         /* UFS2 indirect block */
168                 struct fs *b_fs;                /* super block */
169                 struct cg *b_cg;                /* cylinder group */
170                 struct ufs1_dinode *b_dinode1;  /* UFS1 inode block */
171                 struct ufs2_dinode *b_dinode2;  /* UFS2 inode block */
172         } b_un;
173 };
174
175 #define IBLK(bp, i) \
176         ((sblock.fs_magic == FS_UFS1_MAGIC) ? \
177         (bp)->b_un.b_indir1[i] : (bp)->b_un.b_indir2[i])
178
179 #define IBLK_SET(bp, i, val) do { \
180         if (sblock.fs_magic == FS_UFS1_MAGIC) \
181                 (bp)->b_un.b_indir1[i] = (val); \
182         else \
183                 (bp)->b_un.b_indir2[i] = (val); \
184         } while (0)
185
186 /*
187  * Buffer flags
188  */
189 #define B_DIRTY         0x00000001      /* Buffer is dirty */
190 /*
191  * Type of data in buffer
192  */
193 #define BT_UNKNOWN       0      /* Buffer type is unknown */
194 #define BT_SUPERBLK      1      /* Buffer holds a superblock */
195 #define BT_CYLGRP        2      /* Buffer holds a cylinder group map */
196 #define BT_LEVEL1        3      /* Buffer holds single level indirect */
197 #define BT_LEVEL2        4      /* Buffer holds double level indirect */
198 #define BT_LEVEL3        5      /* Buffer holds triple level indirect */
199 #define BT_EXTATTR       6      /* Buffer holds external attribute data */
200 #define BT_INODES        7      /* Buffer holds inodes */
201 #define BT_DIRDATA       8      /* Buffer holds directory data */
202 #define BT_DATA          9      /* Buffer holds user data */
203 #define BT_EMPTY        10      /* Buffer allocated but not filled */
204 #define BT_NUMBUFTYPES  11
205 #define BT_NAMES {                      \
206         "unknown",                      \
207         "Superblock",                   \
208         "Cylinder Group",               \
209         "Single Level Indirect",        \
210         "Double Level Indirect",        \
211         "Triple Level Indirect",        \
212         "External Attribute",           \
213         "Inode Block",                  \
214         "Directory Contents",           \
215         "User Data",                    \
216         "Allocated but not filled" }
217 extern char *buftype[];
218 #define BT_BUFTYPE(type) \
219         type < BT_NUMBUFTYPES ? buftype[type] : buftype[BT_UNKNOWN]
220 extern long readcnt[BT_NUMBUFTYPES];
221 extern long totalreadcnt[BT_NUMBUFTYPES];
222 extern struct timespec readtime[BT_NUMBUFTYPES];
223 extern struct timespec totalreadtime[BT_NUMBUFTYPES];
224 extern struct timespec startprog;
225
226 extern struct bufarea *icachebp;        /* inode cache buffer */
227 extern struct bufarea sblk;             /* file system superblock */
228 extern struct bufarea *pdirbp;          /* current directory contents */
229 extern int sujrecovery;                 /* 1 => doing check using the journal */
230
231 #define dirty(bp) do { \
232         if (fswritefd < 0) \
233                 pfatal("SETTING DIRTY FLAG IN READ_ONLY MODE\n"); \
234         else \
235                 (bp)->b_flags |= B_DIRTY; \
236 } while (0)
237 #define initbarea(bp, type) do { \
238         (bp)->b_bno = (ufs2_daddr_t)-1; \
239         (bp)->b_flags = 0; \
240         (bp)->b_refcnt = 0; \
241         (bp)->b_index = 0; \
242         (bp)->b_type = type; \
243 } while (0)
244
245 #define sbdirty()       dirty(&sblk)
246 #define sblock          (*sblk.b_un.b_fs)
247
248 enum fixstate {DONTKNOW, NOFIX, FIX, IGNORE};
249 extern ino_t cursnapshot;
250
251 struct inodesc {
252         enum fixstate id_fix;   /* policy on fixing errors */
253         int (*id_func)(struct inodesc *);
254                                 /* function to be applied to blocks of inode */
255         struct bufarea *id_bp;  /* ckinode: buffer with indirect pointers */
256         union dinode *id_dp;    /* ckinode: dinode being traversed */
257         ino_t id_number;        /* inode number described */
258         ino_t id_parent;        /* for DATA nodes, their parent */
259         ufs_lbn_t id_lbn;       /* logical block number of current block */
260         ufs2_daddr_t id_blkno;  /* current block number being examined */
261         int id_level;           /* level of indirection of this block */
262         int id_numfrags;        /* number of frags contained in block */
263         ufs_lbn_t id_lballoc;   /* pass1: last LBN that is allocated */
264         off_t id_filesize;      /* for DATA nodes, the size of the directory */
265         ufs2_daddr_t id_entryno;/* for DATA nodes, current entry number */
266         int id_loc;             /* for DATA nodes, current location in dir */
267         struct direct *id_dirp; /* for DATA nodes, ptr to current entry */
268         char *id_name;          /* for DATA nodes, name to find or enter */
269         char id_type;           /* type of descriptor, DATA, ADDR, or SNAP */
270 };
271 /* file types */
272 #define DATA    1       /* a directory */
273 #define SNAP    2       /* a snapshot */
274 #define ADDR    3       /* anything but a directory or a snapshot */
275
276 /*
277  * Linked list of duplicate blocks.
278  *
279  * The list is composed of two parts. The first part of the
280  * list (from duplist through the node pointed to by muldup)
281  * contains a single copy of each duplicate block that has been
282  * found. The second part of the list (from muldup to the end)
283  * contains duplicate blocks that have been found more than once.
284  * To check if a block has been found as a duplicate it is only
285  * necessary to search from duplist through muldup. To find the
286  * total number of times that a block has been found as a duplicate
287  * the entire list must be searched for occurrences of the block
288  * in question. The following diagram shows a sample list where
289  * w (found twice), x (found once), y (found three times), and z
290  * (found once) are duplicate block numbers:
291  *
292  *    w -> y -> x -> z -> y -> w -> y
293  *    ^              ^
294  *    |              |
295  * duplist        muldup
296  */
297 struct dups {
298         struct dups *next;
299         ufs2_daddr_t dup;
300 };
301 extern struct dups *duplist;            /* head of dup list */
302 extern struct dups *muldup;             /* end of unique duplicate dup block numbers */
303
304 /*
305  * Inode cache data structures.
306  */
307 extern struct inoinfo {
308         struct  inoinfo *i_nexthash;    /* next entry in hash chain */
309         ino_t   i_number;               /* inode number of this entry */
310         ino_t   i_parent;               /* inode number of parent */
311         ino_t   i_dotdot;               /* inode number of `..' */
312         size_t  i_isize;                /* size of inode */
313         u_int   i_numblks;              /* size of block array in bytes */
314         ufs2_daddr_t i_blks[1];         /* actually longer */
315 } **inphead, **inpsort;
316 extern long dirhash, inplast;
317 extern unsigned long numdirs, listmax;
318 extern long countdirs;          /* number of directories we actually found */
319
320 #define MIBSIZE 3               /* size of fsck sysctl MIBs */
321 extern int      adjrefcnt[MIBSIZE];     /* MIB command to adjust inode reference cnt */
322 extern int      adjblkcnt[MIBSIZE];     /* MIB command to adjust inode block count */
323 extern int      setsize[MIBSIZE];       /* MIB command to set inode size */
324 extern int      adjndir[MIBSIZE];       /* MIB command to adjust number of directories */
325 extern int      adjnbfree[MIBSIZE];     /* MIB command to adjust number of free blocks */
326 extern int      adjnifree[MIBSIZE];     /* MIB command to adjust number of free inodes */
327 extern int      adjnffree[MIBSIZE];     /* MIB command to adjust number of free frags */
328 extern int      adjnumclusters[MIBSIZE];        /* MIB command to adjust number of free clusters */
329 extern int      freefiles[MIBSIZE];     /* MIB command to free a set of files */
330 extern int      freedirs[MIBSIZE];      /* MIB command to free a set of directories */
331 extern int      freeblks[MIBSIZE];      /* MIB command to free a set of data blocks */
332 extern struct   fsck_cmd cmd;           /* sysctl file system update commands */
333 extern char     snapname[BUFSIZ];       /* when doing snapshots, the name of the file */
334 extern char     *cdevname;              /* name of device being checked */
335 extern long     dev_bsize;              /* computed value of DEV_BSIZE */
336 extern long     secsize;                /* actual disk sector size */
337 extern u_int    real_dev_bsize;         /* actual disk sector size, not overridden */
338 extern char     nflag;                  /* assume a no response */
339 extern char     yflag;                  /* assume a yes response */
340 extern int      bkgrdflag;              /* use a snapshot to run on an active system */
341 extern off_t    bflag;                  /* location of alternate super block */
342 extern int      debug;                  /* output debugging info */
343 extern int      Eflag;                  /* delete empty data blocks */
344 extern int      Zflag;                  /* zero empty data blocks */
345 extern int      zflag;                  /* zero unused directory space */
346 extern int      inoopt;                 /* trim out unused inodes */
347 extern char     ckclean;                /* only do work if not cleanly unmounted */
348 extern int      cvtlevel;               /* convert to newer file system format */
349 extern int      ckhashadd;              /* check hashes to be added */
350 extern int      bkgrdcheck;             /* determine if background check is possible */
351 extern int      bkgrdsumadj;            /* whether the kernel have ability to adjust superblock summary */
352 extern char     usedsoftdep;            /* just fix soft dependency inconsistencies */
353 extern char     preen;                  /* just fix normal inconsistencies */
354 extern char     rerun;                  /* rerun fsck. Only used in non-preen mode */
355 extern int      returntosingle;         /* 1 => return to single user mode on exit */
356 extern char     resolved;               /* cleared if unresolved changes => not clean */
357 extern char     havesb;                 /* superblock has been read */
358 extern char     skipclean;              /* skip clean file systems if preening */
359 extern int      fsmodified;             /* 1 => write done to file system */
360 extern int      fsreadfd;               /* file descriptor for reading file system */
361 extern int      fswritefd;              /* file descriptor for writing file system */
362 extern int      surrender;              /* Give up if reads fail */
363 extern int      wantrestart;            /* Restart fsck on early termination */
364
365 extern ufs2_daddr_t maxfsblock; /* number of blocks in the file system */
366 extern char     *blockmap;              /* ptr to primary blk allocation map */
367 extern ino_t    maxino;                 /* number of inodes in file system */
368
369 extern ino_t    lfdir;                  /* lost & found directory inode number */
370 extern const char *lfname;              /* lost & found directory name */
371 extern int      lfmode;                 /* lost & found directory creation mode */
372
373 extern ufs2_daddr_t n_blks;             /* number of blocks in use */
374 extern ino_t n_files;                   /* number of files in use */
375
376 extern volatile sig_atomic_t    got_siginfo;    /* received a SIGINFO */
377 extern volatile sig_atomic_t    got_sigalarm;   /* received a SIGALRM */
378
379 #define clearinode(dp) \
380         if (sblock.fs_magic == FS_UFS1_MAGIC) { \
381                 (dp)->dp1 = zino.dp1; \
382         } else { \
383                 (dp)->dp2 = zino.dp2; \
384         }
385 extern union dinode zino;
386
387 #define setbmap(blkno)  setbit(blockmap, blkno)
388 #define testbmap(blkno) isset(blockmap, blkno)
389 #define clrbmap(blkno)  clrbit(blockmap, blkno)
390
391 #define STOP    0x01
392 #define SKIP    0x02
393 #define KEEPON  0x04
394 #define ALTERED 0x08
395 #define FOUND   0x10
396
397 #define EEXIT   8               /* Standard error exit. */
398 #define ERERUN  16              /* fsck needs to be re-run. */
399 #define ERESTART -1
400
401 int flushentry(void);
402 /*
403  * Wrapper for malloc() that flushes the cylinder group cache to try 
404  * to get space.
405  */
406 static inline void*
407 Malloc(size_t size)
408 {
409         void *retval;
410
411         while ((retval = malloc(size)) == NULL)
412                 if (flushentry() == 0)
413                         break;
414         return (retval);
415 }
416
417 /*
418  * Wrapper for calloc() that flushes the cylinder group cache to try 
419  * to get space.
420  */
421 static inline void*
422 Calloc(size_t cnt, size_t size)
423 {
424         void *retval;
425
426         while ((retval = calloc(cnt, size)) == NULL)
427                 if (flushentry() == 0)
428                         break;
429         return (retval);
430 }
431
432 struct fstab;
433
434
435 void            adjust(struct inodesc *, int lcnt);
436 void            alarmhandler(int sig);
437 ufs2_daddr_t    allocblk(long frags);
438 ino_t           allocdir(ino_t parent, ino_t request, int mode);
439 ino_t           allocino(ino_t request, int type);
440 void            blkerror(ino_t ino, const char *type, ufs2_daddr_t blk);
441 char           *blockcheck(char *name);
442 int             blread(int fd, char *buf, ufs2_daddr_t blk, long size);
443 void            bufinit(void);
444 void            blwrite(int fd, char *buf, ufs2_daddr_t blk, ssize_t size);
445 void            blerase(int fd, ufs2_daddr_t blk, long size);
446 void            blzero(int fd, ufs2_daddr_t blk, long size);
447 void            brelse(struct bufarea *);
448 void            cacheino(union dinode *dp, ino_t inumber);
449 void            catch(int);
450 void            catchquit(int);
451 void            cgdirty(struct bufarea *);
452 struct bufarea *cglookup(int cg);
453 int             changeino(ino_t dir, const char *name, ino_t newnum);
454 int             check_cgmagic(int cg, struct bufarea *cgbp, int requestrebuild);
455 int             chkrange(ufs2_daddr_t blk, int cnt);
456 void            ckfini(int markclean);
457 int             ckinode(union dinode *dp, struct inodesc *);
458 void            clri(struct inodesc *, const char *type, int flag);
459 int             clearentry(struct inodesc *);
460 void            direrror(ino_t ino, const char *errmesg);
461 int             dirscan(struct inodesc *);
462 int             dofix(struct inodesc *, const char *msg);
463 int             eascan(struct inodesc *, struct ufs2_dinode *dp);
464 void            fileerror(ino_t cwd, ino_t ino, const char *errmesg);
465 void            finalIOstats(void);
466 int             findino(struct inodesc *);
467 int             findname(struct inodesc *);
468 void            flush(int fd, struct bufarea *bp);
469 int             freeblock(struct inodesc *);
470 void            freeino(ino_t ino);
471 void            freeinodebuf(void);
472 void            fsutilinit(void);
473 int             ftypeok(union dinode *dp);
474 void            getblk(struct bufarea *bp, ufs2_daddr_t blk, long size);
475 struct bufarea *getdatablk(ufs2_daddr_t blkno, long size, int type);
476 struct inoinfo *getinoinfo(ino_t inumber);
477 union dinode   *getnextinode(ino_t inumber, int rebuildcg);
478 void            getpathname(char *namebuf, ino_t curdir, ino_t ino);
479 void            ginode(ino_t, struct inode *);
480 void            infohandler(int sig);
481 void            irelse(struct inode *);
482 ufs2_daddr_t    ino_blkatoff(union dinode *, ino_t, ufs_lbn_t, int *,
483                     struct bufarea **);
484 void            inocleanup(void);
485 void            inodirty(struct inode *);
486 struct inostat *inoinfo(ino_t inum);
487 void            IOstats(char *what);
488 int             linkup(ino_t orphan, ino_t parentdir, char *name);
489 int             makeentry(ino_t parent, ino_t ino, const char *name);
490 void            panic(const char *fmt, ...) __printflike(1, 2);
491 void            pass1(void);
492 void            pass1b(void);
493 int             pass1check(struct inodesc *);
494 void            pass2(void);
495 void            pass3(void);
496 void            pass4(void);
497 void            pass5(void);
498 void            pfatal(const char *fmt, ...) __printflike(1, 2);
499 void            propagate(void);
500 void            prtinode(struct inode *);
501 void            pwarn(const char *fmt, ...) __printflike(1, 2);
502 int             readsb(int listerr);
503 int             reply(const char *question);
504 void            rwerror(const char *mesg, ufs2_daddr_t blk);
505 void            sblock_init(void);
506 void            setinodebuf(int, ino_t);
507 int             setup(char *dev);
508 void            gjournal_check(const char *filesys);
509 int             suj_check(const char *filesys);
510 void            update_maps(struct cg *, struct cg*, int);
511 void            fsckinit(void);
512
513 #endif  /* !_FSCK_H_ */