1185222Ssam/*	$NetBSD: ffs_extern.h,v 1.6 2003/08/07 11:25:33 agc Exp $	*/
2185222Ssam/* From: NetBSD: ffs_extern.h,v 1.19 2001/08/17 02:18:48 lukem Exp */
3185222Ssam
4185222Ssam/*-
5185222Ssam * Copyright (c) 1991, 1993, 1994
6185222Ssam *	The Regents of the University of California.  All rights reserved.
7185222Ssam *
8185222Ssam * Redistribution and use in source and binary forms, with or without
9185222Ssam * modification, are permitted provided that the following conditions
10185222Ssam * are met:
11185222Ssam * 1. Redistributions of source code must retain the above copyright
12185222Ssam *    notice, this list of conditions and the following disclaimer.
13185222Ssam * 2. Redistributions in binary form must reproduce the above copyright
14185222Ssam *    notice, this list of conditions and the following disclaimer in the
15185222Ssam *    documentation and/or other materials provided with the distribution.
16185222Ssam * 3. Neither the name of the University nor the names of its contributors
17185222Ssam *    may be used to endorse or promote products derived from this software
18185222Ssam *    without specific prior written permission.
19185222Ssam *
20185222Ssam * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21185222Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22185222Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23185222Ssam * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24185222Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25185222Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26185222Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27185222Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28185222Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29185222Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30185222Ssam * SUCH DAMAGE.
31185222Ssam *
32185222Ssam *	@(#)ffs_extern.h	8.6 (Berkeley) 3/30/95
33186334Ssam * $FreeBSD: releng/10.2/usr.sbin/makefs/ffs/ffs_extern.h 239359 2012-08-17 17:45:27Z mjg $
34185222Ssam */
35185222Ssam
36185222Ssam#include "ffs/buf.h"
37185222Ssam
38228733Sedstruct inode;
39228733Sed
40185222Ssam/*
41185222Ssam * Structure used to pass around logical block paths generated by
42185222Ssam * ufs_getlbns and used by truncate and bmap code.
43185222Ssam */
44185222Ssamstruct indir {
45185222Ssam	daddr_t in_lbn;		/* Logical block number. */
46185222Ssam	int	in_off;			/* Offset in buffer. */
47185222Ssam};
48185222Ssam
49185222Ssam	/* ffs.c */
50228733Sed_Noreturn void panic(const char *, ...) __printflike(1, 2);
51185222Ssam
52185222Ssam	/* ffs_alloc.c */
53185222Ssamint ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *);
54185222Ssamdaddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *);
55185222Ssamdaddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *);
56185222Ssamvoid ffs_blkfree(struct inode *, daddr_t, long);
57185222Ssamvoid ffs_clusteracct(struct fs *, struct cg *, int32_t, int);
58185222Ssam
59185222Ssam	/* ffs_balloc.c */
60185222Ssamint ffs_balloc(struct inode *, off_t, int, struct buf **);
61185222Ssam
62185222Ssam	/* ffs_bswap.c */
63185222Ssamvoid ffs_sb_swap(struct fs*, struct fs *);
64185222Ssamvoid ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *);
65185222Ssamvoid ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *);
66185222Ssamvoid ffs_csum_swap(struct csum *, struct csum *, int);
67185222Ssamvoid ffs_cg_swap(struct cg *, struct cg *, struct fs *);
68185222Ssam
69185222Ssam	/* ffs_subr.c */
70185222Ssamvoid ffs_fragacct(struct fs *, int, int32_t[], int, int);
71185222Ssamint ffs_isblock(struct fs *, u_char *, int32_t);
72185222Ssamint ffs_isfreeblock(struct fs *, u_char *, int32_t);
73185222Ssamvoid ffs_clrblock(struct fs *, u_char *, int32_t);
74185222Ssamvoid ffs_setblock(struct fs *, u_char *, int32_t);
75185222Ssam
76185222Ssam	/* ufs_bmap.c */
77185222Ssamint ufs_getlbns(struct inode *, daddr_t, struct indir *, int *);
78