xref: /netbsd-src/usr.sbin/makefs/ffs/ffs_extern.h (revision f298a94b738ab130659689d3f04c17f6991b6de5)
1*f298a94bSchs /*	$NetBSD: ffs_extern.h,v 1.9 2023/01/07 19:41:30 chs Exp $	*/
26325773eSlukem /* From: NetBSD: ffs_extern.h,v 1.19 2001/08/17 02:18:48 lukem Exp */
36325773eSlukem 
46325773eSlukem /*-
56325773eSlukem  * Copyright (c) 1991, 1993, 1994
66325773eSlukem  *	The Regents of the University of California.  All rights reserved.
76325773eSlukem  *
86325773eSlukem  * Redistribution and use in source and binary forms, with or without
96325773eSlukem  * modification, are permitted provided that the following conditions
106325773eSlukem  * are met:
116325773eSlukem  * 1. Redistributions of source code must retain the above copyright
126325773eSlukem  *    notice, this list of conditions and the following disclaimer.
136325773eSlukem  * 2. Redistributions in binary form must reproduce the above copyright
146325773eSlukem  *    notice, this list of conditions and the following disclaimer in the
156325773eSlukem  *    documentation and/or other materials provided with the distribution.
16326b2259Sagc  * 3. Neither the name of the University nor the names of its contributors
176325773eSlukem  *    may be used to endorse or promote products derived from this software
186325773eSlukem  *    without specific prior written permission.
196325773eSlukem  *
206325773eSlukem  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
216325773eSlukem  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
226325773eSlukem  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
236325773eSlukem  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
246325773eSlukem  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
256325773eSlukem  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
266325773eSlukem  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
276325773eSlukem  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
286325773eSlukem  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
296325773eSlukem  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
306325773eSlukem  * SUCH DAMAGE.
316325773eSlukem  *
326325773eSlukem  *	@(#)ffs_extern.h	8.6 (Berkeley) 3/30/95
336325773eSlukem  */
346325773eSlukem 
356325773eSlukem #include "ffs/buf.h"
366325773eSlukem 
376325773eSlukem /*
386325773eSlukem  * Structure used to pass around logical block paths generated by
396325773eSlukem  * ufs_getlbns and used by truncate and bmap code.
406325773eSlukem  */
416325773eSlukem struct indir {
42a3ff3a30Sfvdl 	daddr_t in_lbn;		/* Logical block number. */
436325773eSlukem 	int	in_off;			/* Offset in buffer. */
446325773eSlukem 	int	in_exists;		/* Flag if the block exists. */
456325773eSlukem };
466325773eSlukem 
476325773eSlukem 	/* ffs.c */
486325773eSlukem void panic(const char *, ...)
496325773eSlukem     __attribute__((__noreturn__,__format__(__printf__,1,2)));
506325773eSlukem 
516325773eSlukem 	/* ffs_alloc.c */
52a3ff3a30Sfvdl int ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *);
5342614ed3Sfvdl daddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *);
5442614ed3Sfvdl daddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *);
55a3ff3a30Sfvdl void ffs_blkfree(struct inode *, daddr_t, long);
5642614ed3Sfvdl void ffs_clusteracct(struct fs *, struct cg *, int32_t, int);
576325773eSlukem 
586325773eSlukem 	/* ffs_balloc.c */
596325773eSlukem int ffs_balloc(struct inode *, off_t, int, struct buf **);
606325773eSlukem 
616325773eSlukem 	/* ffs_bswap.c */
620368fad2Skre void ffs_sb_swap(const struct fs*, struct fs *);
6342614ed3Sfvdl void ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *);
6442614ed3Sfvdl void ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *);
656325773eSlukem void ffs_csum_swap(struct csum *, struct csum *, int);
6642614ed3Sfvdl void ffs_cg_swap(struct cg *, struct cg *, struct fs *);
676325773eSlukem 
686325773eSlukem 	/* ffs_subr.c */
69*f298a94bSchs void ffs_fragacct(struct fs *, int, uint32_t[], int, int);
70af662325Stsutsui int ffs_isblock(struct fs *, u_char *, int32_t);
71af662325Stsutsui int ffs_isfreeblock(struct fs *, u_char *, int32_t);
72af662325Stsutsui void ffs_clrblock(struct fs *, u_char *, int32_t);
73af662325Stsutsui void ffs_setblock(struct fs *, u_char *, int32_t);
746325773eSlukem 
756325773eSlukem 	/* ufs_bmap.c */
76a3ff3a30Sfvdl int ufs_getlbns(struct inode *, daddr_t, struct indir *, int *);
77