11.9Schs/*	$NetBSD: ffs_extern.h,v 1.9 2023/01/07 19:41:30 chs Exp $	*/
21.1Slukem/* From: NetBSD: ffs_extern.h,v 1.19 2001/08/17 02:18:48 lukem Exp */
31.1Slukem
41.1Slukem/*-
51.1Slukem * Copyright (c) 1991, 1993, 1994
61.1Slukem *	The Regents of the University of California.  All rights reserved.
71.1Slukem *
81.1Slukem * Redistribution and use in source and binary forms, with or without
91.1Slukem * modification, are permitted provided that the following conditions
101.1Slukem * are met:
111.1Slukem * 1. Redistributions of source code must retain the above copyright
121.1Slukem *    notice, this list of conditions and the following disclaimer.
131.1Slukem * 2. Redistributions in binary form must reproduce the above copyright
141.1Slukem *    notice, this list of conditions and the following disclaimer in the
151.1Slukem *    documentation and/or other materials provided with the distribution.
161.6Sagc * 3. Neither the name of the University nor the names of its contributors
171.1Slukem *    may be used to endorse or promote products derived from this software
181.1Slukem *    without specific prior written permission.
191.1Slukem *
201.1Slukem * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
211.1Slukem * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221.1Slukem * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
231.1Slukem * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
241.1Slukem * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251.1Slukem * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
261.1Slukem * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
271.1Slukem * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
281.1Slukem * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
291.1Slukem * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
301.1Slukem * SUCH DAMAGE.
311.1Slukem *
321.1Slukem *	@(#)ffs_extern.h	8.6 (Berkeley) 3/30/95
331.1Slukem */
341.1Slukem
351.1Slukem#include "ffs/buf.h"
361.1Slukem
371.1Slukem/*
381.1Slukem * Structure used to pass around logical block paths generated by
391.1Slukem * ufs_getlbns and used by truncate and bmap code.
401.1Slukem */
411.1Slukemstruct indir {
421.3Sfvdl	daddr_t in_lbn;		/* Logical block number. */
431.1Slukem	int	in_off;			/* Offset in buffer. */
441.1Slukem	int	in_exists;		/* Flag if the block exists. */
451.1Slukem};
461.1Slukem
471.1Slukem	/* ffs.c */
481.1Slukemvoid panic(const char *, ...)
491.8Sriastrad    __attribute__((__noreturn__,__format__(__printf__,1,2)));
501.1Slukem
511.1Slukem	/* ffs_alloc.c */
521.3Sfvdlint ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *);
531.4Sfvdldaddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *);
541.4Sfvdldaddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *);
551.3Sfvdlvoid ffs_blkfree(struct inode *, daddr_t, long);
561.4Sfvdlvoid ffs_clusteracct(struct fs *, struct cg *, int32_t, int);
571.1Slukem
581.1Slukem	/* ffs_balloc.c */
591.1Slukemint ffs_balloc(struct inode *, off_t, int, struct buf **);
601.1Slukem
611.1Slukem	/* ffs_bswap.c */
621.7Skrevoid ffs_sb_swap(const struct fs*, struct fs *);
631.4Sfvdlvoid ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *);
641.4Sfvdlvoid ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *);
651.1Slukemvoid ffs_csum_swap(struct csum *, struct csum *, int);
661.4Sfvdlvoid ffs_cg_swap(struct cg *, struct cg *, struct fs *);
671.1Slukem
681.1Slukem	/* ffs_subr.c */
691.9Schsvoid ffs_fragacct(struct fs *, int, uint32_t[], int, int);
701.5Stsutsuiint ffs_isblock(struct fs *, u_char *, int32_t);
711.5Stsutsuiint ffs_isfreeblock(struct fs *, u_char *, int32_t);
721.5Stsutsuivoid ffs_clrblock(struct fs *, u_char *, int32_t);
731.5Stsutsuivoid ffs_setblock(struct fs *, u_char *, int32_t);
741.1Slukem
751.1Slukem	/* ufs_bmap.c */
761.3Sfvdlint ufs_getlbns(struct inode *, daddr_t, struct indir *, int *);
77