extern.h revision 1.16 1 /* $NetBSD: extern.h,v 1.16 2020/04/03 19:36:33 joerg Exp $ */
2
3 /*
4 * Copyright (c) 1994 James A. Jegers
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27 #include <stdarg.h>
28 #include "vnode.h"
29
30 struct inodesc;
31 union lfs_dinode;
32 struct inode;
33 struct lfs;
34 union lfs_dirheader;
35
36 void adjust(struct inodesc *, short);
37 int allocblk(long);
38 int allocdir(ino_t, ino_t, int);
39 void blkerror(ino_t, const char *, daddr_t);
40 void cacheino(union lfs_dinode *, ino_t);
41 int changeino(ino_t, const char *, ino_t);
42 u_int32_t cksum(void *, size_t);
43 struct fstab;
44 void checkinode(ino_t, struct inodesc *);
45 int chkrange(daddr_t, int);
46 void ckfini(int);
47 int ckinode(union lfs_dinode *, struct inodesc *);
48 void clri(struct inodesc *, const char *, int);
49 int dircheck(struct inodesc *, union lfs_dirheader *);
50 void direrror(ino_t, const char *);
51 int dirscan(struct inodesc *);
52 int dofix(struct inodesc *, const char *);
53 void fileerror(ino_t, ino_t, const char *);
54 int findino(struct inodesc *);
55 int findname(struct inodesc *);
56 void freeblk(daddr_t, long);
57 void freeino(ino_t);
58 void freeinodebuf(void);
59 int ftypeok(union lfs_dinode *);
60 void getpathname(char *, size_t, ino_t, ino_t);
61 void inocleanup(void);
62 void inodirty(struct inode *);
63 int linkup(ino_t, ino_t);
64 u_int32_t lfs_sb_cksum(struct lfs *);
65 int makeentry(ino_t, ino_t, const char *);
66 void pass0(void);
67 void pass1(void);
68 void pass1b(void);
69 void pass2(void);
70 void pass3(void);
71 void pass4(void);
72 int pass1check(struct inodesc *);
73 int pass4check(struct inodesc *);
74 void pass5(void);
75 void pass6(void);
76 int pass6check(struct inodesc *);
77 void pinode(ino_t);
78 void propagate(void);
79 void pwarn(const char *, ...);
80 int reply(const char *);
81 void resetinodebuf(void);
82 int setup(const char *);
83
84 extern struct uvnodelst vnodelist;
85 extern struct uvnodelst getvnodelist[VNODE_HASH_MAX];
86 extern int nvnodes;
87 extern void (*panic_func)(int, const char *, va_list);
88 extern int fake_cleanseg;
89 extern off_t locked_queue_bytes;
90 extern int locked_queue_count;
91 extern int preen;
92 extern time_t write_time;
93