Home | History | Annotate | Line # | Download | only in lfs
lfs_kernel.h revision 1.1.2.2
      1  1.1.2.2  rmind /*	$NetBSD: lfs_kernel.h,v 1.1.2.2 2013/08/28 23:59:38 rmind Exp $	*/
      2  1.1.2.2  rmind 
      3  1.1.2.2  rmind /*  from NetBSD: lfs.h,v 1.157 2013/06/28 16:14:06 matt Exp  */
      4  1.1.2.2  rmind 
      5  1.1.2.2  rmind /*-
      6  1.1.2.2  rmind  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
      7  1.1.2.2  rmind  * All rights reserved.
      8  1.1.2.2  rmind  *
      9  1.1.2.2  rmind  * This code is derived from software contributed to The NetBSD Foundation
     10  1.1.2.2  rmind  * by Konrad E. Schroder <perseant (at) hhhh.org>.
     11  1.1.2.2  rmind  *
     12  1.1.2.2  rmind  * Redistribution and use in source and binary forms, with or without
     13  1.1.2.2  rmind  * modification, are permitted provided that the following conditions
     14  1.1.2.2  rmind  * are met:
     15  1.1.2.2  rmind  * 1. Redistributions of source code must retain the above copyright
     16  1.1.2.2  rmind  *    notice, this list of conditions and the following disclaimer.
     17  1.1.2.2  rmind  * 2. Redistributions in binary form must reproduce the above copyright
     18  1.1.2.2  rmind  *    notice, this list of conditions and the following disclaimer in the
     19  1.1.2.2  rmind  *    documentation and/or other materials provided with the distribution.
     20  1.1.2.2  rmind  *
     21  1.1.2.2  rmind  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     22  1.1.2.2  rmind  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     23  1.1.2.2  rmind  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     24  1.1.2.2  rmind  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     25  1.1.2.2  rmind  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26  1.1.2.2  rmind  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27  1.1.2.2  rmind  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28  1.1.2.2  rmind  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29  1.1.2.2  rmind  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30  1.1.2.2  rmind  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     31  1.1.2.2  rmind  * POSSIBILITY OF SUCH DAMAGE.
     32  1.1.2.2  rmind  */
     33  1.1.2.2  rmind /*-
     34  1.1.2.2  rmind  * Copyright (c) 1991, 1993
     35  1.1.2.2  rmind  *	The Regents of the University of California.  All rights reserved.
     36  1.1.2.2  rmind  *
     37  1.1.2.2  rmind  * Redistribution and use in source and binary forms, with or without
     38  1.1.2.2  rmind  * modification, are permitted provided that the following conditions
     39  1.1.2.2  rmind  * are met:
     40  1.1.2.2  rmind  * 1. Redistributions of source code must retain the above copyright
     41  1.1.2.2  rmind  *    notice, this list of conditions and the following disclaimer.
     42  1.1.2.2  rmind  * 2. Redistributions in binary form must reproduce the above copyright
     43  1.1.2.2  rmind  *    notice, this list of conditions and the following disclaimer in the
     44  1.1.2.2  rmind  *    documentation and/or other materials provided with the distribution.
     45  1.1.2.2  rmind  * 3. Neither the name of the University nor the names of its contributors
     46  1.1.2.2  rmind  *    may be used to endorse or promote products derived from this software
     47  1.1.2.2  rmind  *    without specific prior written permission.
     48  1.1.2.2  rmind  *
     49  1.1.2.2  rmind  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     50  1.1.2.2  rmind  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     51  1.1.2.2  rmind  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     52  1.1.2.2  rmind  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     53  1.1.2.2  rmind  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     54  1.1.2.2  rmind  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     55  1.1.2.2  rmind  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     56  1.1.2.2  rmind  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     57  1.1.2.2  rmind  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     58  1.1.2.2  rmind  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     59  1.1.2.2  rmind  * SUCH DAMAGE.
     60  1.1.2.2  rmind  *
     61  1.1.2.2  rmind  *	@(#)lfs.h	8.9 (Berkeley) 5/8/95
     62  1.1.2.2  rmind  */
     63  1.1.2.2  rmind 
     64  1.1.2.2  rmind #ifndef _UFS_LFS_LFS_KERNEL_H_
     65  1.1.2.2  rmind #define _UFS_LFS_LFS_KERNEL_H_
     66  1.1.2.2  rmind 
     67  1.1.2.2  rmind #include <ufs/lfs/lfs.h>
     68  1.1.2.2  rmind 
     69  1.1.2.2  rmind extern struct lfs_stats lfs_stats;
     70  1.1.2.2  rmind 
     71  1.1.2.2  rmind /* XXX MP */
     72  1.1.2.2  rmind #define	LFS_SEGLOCK_HELD(fs) \
     73  1.1.2.2  rmind 	((fs)->lfs_seglock != 0 &&					\
     74  1.1.2.2  rmind 	 (fs)->lfs_lockpid == curproc->p_pid &&				\
     75  1.1.2.2  rmind 	 (fs)->lfs_locklwp == curlwp->l_lid)
     76  1.1.2.2  rmind 
     77  1.1.2.2  rmind struct lfs_cluster {
     78  1.1.2.2  rmind 	size_t bufsize;	       /* Size of kept data */
     79  1.1.2.2  rmind 	struct buf **bpp;      /* Array of kept buffers */
     80  1.1.2.2  rmind 	int bufcount;	       /* Number of kept buffers */
     81  1.1.2.2  rmind #define LFS_CL_MALLOC	0x00000001
     82  1.1.2.2  rmind #define LFS_CL_SHIFT	0x00000002
     83  1.1.2.2  rmind #define LFS_CL_SYNC	0x00000004
     84  1.1.2.2  rmind 	u_int32_t flags;       /* Flags */
     85  1.1.2.2  rmind 	struct lfs *fs;	       /* LFS that this belongs to */
     86  1.1.2.2  rmind 	struct segment *seg;   /* Segment structure, for LFS_CL_SYNC */
     87  1.1.2.2  rmind };
     88  1.1.2.2  rmind 
     89  1.1.2.2  rmind /*
     90  1.1.2.2  rmind  * Splay tree containing block numbers allocated through lfs_balloc.
     91  1.1.2.2  rmind  */
     92  1.1.2.2  rmind struct lbnentry {
     93  1.1.2.2  rmind 	SPLAY_ENTRY(lbnentry) entry;
     94  1.1.2.2  rmind 	daddr_t lbn;
     95  1.1.2.2  rmind };
     96  1.1.2.2  rmind 
     97  1.1.2.2  rmind /*
     98  1.1.2.2  rmind  * Compat fcntls.  Defined for kernel only.  Userland always uses
     99  1.1.2.2  rmind  * "the one true version".
    100  1.1.2.2  rmind  */
    101  1.1.2.2  rmind #include <compat/sys/time_types.h>
    102  1.1.2.2  rmind 
    103  1.1.2.2  rmind #define LFCNSEGWAITALL_COMPAT	 _FCNW_FSPRIV('L', 0, struct timeval50)
    104  1.1.2.2  rmind #define LFCNSEGWAIT_COMPAT	 _FCNW_FSPRIV('L', 1, struct timeval50)
    105  1.1.2.2  rmind #define LFCNIFILEFH_COMPAT	 _FCNW_FSPRIV('L', 5, struct lfs_fhandle)
    106  1.1.2.2  rmind #define LFCNIFILEFH_COMPAT2	 _FCN_FSPRIV(F_FSOUT, 'L', 11, 32)
    107  1.1.2.2  rmind #define LFCNWRAPSTOP_COMPAT	 _FCNO_FSPRIV('L', 9)
    108  1.1.2.2  rmind #define LFCNWRAPGO_COMPAT	 _FCNO_FSPRIV('L', 10)
    109  1.1.2.2  rmind #define LFCNSEGWAITALL_COMPAT_50 _FCNR_FSPRIV('L', 0, struct timeval50)
    110  1.1.2.2  rmind #define LFCNSEGWAIT_COMPAT_50	 _FCNR_FSPRIV('L', 1, struct timeval50)
    111  1.1.2.2  rmind 
    112  1.1.2.2  rmind 
    113  1.1.2.2  rmind #endif /* _UFS_LFS_LFS_KERNEL_H_ */
    114