xref: /csrg-svn/sys/miscfs/nullfs/null.h (revision 54944)
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;
32*54944Sheideman 	struct vnode	        *null_lowervp;	/* VREFed once */
33*54944Sheideman 	struct vnode		*null_vnode;	/* Back pointer */
34*54944Sheideman 	int			null_isinactive;
3554750Sjohnh };
3654750Sjohnh 
3754893Sheideman extern int null_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
3854750Sjohnh 
3954754Sjohnh #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
4054767Sjohnh #define	VTONULL(vp) ((struct null_node *)(vp)->v_data)
4154938Sheideman #define	NULLTOV(xp) ((xp)->null_vnode)
4254754Sjohnh #ifdef NULLFS_DIAGNOSTIC
4354754Sjohnh extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
4454893Sheideman #define	NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__)
4554750Sjohnh #else
4654893Sheideman #define	NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp)
4754750Sjohnh #endif
4854750Sjohnh 
4954754Sjohnh extern int (**null_vnodeop_p)();
5054754Sjohnh extern struct vfsops null_vfsops;
5154750Sjohnh #endif /* KERNEL */
5254767Sjohnh 
53