Module Name:    src
Committed By:   dholland
Date:           Sun Jul 28 01:05:52 UTC 2013

Modified Files:
        src/sys/ufs/lfs: lfs.h lfs_alloc.c lfs_balloc.c lfs_bio.c lfs_inode.c
            lfs_rfw.c lfs_segment.c lfs_subr.c lfs_syscalls.c lfs_vfsops.c
            lfs_vnops.c
Added Files:
        src/sys/ufs/lfs: lfs_kernel.h

Log Message:
Add lfs_kernel.h for declarations that don't need to be exposed to userland.

lfs currently has the following headers:
   lfs.h - on-disk structures and stuff needed for userlevel tools
   lfs_inode.h - additional restricted materials for userlevel tools
                 that operate the fs (newfs_lfs, fsck_lfs, lfs_cleanerd)
   lfs_kernel.h - stuff needed only in the kernel

and the following legacy headers that are expected to be mopped up and
folded into one of the above:
   lfs_extern.h - function prototypes
   ulfs_bswap.h - endian-independent support
   ulfs_dinode.h - now contains very little
   ulfs_dirhash.h - dirhash support
   ulfs_extattr.h - extattr support
   ulfs_extern.h - more function prototypes
   ulfs_inode.h - assorted kernel-only declarations
   ulfs_quota.h - quota support
   ulfs_quota1.h - more quota support
   ulfs_quota2.h - more quota support
   ulfs_quotacommon.h - more quota support
   ulfsmount.h - legacy copy of ufsmount material


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/ufs/lfs/lfs.h
cvs rdiff -u -r1.117 -r1.118 src/sys/ufs/lfs/lfs_alloc.c
cvs rdiff -u -r1.77 -r1.78 src/sys/ufs/lfs/lfs_balloc.c
cvs rdiff -u -r1.125 -r1.126 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -u -r1.132 -r1.133 src/sys/ufs/lfs/lfs_inode.c
cvs rdiff -u -r0 -r1.1 src/sys/ufs/lfs/lfs_kernel.h
cvs rdiff -u -r1.17 -r1.18 src/sys/ufs/lfs/lfs_rfw.c
cvs rdiff -u -r1.230 -r1.231 src/sys/ufs/lfs/lfs_segment.c
cvs rdiff -u -r1.79 -r1.80 src/sys/ufs/lfs/lfs_subr.c
cvs rdiff -u -r1.147 -r1.148 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -u -r1.308 -r1.309 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -u -r1.251 -r1.252 src/sys/ufs/lfs/lfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/lfs/lfs.h
diff -u src/sys/ufs/lfs/lfs.h:1.157 src/sys/ufs/lfs/lfs.h:1.158
--- src/sys/ufs/lfs/lfs.h:1.157	Fri Jun 28 16:14:06 2013
+++ src/sys/ufs/lfs/lfs.h	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs.h,v 1.157 2013/06/28 16:14:06 matt Exp $	*/
+/*	$NetBSD: lfs.h,v 1.158 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*  from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.21 2009/07/22 04:49:19 dholland Exp  */
@@ -1113,28 +1113,6 @@ struct segment {
 	int	  ndupino;		/* number of duplicate inodes */
 };
 
