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