diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-12 21:00:40 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-12 21:00:40 +0000 |
commit | 104c9cee2b7581512ef5cf06fb24402ea5fa56c5 (patch) | |
tree | 5fdd84bbcbd97d421bf48dc5260bc924bb1f0abb /sys/miscfs/nullfs/null.h | |
parent | a4037f6b4fd1ba42f6428bea41cfc9ff22c44528 (diff) |
most of the fixes for nullfs. use the new common layer stuff in genfs.
Diffstat (limited to 'sys/miscfs/nullfs/null.h')
-rw-r--r-- | sys/miscfs/nullfs/null.h | 81 |
1 files changed, 65 insertions, 16 deletions
diff --git a/sys/miscfs/nullfs/null.h b/sys/miscfs/nullfs/null.h index 5b91a2f2ce9..b58e3040098 100644 --- a/sys/miscfs/nullfs/null.h +++ b/sys/miscfs/nullfs/null.h @@ -1,5 +1,38 @@ -/* $OpenBSD: null.h,v 1.11 2002/03/14 01:27:08 millert Exp $ */ -/* $NetBSD: null.h,v 1.7 1996/05/17 20:53:11 gwr Exp $ */ +/* $OpenBSD: null.h,v 1.12 2003/05/12 21:00:39 tedu Exp $ */ +/* $NetBSD: null.h,v 1.13 2001/11/07 04:56:09 enami Exp $ */ + +/* + * Copyright (c) 1999 National Aeronautics & Space Administration + * All rights reserved. + * + * This software was written by William Studenmund of the + * Numerical Aerospace Simulation Facility, NASA Ames Research Center. + * + * 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 National Aeronautics & Space Administration + * 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 NATIONAL AERONAUTICS & SPACE ADMINISTRATION + * ``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 ADMINISTRATION OR CONTRIB- + * UTORS 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) 1992, 1993 @@ -40,42 +73,58 @@ * @(#)null.h 8.2 (Berkeley) 1/21/94 */ +#include <miscfs/genfs/layer.h> + struct null_args { - char *target; /* Target of loopback */ + struct layer_args la; /* generic layerfs args */ }; +#define nulla_target la.target +#define nulla_export la.export +#ifdef _KERNEL struct null_mount { - struct mount *nullm_vfs; - struct vnode *nullm_rootvp; /* Reference to root null_node */ + struct layer_mount lm; /* generic layerfs mount stuff */ }; +#define nullm_vfs lm.layerm_vfs +#define nullm_rootvp lm.layerm_rootvp +#define nullm_export lm.layerm_export +#define nullm_flags lm.layerm_flags +#define nullm_size lm.layerm_size +#define nullm_tag lm.layerm_tag +#define nullm_bypass lm.layerm_bypass +#define nullm_alloc lm.layerm_alloc +#define nullm_vnodeop_p lm.layerm_vnodeop_p +#define nullm_node_hashtbl lm.layerm_node_hashtbl +#define nullm_node_hash lm.layerm_node_hash +#define nullm_hashlock lm.layerm_hashlock -#ifdef _KERNEL /* * A cache of vnode references */ struct null_node { - LIST_ENTRY(null_node) null_hash; /* Hash list */ - struct vnode *null_lowervp; /* VREFed once */ - struct vnode *null_vnode; /* Back pointer */ + struct layer_node ln; }; +#define null_hash ln.layer_hash +#define null_lowervp ln.layer_lowervp +#define null_vnode ln.layer_vnode +#define null_flags ln.layer_flags -extern int null_node_create(struct mount *mp, struct vnode *target, struct vnode **vpp, int lockit); +int null_node_create(struct mount *, struct vnode *, + struct vnode **, int); #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) #define VTONULL(vp) ((struct null_node *)(vp)->v_data) #define NULLTOV(xp) ((xp)->null_vnode) #ifdef NULLFS_DIAGNOSTIC -extern struct vnode *null_checkvp(struct vnode *vp, char *fil, int lno); -#define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) +struct vnode *layer_checkvp(struct vnode *, char *, int); +#define NULLVPTOLOWERVP(vp) layer_checkvp((vp), __FILE__, __LINE__) #else #define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp) #endif -extern int (**null_vnodeop_p)(void *); -extern struct vfsops null_vfsops; +extern int (**nullfs_vnodeop_p)(void *); +extern struct vfsops nullfs_vfsops; int nullfs_init(struct vfsconf *); -int null_bypass(void *); - #endif /* _KERNEL */ |