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