154750Sjohnh /* 263245Sbostic * Copyright (c) 1992, 1993 363245Sbostic * The Regents of the University of California. All rights reserved. 454750Sjohnh * 554750Sjohnh * This code is derived from software donated to Berkeley by 654750Sjohnh * Jan-Simon Pendry. 754750Sjohnh * 854750Sjohnh * %sccs.include.redist.c% 954750Sjohnh * 10*67716Smckusick * @(#)null.h 8.3 (Berkeley) 08/20/94 1154750Sjohnh * 1254750Sjohnh * $Id: lofs.h,v 1.8 1992/05/30 10:05:43 jsp Exp jsp $ 1354750Sjohnh */ 1454750Sjohnh 1554754Sjohnh struct null_args { 1654750Sjohnh char *target; /* Target of loopback */ 1754750Sjohnh }; 1854750Sjohnh 1954754Sjohnh struct null_mount { 2054754Sjohnh struct mount *nullm_vfs; 2154754Sjohnh struct vnode *nullm_rootvp; /* Reference to root null_node */ 2254750Sjohnh }; 2354750Sjohnh 2454750Sjohnh #ifdef KERNEL 2554750Sjohnh /* 2654750Sjohnh * A cache of vnode references 2754750Sjohnh */ 2854754Sjohnh struct null_node { 29*67716Smckusick LIST_ENTRY(null_node) null_hash; /* Hash list */ 3054944Sheideman struct vnode *null_lowervp; /* VREFed once */ 3154944Sheideman struct vnode *null_vnode; /* Back pointer */ 3254750Sjohnh }; 3354750Sjohnh 3454893Sheideman extern int null_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp)); 3554750Sjohnh 3654754Sjohnh #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) 3754767Sjohnh #define VTONULL(vp) ((struct null_node *)(vp)->v_data) 3854938Sheideman #define NULLTOV(xp) ((xp)->null_vnode) 3954754Sjohnh #ifdef NULLFS_DIAGNOSTIC 4054754Sjohnh extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno)); 4154893Sheideman #define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) 4254750Sjohnh #else 4354893Sheideman #define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp) 4454750Sjohnh #endif 4554750Sjohnh 4654754Sjohnh extern int (**null_vnodeop_p)(); 4754754Sjohnh extern struct vfsops null_vfsops; 4854750Sjohnh #endif /* KERNEL */ 49