-#ifdef _KERNEL
-struct lfs_cluster {
-	size_t bufsize;	       /* Size of kept data */
-	struct buf **bpp;      /* Array of kept buffers */
-	int bufcount;	       /* Number of kept buffers */
-#define LFS_CL_MALLOC	0x00000001
-#define LFS_CL_SHIFT	0x00000002
-#define LFS_CL_SYNC	0x00000004
-	u_int32_t flags;       /* Flags */
-	struct lfs *fs;	       /* LFS that this belongs to */
-	struct segment *seg;   /* Segment structure, for LFS_CL_SYNC */
-};
-
-/*
- * Splay tree containing block numbers allocated through lfs_balloc.
- */
-struct lbnentry {
-	SPLAY_ENTRY(lbnentry) entry;
-	daddr_t lbn;
-};
-#endif /* _KERNEL */
-
 /*
  * Macros for determining free space on the disk, with the variable metadata
  * of segment summaries and inode blocks taken into account.
@@ -1208,9 +1186,6 @@ struct lfs_stats {	/* Must match sysctl 
 	u_int	clean_vnlocked;
 	u_int   segs_reclaimed;
 };
-#ifdef _KERNEL
-extern struct lfs_stats lfs_stats;
-#endif
 
 /* Fcntls to take the place of the lfs syscalls */
 struct lfs_fcntl_markv {
@@ -1238,31 +1213,6 @@ struct lfs_fhandle {
 # define LFS_WRAP_WAITING 0x1
 #define LFCNWRAPSTATUS	 _FCNW_FSPRIV('L', 13, int)
 
-/*
- * Compat.  Defined for kernel only.  Userland always uses
- * "the one true version".
- */
-#ifdef _KERNEL
-#include <compat/sys/time_types.h>
-
-#define LFCNSEGWAITALL_COMPAT	 _FCNW_FSPRIV('L', 0, struct timeval50)
-#define LFCNSEGWAIT_COMPAT	 _FCNW_FSPRIV('L', 1, struct timeval50)
-#define LFCNIFILEFH_COMPAT	 _FCNW_FSPRIV('L', 5, struct lfs_fhandle)
-#define LFCNIFILEFH_COMPAT2	 _FCN_FSPRIV(F_FSOUT, 'L', 11, 32)
-#define LFCNWRAPSTOP_COMPAT	 _FCNO_FSPRIV('L', 9)
-#define LFCNWRAPGO_COMPAT	 _FCNO_FSPRIV('L', 10)
-#define LFCNSEGWAITALL_COMPAT_50 _FCNR_FSPRIV('L', 0, struct timeval50)
-#define LFCNSEGWAIT_COMPAT_50	 _FCNR_FSPRIV('L', 1, struct timeval50)
-#endif
-
-#ifdef _KERNEL
-/* XXX MP */
-#define	LFS_SEGLOCK_HELD(fs) \
-	((fs)->lfs_seglock != 0 &&					\
-	 (fs)->lfs_lockpid == curproc->p_pid &&				\
-	 (fs)->lfs_locklwp == curlwp->l_lid)
-#endif /* _KERNEL */
-
 /* Debug segment lock */
 #ifdef notyet
 # define ASSERT_SEGLOCK(fs) KASSERT(LFS_SEGLOCK_HELD(fs))

Index: src/sys/ufs/lfs/lfs_alloc.c
diff -u src/sys/ufs/lfs/lfs_alloc.c:1.117 src/sys/ufs/lfs/lfs_alloc.c:1.118
--- src/sys/ufs/lfs/lfs_alloc.c:1.117	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_alloc.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_alloc.c,v 1.117 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_alloc.c,v 1.118 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.117 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.118 2013/07/28 01:05:52 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -87,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,
 
 #include <ufs/lfs/lfs.h>
 #include <ufs/lfs/lfs_extern.h>
+#include <ufs/lfs/lfs_kernel.h>
 
 /* Constants for inode free bitmap */
 #define BMSHIFT 5	/* 2 ** 5 = 32 */

Index: src/sys/ufs/lfs/lfs_balloc.c
diff -u src/sys/ufs/lfs/lfs_balloc.c:1.77 src/sys/ufs/lfs/lfs_balloc.c:1.78
--- src/sys/ufs/lfs/lfs_balloc.c:1.77	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_balloc.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_balloc.c,v 1.77 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_balloc.c,v 1.78 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.77 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.78 2013/07/28 01:05:52 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c
 
 #include <ufs/lfs/lfs.h>
 #include <ufs/lfs/lfs_extern.h>
+#include <ufs/lfs/lfs_kernel.h>
 
 #include <uvm/uvm.h>
 

Index: src/sys/ufs/lfs/lfs_bio.c
diff -u src/sys/ufs/lfs/lfs_bio.c:1.125 src/sys/ufs/lfs/lfs_bio.c:1.126
--- src/sys/ufs/lfs/lfs_bio.c:1.125	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_bio.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_bio.c,v 1.125 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_bio.c,v 1.126 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.125 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.126 2013/07/28 01:05:52 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,6 +78,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 
 
 #include <ufs/lfs/lfs.h>
 #include <ufs/lfs/lfs_extern.h>
+#include <ufs/lfs/lfs_kernel.h>
 
 #include <uvm/uvm.h>
 

Index: src/sys/ufs/lfs/lfs_inode.c
diff -u src/sys/ufs/lfs/lfs_inode.c:1.132 src/sys/ufs/lfs/lfs_inode.c:1.133
--- src/sys/ufs/lfs/lfs_inode.c:1.132	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_inode.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_inode.c,v 1.132 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_inode.c,v 1.133 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.132 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,v 1.133 2013/07/28 01:05:52 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_inode.c,
 
 #include <ufs/lfs/lfs.h>
 #include <ufs/lfs/lfs_extern.h>
+#include <ufs/lfs/lfs_kernel.h>
 
 static int lfs_update_seguse(struct lfs *, struct inode *ip, long, size_t);
 static int lfs_indirtrunc (struct inode *, daddr_t, daddr_t,

Index: src/sys/ufs/lfs/lfs_rfw.c
diff -u src/sys/ufs/lfs/lfs_rfw.c:1.17 src/sys/ufs/lfs/lfs_rfw.c:1.18
--- src/sys/ufs/lfs/lfs_rfw.c:1.17	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_rfw.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_rfw.c,v 1.17 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_rfw.c,v 1.18 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_rfw.c,v 1.17 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_rfw.c,v 1.18 2013/07/28 01:05:52 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -73,6 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_rfw.c,v 
 #include <uvm/uvm_pdaemon.h>
 
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 #include <miscfs/genfs/genfs.h>

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.230 src/sys/ufs/lfs/lfs_segment.c:1.231
--- src/sys/ufs/lfs/lfs_segment.c:1.230	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_segment.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_segment.c,v 1.230 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_segment.c,v 1.231 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.230 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.231 2013/07/28 01:05:52 dholland Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {						\
@@ -100,6 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_segment.
 #include <ufs/lfs/ulfs_extern.h>
 
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 #include <uvm/uvm.h>

Index: src/sys/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.79 src/sys/ufs/lfs/lfs_subr.c:1.80
--- src/sys/ufs/lfs/lfs_subr.c:1.79	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_subr.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.79 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.80 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.79 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.80 2013/07/28 01:05:52 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v
 
 #include <ufs/lfs/ulfs_inode.h>
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 #include <uvm/uvm.h>

Index: src/sys/ufs/lfs/lfs_syscalls.c
diff -u src/sys/ufs/lfs/lfs_syscalls.c:1.147 src/sys/ufs/lfs/lfs_syscalls.c:1.148
--- src/sys/ufs/lfs/lfs_syscalls.c:1.147	Tue Jun 18 18:18:58 2013
+++ src/sys/ufs/lfs/lfs_syscalls.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_syscalls.c,v 1.147 2013/06/18 18:18:58 christos Exp $	*/
+/*	$NetBSD: lfs_syscalls.c,v 1.148 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007, 2008
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.147 2013/06/18 18:18:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.148 2013/07/28 01:05:52 dholland Exp $");
 
 #ifndef LFS
 # define LFS		/* for prototypes in syscallargs.h */
@@ -82,6 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_syscalls
 #include <ufs/lfs/ulfs_extern.h>
 
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 struct buf *lfs_fakebuf(struct lfs *, struct vnode *, int, size_t, void *);

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.308 src/sys/ufs/lfs/lfs_vfsops.c:1.309
--- src/sys/ufs/lfs/lfs_vfsops.c:1.308	Sun Jul 28 00:29:18 2013
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.308 2013/07/28 00:29:18 dholland Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.309 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.308 2013/07/28 00:29:18 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.309 2013/07/28 01:05:52 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -109,6 +109,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c
 #include <uvm/uvm_pdaemon.h>
 
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 #include <miscfs/genfs/genfs.h>

Index: src/sys/ufs/lfs/lfs_vnops.c
diff -u src/sys/ufs/lfs/lfs_vnops.c:1.251 src/sys/ufs/lfs/lfs_vnops.c:1.252
--- src/sys/ufs/lfs/lfs_vnops.c:1.251	Sun Jul 21 00:01:22 2013
+++ src/sys/ufs/lfs/lfs_vnops.c	Sun Jul 28 01:05:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vnops.c,v 1.251 2013/07/21 00:01:22 dholland Exp $	*/
+/*	$NetBSD: lfs_vnops.c,v 1.252 2013/07/28 01:05:52 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.251 2013/07/21 00:01:22 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.252 2013/07/28 01:05:52 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -99,6 +99,7 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,
 #include <uvm/uvm_pager.h>
 
 #include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_kernel.h>
 #include <ufs/lfs/lfs_extern.h>
 
 extern pid_t lfs_writer_daemon;

Added files:

Index: src/sys/ufs/lfs/lfs_kernel.h
diff -u /dev/null src/sys/ufs/lfs/lfs_kernel.h:1.1
--- /dev/null	Sun Jul 28 01:05:52 2013
+++ src/sys/ufs/lfs/lfs_kernel.h	Sun Jul 28 01:05:52 2013
@@ -0,0 +1,113 @@
+/*	$NetBSD: lfs_kernel.h,v 1.1 2013/07/28 01:05:52 dholland Exp $	*/
+
+/*  from NetBSD: lfs.h,v 1.157 2013/06/28 16:14:06 matt Exp  */
+
+/*-
+ * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Konrad E. Schroder <perse...@hhhh.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*-
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)lfs.h	8.9 (Berkeley) 5/8/95
+ */
+
+#ifndef _UFS_LFS_LFS_KERNEL_H_
+#define _UFS_LFS_LFS_KERNEL_H_
+
+#include <ufs/lfs/lfs.h>
+
+extern struct lfs_stats lfs_stats;
+
+/* XXX MP */
+#define	LFS_SEGLOCK_HELD(fs) \
+	((fs)->lfs_seglock != 0 &&					\
+	 (fs)->lfs_lockpid == curproc->p_pid &&				\
+	 (fs)->lfs_locklwp == curlwp->l_lid)
+
+struct lfs_cluster {
+	size_t bufsize;	       /* Size of kept data */
+	struct buf **bpp;      /* Array of kept buffers */
+	int bufcount;	       /* Number of kept buffers */
+#define LFS_CL_MALLOC	0x00000001
+#define LFS_CL_SHIFT	0x00000002
+#define LFS_CL_SYNC	0x00000004
+	u_int32_t flags;       /* Flags */
+	struct lfs *fs;	       /* LFS that this belongs to */
+	struct segment *seg;   /* Segment structure, for LFS_CL_SYNC */
+};
+
+/*
+ * Splay tree containing block numbers allocated through lfs_balloc.
+ */
+struct lbnentry {
+	SPLAY_ENTRY(lbnentry) entry;
+	daddr_t lbn;
+};
+
+/*
+ * Compat fcntls.  Defined for kernel only.  Userland always uses
+ * "the one true version".
+ */
+#include <compat/sys/time_types.h>
+
+#define LFCNSEGWAITALL_COMPAT	 _FCNW_FSPRIV('L', 0, struct timeval50)
+#define LFCNSEGWAIT_COMPAT	 _FCNW_FSPRIV('L', 1, struct timeval50)
+#define LFCNIFILEFH_COMPAT	 _FCNW_FSPRIV('L', 5, struct lfs_fhandle)
+#define LFCNIFILEFH_COMPAT2	 _FCN_FSPRIV(F_FSOUT, 'L', 11, 32)
+#define LFCNWRAPSTOP_COMPAT	 _FCNO_FSPRIV('L', 9)
+#define LFCNWRAPGO_COMPAT	 _FCNO_FSPRIV('L', 10)
+#define LFCNSEGWAITALL_COMPAT_50 _FCNR_FSPRIV('L', 0, struct timeval50)
+#define LFCNSEGWAIT_COMPAT_50	 _FCNR_FSPRIV('L', 1, struct timeval50)
+
+
+#endif /* _UFS_LFS_LFS_KERNEL_H_ */

Reply via email to