xref: /csrg-svn/sys/miscfs/nullfs/null.h (revision 54938)
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 
3654893Sheideman extern int null_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
3754750Sjohnh 
3854754Sjohnh #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
3954767Sjohnh #define	VTONULL(vp) ((struct null_node *)(vp)->v_data)
40*54938Sheideman #define	NULLTOV(xp) ((xp)->null_vnode)
4154754Sjohnh #ifdef NULLFS_DIAGNOSTIC
4254754Sjohnh extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
4354893Sheideman #define	NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__)
4454750Sjohnh #else
4554893Sheideman #define	NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp)
4654750Sjohnh #endif
4754750Sjohnh 
4854754Sjohnh extern int (**null_vnodeop_p)();
4954754Sjohnh extern struct vfsops null_vfsops;
5054750Sjohnh #endif /* KERNEL */
5154767Sjohnh 
52