xref: /csrg-svn/sys/miscfs/nullfs/null.h (revision 54767)
154750Sjohnh /*
254750Sjohnh  * Copyright (c) 1992 The Regents of the University of California
354750Sjohnh  * Copyright (c) 1990, 1992 Jan-Simon Pendry
454750Sjohnh  * All rights reserved.
554750Sjohnh  *
654750Sjohnh  * This code is derived from software donated to Berkeley by
754750Sjohnh  * Jan-Simon Pendry.
854750Sjohnh  *
954750Sjohnh  * %sccs.include.redist.c%
1054750Sjohnh  *
1154750Sjohnh  *	@(#)lofs.h	1.1 (Berkeley) 6/3/92
1254750Sjohnh  *
1354750Sjohnh  * $Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp jsp $
1454750Sjohnh  */
1554750Sjohnh 
1654754Sjohnh struct null_args {
1754750Sjohnh 	char		*target;	/* Target of loopback  */
1854750Sjohnh };
1954750Sjohnh 
2054754Sjohnh struct null_mount {
2154754Sjohnh 	struct mount	*nullm_vfs;
2254754Sjohnh 	struct vnode	*nullm_rootvp;	/* Reference to root null_node */
2354750Sjohnh };
2454750Sjohnh 
2554750Sjohnh #ifdef KERNEL
2654750Sjohnh /*
2754750Sjohnh  * A cache of vnode references
2854750Sjohnh  */
2954754Sjohnh struct null_node {
3054754Sjohnh 	struct null_node	*null_forw;	/* Hash chain */
3154754Sjohnh 	struct null_node	*null_back;
3254754Sjohnh 	struct vnode	*null_lowervp;	/* Aliased vnode - VREFed once */
3354754Sjohnh 	struct vnode	*null_vnode;	/* Back pointer to vnode/null_node */
3454750Sjohnh };
3554750Sjohnh 
3654754Sjohnh extern int make_null_node __P((struct mount *mp, struct vnode **vpp));
3754750Sjohnh 
3854754Sjohnh #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
39*54767Sjohnh #define	VTONULL(vp) ((struct null_node *)(vp)->v_data)
4054754Sjohnh #ifdef NULLFS_DIAGNOSTIC
4154754Sjohnh extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
4254754Sjohnh #define	NULLTOLOWERVP(vp) null_checkvp(vp, __FILE__, __LINE__)
4354750Sjohnh #else
4454754Sjohnh #define	NULLTOLOWERVP(vp) (VTONULLNODE(vp)->null_lowervp)
4554750Sjohnh #endif
4654750Sjohnh 
4754754Sjohnh extern int (**null_vnodeop_p)();
4854754Sjohnh extern struct vfsops null_vfsops;
4954750Sjohnh #endif /* KERNEL */
50*54767Sjohnh 
51