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