xref: /netbsd-src/sbin/fsck_ffs/extern.h (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1 /*	$NetBSD: extern.h,v 1.27 2011/06/09 19:57:52 christos 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 void		adjust(struct inodesc *, int);
28 daddr_t		allocblk(long);
29 ino_t		allocdir(ino_t, ino_t, int);
30 ino_t		allocino(ino_t, int);
31 void		blkerror(ino_t, const char *, daddr_t);
32 int		bread(int, char *, daddr_t, long);
33 void		bufinit(void);
34 void		bwrite(int, char *, daddr_t, long);
35 void		cacheino(union dinode *, ino_t);
36 int		changeino(ino_t, const char *, ino_t);
37 int		chkrange(daddr_t, int);
38 void		ckfini(int);
39 int		ckinode(union dinode *, struct inodesc *);
40 int		clearentry(struct inodesc *);
41 void		clri(struct inodesc *, const char *, int);
42 int		cmpsblks(const struct fs *, struct fs *);
43 int		cmpsblks42(const struct fs *, struct fs *);
44 int		cmpsblks44(const struct fs *, struct fs *);
45 union		dinode * getnextinode(ino_t);
46 void		direrror(ino_t, const char *);
47 int		dirscan(struct inodesc *);
48 int		dofix(struct inodesc *, const char *);
49 void		fileerror(ino_t, ino_t, const char *);
50 int		findino(struct inodesc *);
51 int		findname(struct inodesc *);
52 void		flush(int, struct bufarea *);
53 void		freeblk(daddr_t, long);
54 void		freeino(ino_t);
55 void		freeinodebuf(void);
56 int		ftypeok(union dinode *);
57 void		getblk(struct bufarea *, daddr_t, long);
58 struct bufarea *getdatablk(daddr_t, long);
59 struct inoinfo *getinoinfo(ino_t);
60 union dinode  *ginode(ino_t);
61 void		getpathname(char *, size_t, ino_t, ino_t);
62 void		infohandler(int sig);
63 void		inocleanup(void);
64 void		inodirty(void);
65 struct inostat *inoinfo(ino_t);
66 int		linkup(ino_t, ino_t, char *);
67 int		makeentry(ino_t, ino_t, const char *);
68 void		pass1(void);
69 void		pass1b(void);
70 int		pass1check(struct inodesc *);
71 void		pass2(void);
72 void		pass3(void);
73 void		pass4(void);
74 int		pass4check(struct inodesc *);
75 void		pass5(void);
76 void		pass6(void);
77 void		pinode(ino_t);
78 void		propagate(ino_t);
79 int		reply(const char *);
80 void		setinodebuf(ino_t);
81 int		setup(const char *, const char *);
82 ssize_t		readblk(union dinode *, off_t, struct bufarea **);
83 struct bufarea *expandfile(union dinode *);
84 
85 struct uquot *	find_uquot(struct uquot_hash *, uint32_t, int);
86 void		remove_uquot(struct uquot_hash *,struct uquot *);
87 void		update_uquot(ino_t, uid_t, gid_t, int64_t, int64_t);
88 int		is_quota_inode(ino_t);
89 
90 
91 int		check_wapbl(void);
92 void		replay_wapbl(void);
93 void		cleanup_wapbl(void);
94 int		read_wapbl(char *, long, daddr_t);
95 int		is_journal_inode(ino_t);
96 
97 void		quota2_create_inode(struct fs *, int);
98 int		quota2_check_inode(int);
99 int		quota2_check_usage(int);
100 int		quota2_check_doquota(void);
101 int		quota2_alloc_quota(union dinode *, struct bufarea *,
102 					uid_t, uint64_t, uint64_t);
103 
104 void		swap_cg(struct cg *, struct cg *);
105 void		copyback_cg(struct bufarea *);
106 void		sb_oldfscompat_write(struct fs *, struct fs *);
107 void		sb_oldfscompat_read(struct fs *, struct fs **);
108