1*a74e29feSjoerg /* $NetBSD: extern.h,v 1.16 2020/04/03 19:36:33 joerg Exp $ */ 2369e9cadSperseant 3369e9cadSperseant /* 4369e9cadSperseant * Copyright (c) 1994 James A. Jegers 5369e9cadSperseant * All rights reserved. 6369e9cadSperseant * 7369e9cadSperseant * Redistribution and use in source and binary forms, with or without 8369e9cadSperseant * modification, are permitted provided that the following conditions 9369e9cadSperseant * are met: 10369e9cadSperseant * 1. Redistributions of source code must retain the above copyright 11369e9cadSperseant * notice, this list of conditions and the following disclaimer. 12369e9cadSperseant * 2. The name of the author may not be used to endorse or promote products 13369e9cadSperseant * derived from this software without specific prior written permission 14369e9cadSperseant * 15369e9cadSperseant * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16369e9cadSperseant * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17369e9cadSperseant * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18369e9cadSperseant * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19369e9cadSperseant * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20369e9cadSperseant * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21369e9cadSperseant * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22369e9cadSperseant * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23369e9cadSperseant * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24369e9cadSperseant * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25369e9cadSperseant */ 26369e9cadSperseant 27*a74e29feSjoerg #include <stdarg.h> 28*a74e29feSjoerg #include "vnode.h" 29*a74e29feSjoerg 30*a74e29feSjoerg struct inodesc; 31*a74e29feSjoerg union lfs_dinode; 32*a74e29feSjoerg struct inode; 33*a74e29feSjoerg struct lfs; 34*a74e29feSjoerg union lfs_dirheader; 35*a74e29feSjoerg 361d259671Sperseant void adjust(struct inodesc *, short); 371d259671Sperseant int allocblk(long); 381d259671Sperseant int allocdir(ino_t, ino_t, int); 39e0dd0ca2Schristos void blkerror(ino_t, const char *, daddr_t); 40b1828e0bSdholland void cacheino(union lfs_dinode *, ino_t); 41e0dd0ca2Schristos int changeino(ino_t, const char *, ino_t); 42*a74e29feSjoerg u_int32_t cksum(void *, size_t); 43369e9cadSperseant struct fstab; 44ba10361aSperseant void checkinode(ino_t, struct inodesc *); 451d259671Sperseant int chkrange(daddr_t, int); 461d259671Sperseant void ckfini(int); 47b1828e0bSdholland int ckinode(union lfs_dinode *, struct inodesc *); 48e0dd0ca2Schristos void clri(struct inodesc *, const char *, int); 49*a74e29feSjoerg int dircheck(struct inodesc *, union lfs_dirheader *); 50e0dd0ca2Schristos void direrror(ino_t, const char *); 511d259671Sperseant int dirscan(struct inodesc *); 52e0dd0ca2Schristos int dofix(struct inodesc *, const char *); 53e0dd0ca2Schristos void fileerror(ino_t, ino_t, const char *); 541d259671Sperseant int findino(struct inodesc *); 551d259671Sperseant int findname(struct inodesc *); 561d259671Sperseant void freeblk(daddr_t, long); 571d259671Sperseant void freeino(ino_t); 581d259671Sperseant void freeinodebuf(void); 59b1828e0bSdholland int ftypeok(union lfs_dinode *); 608883e1fbSitojun void getpathname(char *, size_t, ino_t, ino_t); 611d259671Sperseant void inocleanup(void); 62ba10361aSperseant void inodirty(struct inode *); 631d259671Sperseant int linkup(ino_t, ino_t); 64*a74e29feSjoerg u_int32_t lfs_sb_cksum(struct lfs *); 65e0dd0ca2Schristos int makeentry(ino_t, ino_t, const char *); 661d259671Sperseant void pass0(void); 671d259671Sperseant void pass1(void); 681d259671Sperseant void pass1b(void); 691d259671Sperseant void pass2(void); 701d259671Sperseant void pass3(void); 711d259671Sperseant void pass4(void); 721d259671Sperseant int pass1check(struct inodesc *); 731d259671Sperseant int pass4check(struct inodesc *); 741d259671Sperseant void pass5(void); 75ba10361aSperseant void pass6(void); 76ba10361aSperseant int pass6check(struct inodesc *); 771d259671Sperseant void pinode(ino_t); 781d259671Sperseant void propagate(void); 79*a74e29feSjoerg void pwarn(const char *, ...); 80e0dd0ca2Schristos int reply(const char *); 811d259671Sperseant void resetinodebuf(void); 821d259671Sperseant int setup(const char *); 83*a74e29feSjoerg 84*a74e29feSjoerg extern struct uvnodelst vnodelist; 85*a74e29feSjoerg extern struct uvnodelst getvnodelist[VNODE_HASH_MAX]; 86*a74e29feSjoerg extern int nvnodes; 87*a74e29feSjoerg extern void (*panic_func)(int, const char *, va_list); 88*a74e29feSjoerg extern int fake_cleanseg; 89*a74e29feSjoerg extern off_t locked_queue_bytes; 90*a74e29feSjoerg extern int locked_queue_count; 91*a74e29feSjoerg extern int preen; 92*a74e29feSjoerg extern time_t write_time; 93