Home | History | Annotate | Line # | Download | only in lfs
lfs_extern.h revision 1.59.2.1.2.1
      1  1.59.2.1.2.1       riz /*	$NetBSD: lfs_extern.h,v 1.59.2.1.2.1 2005/05/10 05:08:57 riz Exp $	*/
      2           1.2       cgd 
      3           1.1   mycroft /*-
      4          1.39  perseant  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
      5          1.13  perseant  * All rights reserved.
      6          1.13  perseant  *
      7          1.13  perseant  * This code is derived from software contributed to The NetBSD Foundation
      8          1.13  perseant  * by Konrad E. Schroder <perseant (at) hhhh.org>.
      9          1.13  perseant  *
     10          1.13  perseant  * Redistribution and use in source and binary forms, with or without
     11          1.13  perseant  * modification, are permitted provided that the following conditions
     12          1.13  perseant  * are met:
     13          1.13  perseant  * 1. Redistributions of source code must retain the above copyright
     14          1.13  perseant  *    notice, this list of conditions and the following disclaimer.
     15          1.13  perseant  * 2. Redistributions in binary form must reproduce the above copyright
     16          1.13  perseant  *    notice, this list of conditions and the following disclaimer in the
     17          1.13  perseant  *    documentation and/or other materials provided with the distribution.
     18          1.13  perseant  * 3. All advertising materials mentioning features or use of this software
     19          1.13  perseant  *    must display the following acknowledgement:
     20          1.41  perseant  *	This product includes software developed by the NetBSD
     21          1.41  perseant  *	Foundation, Inc. and its contributors.
     22          1.13  perseant  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23          1.13  perseant  *    contributors may be used to endorse or promote products derived
     24          1.13  perseant  *    from this software without specific prior written permission.
     25          1.13  perseant  *
     26          1.13  perseant  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27          1.13  perseant  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28          1.13  perseant  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29          1.13  perseant  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30          1.13  perseant  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31          1.13  perseant  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32          1.13  perseant  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33          1.13  perseant  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34          1.13  perseant  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35          1.13  perseant  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36          1.13  perseant  * POSSIBILITY OF SUCH DAMAGE.
     37          1.13  perseant  */
     38          1.13  perseant /*-
     39           1.1   mycroft  * Copyright (c) 1991, 1993, 1994
     40           1.1   mycroft  *	The Regents of the University of California.  All rights reserved.
     41           1.1   mycroft  *
     42           1.1   mycroft  * Redistribution and use in source and binary forms, with or without
     43           1.1   mycroft  * modification, are permitted provided that the following conditions
     44           1.1   mycroft  * are met:
     45           1.1   mycroft  * 1. Redistributions of source code must retain the above copyright
     46           1.1   mycroft  *    notice, this list of conditions and the following disclaimer.
     47           1.1   mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     48           1.1   mycroft  *    notice, this list of conditions and the following disclaimer in the
     49           1.1   mycroft  *    documentation and/or other materials provided with the distribution.
     50          1.53       agc  * 3. Neither the name of the University nor the names of its contributors
     51           1.1   mycroft  *    may be used to endorse or promote products derived from this software
     52           1.1   mycroft  *    without specific prior written permission.
     53           1.1   mycroft  *
     54           1.1   mycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     55           1.1   mycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     56           1.1   mycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     57           1.1   mycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     58           1.1   mycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     59           1.1   mycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     60           1.1   mycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     61           1.1   mycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     62           1.1   mycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     63           1.1   mycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     64           1.1   mycroft  * SUCH DAMAGE.
     65           1.1   mycroft  *
     66           1.7      fvdl  *	@(#)lfs_extern.h	8.6 (Berkeley) 5/8/95
     67           1.1   mycroft  */
     68           1.8  sommerfe 
     69          1.32      matt #ifndef _UFS_LFS_LFS_EXTERN_H_
     70          1.32      matt #define _UFS_LFS_LFS_EXTERN_H_
     71          1.37   thorpej 
     72          1.38      tron #ifdef _KERNEL
     73          1.37   thorpej #include <sys/mallocvar.h>
     74          1.38      tron 
     75          1.37   thorpej MALLOC_DECLARE(M_SEGMENT);
     76          1.38      tron #endif
     77          1.32      matt 
     78          1.20  perseant /* Copied from ext2fs for ITIMES.  XXX This is a bogus use of v_tag. */
     79          1.20  perseant #define IS_LFS_VNODE(vp)   (vp->v_tag == VT_LFS)
     80          1.20  perseant 
     81          1.13  perseant /*
     82          1.13  perseant  * Sysctl values for LFS.
     83          1.13  perseant  */
     84          1.13  perseant #define LFS_WRITEINDIR	 1 /* flush indirect blocks on non-checkpoint writes */
     85          1.13  perseant #define LFS_CLEAN_VNHEAD 2 /* put prev unrefed cleaned vnodes on head of free list */
     86          1.41  perseant #define LFS_DOSTATS	 3
     87          1.39  perseant #define LFS_MAXPAGES	 4
     88  1.59.2.1.2.1       riz #define LFS_FS_PAGETRIP	 5
     89  1.59.2.1.2.1       riz #define LFS_MAXID	 6
     90          1.13  perseant 
     91          1.13  perseant #define LFS_NAMES { \
     92          1.13  perseant 	{ 0, 0 }, \
     93          1.13  perseant 	{ "flushindir", CTLTYPE_INT }, \
     94          1.13  perseant 	{ "clean_vnhead", CTLTYPE_INT }, \
     95          1.13  perseant 	{ "dostats", CTLTYPE_INT }, \
     96          1.39  perseant 	{ "maxpages", CTLTYPE_INT }, \
     97          1.13  perseant }
     98          1.13  perseant 
     99           1.1   mycroft struct fid;
    100           1.1   mycroft struct mount;
    101           1.1   mycroft struct nameidata;
    102           1.1   mycroft struct proc;
    103           1.1   mycroft struct statfs;
    104           1.1   mycroft struct timeval;
    105           1.1   mycroft struct inode;
    106           1.1   mycroft struct uio;
    107           1.1   mycroft struct mbuf;
    108          1.47      fvdl struct ufs1_dinode;
    109           1.4  christos struct buf;
    110           1.4  christos struct vnode;
    111          1.18  perseant struct dlfs;
    112           1.4  christos struct lfs;
    113           1.4  christos struct segment;
    114           1.5  christos struct ucred;
    115          1.43  perseant struct block_info;
    116          1.10   thorpej 
    117          1.29      matt extern int lfs_allclean_wakeup;
    118          1.47      fvdl extern struct pool lfs_inode_pool;		/* memory pool for inodes */
    119          1.47      fvdl extern struct pool lfs_dinode_pool;		/* memory pool for dinodes */
    120          1.39  perseant extern struct pool lfs_inoext_pool;	/* memory pool for inode extension */
    121  1.59.2.1.2.1       riz extern struct pool lfs_lbnentry_pool;   /* memory pool for balloc accounting */
    122          1.52      yamt 
    123          1.52      yamt extern int locked_queue_count;
    124          1.52      yamt extern long locked_queue_bytes;
    125          1.52      yamt extern int lfs_subsys_pages;
    126          1.52      yamt extern int lfs_dirvcount;
    127          1.52      yamt extern struct simplelock lfs_subsys_lock;
    128           1.1   mycroft 
    129           1.1   mycroft __BEGIN_DECLS
    130           1.4  christos /* lfs_alloc.c */
    131          1.50      fvdl int lfs_rf_valloc(struct lfs *, ino_t, int, struct proc *, struct vnode **);
    132          1.25  perseant void lfs_vcreate(struct mount *, ino_t, struct vnode *);
    133  1.59.2.1.2.1       riz 
    134  1.59.2.1.2.1       riz /* lfs_balloc.c */
    135  1.59.2.1.2.1       riz void lfs_register_block(struct vnode *, daddr_t);
    136  1.59.2.1.2.1       riz void lfs_deregister_block(struct vnode *, daddr_t);
    137  1.59.2.1.2.1       riz void lfs_deregister_all(struct vnode *);
    138  1.59.2.1.2.1       riz 
    139           1.4  christos /* lfs_bio.c */
    140          1.25  perseant int lfs_availwait(struct lfs *, int);
    141          1.25  perseant int lfs_bwrite_ext(struct buf *, int);
    142          1.25  perseant int lfs_fits(struct lfs *, int);
    143          1.25  perseant void lfs_flush_fs(struct lfs *, int);
    144  1.59.2.1.2.1       riz void lfs_flush(struct lfs *, int, int);
    145          1.35      fvdl int lfs_check(struct vnode *, daddr_t, int);
    146          1.39  perseant void lfs_freebuf(struct lfs *, struct buf *);
    147          1.39  perseant struct buf *lfs_newbuf(struct lfs *, struct vnode *, daddr_t, size_t, int);
    148          1.30  perseant void lfs_countlocked(int *, long *, char *);
    149          1.34      yamt int lfs_reserve(struct lfs *, struct vnode *, struct vnode *, int);
    150           1.4  christos 
    151           1.4  christos /* lfs_cksum.c */
    152          1.25  perseant u_int32_t cksum(void *, size_t);
    153          1.59      yamt u_int32_t lfs_cksum_part(void *, size_t, u_int32_t);
    154          1.59      yamt #define lfs_cksum_fold(sum)	(sum)
    155          1.25  perseant u_int32_t lfs_sb_cksum(struct dlfs *);
    156           1.4  christos 
    157           1.4  christos /* lfs_debug.c */
    158           1.1   mycroft #ifdef DEBUG
    159          1.30  perseant int lfs_bwrite_log(struct buf *, char *, int);
    160          1.30  perseant void lfs_dumplog(void);
    161          1.25  perseant void lfs_dump_super(struct lfs *);
    162          1.47      fvdl void lfs_dump_dinode(struct ufs1_dinode *);
    163          1.25  perseant void lfs_check_bpp(struct lfs *, struct segment *, char *, int);
    164          1.25  perseant void lfs_check_segsum(struct lfs *, struct segment *, char *, int);
    165          1.13  perseant #endif /* DEBUG */
    166           1.4  christos 
    167           1.4  christos /* lfs_inode.c */
    168          1.47      fvdl struct ufs1_dinode *lfs_ifind(struct lfs *, ino_t, struct buf *);
    169           1.4  christos 
    170           1.4  christos /* lfs_segment.c */
    171          1.25  perseant void lfs_imtime(struct lfs *);
    172          1.25  perseant int lfs_vflush(struct vnode *);
    173          1.25  perseant int lfs_segwrite(struct mount *, int);
    174          1.25  perseant void lfs_writefile(struct lfs *, struct segment *, struct vnode *);
    175          1.25  perseant int lfs_writeinode(struct lfs *, struct segment *, struct inode *);
    176          1.25  perseant int lfs_gatherblock(struct segment *, struct buf *, int *);
    177          1.25  perseant int lfs_gather(struct lfs *, struct segment *, struct vnode *, int (*match )(struct lfs *, struct buf *));
    178          1.57      yamt void lfs_update_single(struct lfs *, struct segment *, struct vnode *,
    179          1.57      yamt     daddr_t, int32_t, int);
    180          1.25  perseant void lfs_updatemeta(struct segment *);
    181          1.25  perseant int lfs_initseg(struct lfs *);
    182          1.25  perseant int lfs_writeseg(struct lfs *, struct segment *);
    183          1.25  perseant void lfs_writesuper(struct lfs *, daddr_t);
    184          1.25  perseant int lfs_match_data(struct lfs *, struct buf *);
    185          1.25  perseant int lfs_match_indir(struct lfs *, struct buf *);
    186          1.25  perseant int lfs_match_dindir(struct lfs *, struct buf *);
    187          1.25  perseant int lfs_match_tindir(struct lfs *, struct buf *);
    188          1.25  perseant void lfs_callback(struct buf *);
    189          1.25  perseant int lfs_vref(struct vnode *);
    190          1.25  perseant void lfs_vunref(struct vnode *);
    191          1.25  perseant void lfs_vunref_head(struct vnode *);
    192           1.4  christos 
    193           1.4  christos /* lfs_subr.c */
    194          1.39  perseant void lfs_setup_resblks(struct lfs *);
    195          1.43  perseant void lfs_pad_check(unsigned char *, int, char *, int);
    196          1.39  perseant void lfs_free_resblks(struct lfs *);
    197          1.39  perseant void *lfs_malloc(struct lfs *, size_t, int);
    198          1.39  perseant void lfs_free(struct lfs *, void *, int);
    199          1.39  perseant int lfs_seglock(struct lfs *, unsigned long);
    200          1.25  perseant void lfs_segunlock(struct lfs *);
    201          1.51      yamt int lfs_writer_enter(struct lfs *, const char *);
    202          1.51      yamt void lfs_writer_leave(struct lfs *);
    203           1.4  christos 
    204           1.4  christos /* lfs_syscalls.c */
    205          1.47      fvdl int lfs_fastvget(struct mount *, ino_t, daddr_t, struct vnode **, struct ufs1_dinode *);
    206          1.30  perseant struct buf *lfs_fakebuf(struct lfs *, struct vnode *, int, size_t, caddr_t);
    207          1.39  perseant int lfs_do_segclean(struct lfs *, unsigned long);
    208          1.40  perseant void lfs_fakebuf_iodone(struct buf *);
    209          1.43  perseant int lfs_segwait(fsid_t *, struct timeval *);
    210          1.50      fvdl int lfs_bmapv(struct proc *, fsid_t *, struct block_info *, int);
    211          1.43  perseant int lfs_markv(struct proc *, fsid_t *, struct block_info *, int);
    212           1.4  christos 
    213           1.4  christos /* lfs_vfsops.c */
    214          1.25  perseant void lfs_init(void);
    215          1.26       chs void lfs_reinit(void);
    216          1.25  perseant void lfs_done(void);
    217          1.25  perseant int lfs_mountroot(void);
    218          1.50      fvdl int lfs_mount(struct mount *, const char *, void *, struct nameidata *, struct proc *);
    219          1.50      fvdl int lfs_unmount(struct mount *, int, struct proc *);
    220          1.50      fvdl int lfs_statfs(struct mount *, struct statfs *, struct proc *);
    221          1.50      fvdl int lfs_sync(struct mount *, int, struct ucred *, struct proc *);
    222          1.49   thorpej int lfs_vget(struct mount *, ino_t, struct vnode **);
    223          1.49   thorpej int lfs_fhtovp(struct mount *, struct fid *, struct vnode **);
    224          1.25  perseant int lfs_vptofh(struct vnode *, struct fid *);
    225          1.56      yamt void lfs_vinit(struct mount *mp, struct vnode **);
    226           1.4  christos 
    227          1.18  perseant /* lfs_vnops.c */
    228          1.54      yamt void lfs_mark_vnode(struct vnode *);
    229          1.25  perseant void lfs_unmark_vnode(struct vnode *);
    230          1.25  perseant void lfs_itimes(struct inode *, struct timespec *, struct timespec *,
    231          1.25  perseant 		struct timespec *);
    232          1.39  perseant int lfs_gop_alloc(struct vnode *, off_t, off_t, int, struct ucred *);
    233          1.39  perseant void lfs_gop_size(struct vnode *, off_t, off_t *, int);
    234          1.39  perseant int lfs_putpages_ext(void *, int);
    235          1.39  perseant int lfs_gatherpages(struct vnode *);
    236          1.25  perseant 
    237          1.31  perseant int lfs_balloc	 (void *);
    238          1.31  perseant int lfs_valloc	 (void *);
    239          1.31  perseant int lfs_vfree	 (void *);
    240          1.31  perseant int lfs_bwrite	 (void *);
    241          1.31  perseant int lfs_update	 (void *);
    242          1.31  perseant int lfs_truncate (void *);
    243          1.31  perseant int lfs_blkatoff (void *);
    244          1.31  perseant int lfs_fsync	 (void *);
    245          1.31  perseant int lfs_symlink	 (void *);
    246          1.31  perseant int lfs_mknod	 (void *);
    247          1.31  perseant int lfs_create	 (void *);
    248          1.31  perseant int lfs_mkdir	 (void *);
    249          1.31  perseant int lfs_read	 (void *);
    250          1.31  perseant int lfs_remove	 (void *);
    251          1.31  perseant int lfs_rmdir	 (void *);
    252          1.31  perseant int lfs_link	 (void *);
    253          1.39  perseant int lfs_mmap	 (void *);
    254          1.31  perseant int lfs_rename	 (void *);
    255          1.31  perseant int lfs_getattr	 (void *);
    256          1.31  perseant int lfs_setattr	 (void *);
    257          1.31  perseant int lfs_close	 (void *);
    258          1.31  perseant int lfsspec_close(void *);
    259          1.31  perseant int lfsfifo_close(void *);
    260          1.44  perseant int lfs_fcntl	 (void *);
    261          1.31  perseant int lfs_inactive (void *);
    262          1.31  perseant int lfs_reclaim	 (void *);
    263          1.45  perseant int lfs_strategy (void *);
    264          1.31  perseant int lfs_write	 (void *);
    265          1.31  perseant int lfs_getpages (void *);
    266          1.31  perseant int lfs_putpages (void *);
    267           1.4  christos 
    268      1.59.2.1      tron #ifdef SYSCTL_SETUP_PROTO
    269      1.59.2.1      tron SYSCTL_SETUP_PROTO(sysctl_vfs_lfs_setup);
    270      1.59.2.1      tron #endif /* SYSCTL_SETUP_PROTO */
    271      1.59.2.1      tron 
    272           1.1   mycroft __END_DECLS
    273           1.7      fvdl extern int lfs_mount_type;
    274          1.25  perseant extern int (**lfs_vnodeop_p)(void *);
    275          1.25  perseant extern int (**lfs_specop_p)(void *);
    276          1.25  perseant extern int (**lfs_fifoop_p)(void *);
    277          1.27       chs extern struct genfs_ops lfs_genfsops;
    278          1.32      matt 
    279          1.32      matt #endif /* !_UFS_LFS_LFS_EXTERN_H_ */
    280