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