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