xref: /original-bsd/sys/miscfs/nullfs/null.h (revision 333da485)
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.2 (Berkeley) 01/21/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 	struct null_node	*null_forw;	/* Hash chain */
30 	struct null_node	*null_back;
31 	struct vnode	        *null_lowervp;	/* VREFed once */
32 	struct vnode		*null_vnode;	/* Back pointer */
33 };
34 
35 extern int null_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
36 
37 #define	MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data))
38 #define	VTONULL(vp) ((struct null_node *)(vp)->v_data)
39 #define	NULLTOV(xp) ((xp)->null_vnode)
40 #ifdef NULLFS_DIAGNOSTIC
41 extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno));
42 #define	NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__)
43 #else
44 #define	NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp)
45 #endif
46 
47 extern int (**null_vnodeop_p)();
48 extern struct vfsops null_vfsops;
49 #endif /* KERNEL */
50