1*b35c7f73Snatano /* $OpenBSD: ffs_extern.h,v 1.6 2016/10/22 17:15:28 natano Exp $ */ 26163fc9cSnatano /* $NetBSD: ffs_extern.h,v 1.6 2003/08/07 11:25:33 agc Exp $ */ 36163fc9cSnatano /* From: NetBSD: ffs_extern.h,v 1.19 2001/08/17 02:18:48 lukem Exp */ 46163fc9cSnatano 56163fc9cSnatano /*- 66163fc9cSnatano * Copyright (c) 1991, 1993, 1994 76163fc9cSnatano * The Regents of the University of California. All rights reserved. 86163fc9cSnatano * 96163fc9cSnatano * Redistribution and use in source and binary forms, with or without 106163fc9cSnatano * modification, are permitted provided that the following conditions 116163fc9cSnatano * are met: 126163fc9cSnatano * 1. Redistributions of source code must retain the above copyright 136163fc9cSnatano * notice, this list of conditions and the following disclaimer. 146163fc9cSnatano * 2. Redistributions in binary form must reproduce the above copyright 156163fc9cSnatano * notice, this list of conditions and the following disclaimer in the 166163fc9cSnatano * documentation and/or other materials provided with the distribution. 176163fc9cSnatano * 3. Neither the name of the University nor the names of its contributors 186163fc9cSnatano * may be used to endorse or promote products derived from this software 196163fc9cSnatano * without specific prior written permission. 206163fc9cSnatano * 216163fc9cSnatano * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 226163fc9cSnatano * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 236163fc9cSnatano * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 246163fc9cSnatano * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 256163fc9cSnatano * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 266163fc9cSnatano * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 276163fc9cSnatano * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 286163fc9cSnatano * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 296163fc9cSnatano * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 306163fc9cSnatano * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 316163fc9cSnatano * SUCH DAMAGE. 326163fc9cSnatano * 336163fc9cSnatano * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 346163fc9cSnatano */ 356163fc9cSnatano 366163fc9cSnatano #include "ffs/buf.h" 376163fc9cSnatano 386163fc9cSnatano /* 396163fc9cSnatano * Structure used to pass around logical block paths generated by 406163fc9cSnatano * ufs_getlbns and used by truncate and bmap code. 416163fc9cSnatano */ 426163fc9cSnatano struct indir { 436163fc9cSnatano daddr_t in_lbn; /* Logical block number. */ 446163fc9cSnatano int in_off; /* Offset in buffer. */ 456163fc9cSnatano int in_exists; /* Flag if the block exists. */ 466163fc9cSnatano }; 476163fc9cSnatano 486163fc9cSnatano /* ffs_alloc.c */ 491e3d247cSnatano struct inode; 506163fc9cSnatano int ffs_alloc(struct inode *, daddr_t, daddr_t, int, daddr_t *); 516163fc9cSnatano daddr_t ffs_blkpref_ufs1(struct inode *, daddr_t, int, int32_t *); 526163fc9cSnatano daddr_t ffs_blkpref_ufs2(struct inode *, daddr_t, int, int64_t *); 536163fc9cSnatano void ffs_clusteracct(struct fs *, struct cg *, int32_t, int); 546163fc9cSnatano 556163fc9cSnatano /* ffs_balloc.c */ 564af638d7Stedu int ffs_balloc(struct inode *, off_t, int, struct mkfsbuf **); 576163fc9cSnatano 586163fc9cSnatano /* ffs_subr.c */ 596163fc9cSnatano int ffs_isblock(struct fs *, u_char *, int32_t); 606163fc9cSnatano void ffs_clrblock(struct fs *, u_char *, int32_t); 616163fc9cSnatano void ffs_setblock(struct fs *, u_char *, int32_t); 626163fc9cSnatano 636163fc9cSnatano /* ufs_bmap.c */ 646163fc9cSnatano int ufs_getlbns(struct inode *, daddr_t, struct indir *, int *); 65