ffs_extern.h revision 185222
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 33185222Ssam */ 34185222Ssam 35185222Ssam#include "ffs/buf.h" 36185222Ssam 37185222Ssam/* 38185222Ssam * Structure used to pass around logical block paths generated by 39185222Ssam * ufs_getlbns and used by truncate and bmap code. 40185222Ssam */ 41185222Ssamstruct indir { 42185222Ssam daddr_t in_lbn; /* Logical block number. */ 43185222Ssam int in_off; /* Offset in buffer. */ 44185222Ssam int in_exists; /* Flag if the block exists. */ 45185222Ssam}; 46185222Ssam 47185222Ssam /* ffs.c */ 48185222Ssamvoid panic(const char *, ...) 49185222Ssam __attribute__((__noreturn__,__format__(__printf__,1,2))); 50185222Ssam 51185222Ssam /* ffs_alloc.c */ 52185222Ssamint ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *); 53185222Ssamdaddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *); 54185222Ssamdaddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *); 55185222Ssamvoid ffs_blkfree(struct inode *, daddr_t, long); 56185222Ssamvoid ffs_clusteracct(struct fs *, struct cg *, int32_t, int); 57185222Ssam 58185222Ssam /* ffs_balloc.c */ 59185222Ssamint ffs_balloc(struct inode *, off_t, int, struct buf **); 60185222Ssam 61185222Ssam /* ffs_bswap.c */ 62185222Ssamvoid ffs_sb_swap(struct fs*, struct fs *); 63185222Ssamvoid ffs_dinode1_swap(struct ufs1_dinode *, struct ufs1_dinode *); 64185222Ssamvoid ffs_dinode2_swap(struct ufs2_dinode *, struct ufs2_dinode *); 65185222Ssamvoid ffs_csum_swap(struct csum *, struct csum *, int); 66185222Ssamvoid ffs_cg_swap(struct cg *, struct cg *, struct fs *); 67185222Ssam 68185222Ssam /* ffs_subr.c */ 69185222Ssamvoid ffs_fragacct(struct fs *, int, int32_t[], int, int); 70185222Ssamint ffs_isblock(struct fs *, u_char *, int32_t); 71185222Ssamint ffs_isfreeblock(struct fs *, u_char *, int32_t); 72185222Ssamvoid ffs_clrblock(struct fs *, u_char *, int32_t); 73185222Ssamvoid ffs_setblock(struct fs *, u_char *, int32_t); 74185222Ssam 75185222Ssam /* ufs_bmap.c */ 76185222Ssamint ufs_getlbns(struct inode *, daddr_t, struct indir *, int *); 77