xref: /original-bsd/sys/miscfs/nullfs/null.h (revision 3705696b)
1 /*
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * All rights reserved.
5  *
6  * This code is derived from software donated to Berkeley by
7  * Jan-Simon Pendry.
8  *
9  * %sccs.include.redist.c%
10  *
11  *	@(#)null.h	8.1 (Berkeley) 06/10/93
12  *
13  * $Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp jsp $
14  */
15 
16 struct null_args {
17 	char		*target;	/* Target of loopback  */
18 };
19 
20 struct null_mount {
21 	struct mount	*nullm_vfs;
22 	struct vnode	*nullm_rootvp;	/* Reference to root null_node */
23 };
24 
25 #ifdef KERNEL
26 /*
27  * A cache of vnode references
28  */
29 struct null_node {
30 	struct null_node	*null_forw;	/* Hash chain */
31 	struct null_node	*null_back;
32 	struct vnode	        *null_lowervp;	/* VREFed once */
33 	struct vnode		*null_vnode;	/* Back pointer */
34 };
35 
36 extern int null_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
37 
38 #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
39 #define	VTONULL(vp) ((struct null_node *)(vp)->v_data)
40 #define	NULLTOV(xp) ((xp)->null_vnode)
41 #ifdef NULLFS_DIAGNOSTIC
42 extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
43 #define	NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__)
44 #else
45 #define	NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp)
46 #endif
47 
48 extern int (**null_vnodeop_p)();
49 extern struct vfsops null_vfsops;
50 #endif /* KERNEL */
51