Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nullfs/null.h
| Show All 31 Lines | |||||
| * SUCH DAMAGE. | * SUCH DAMAGE. | ||||
| */ | */ | ||||
| #ifndef FS_NULL_H | #ifndef FS_NULL_H | ||||
| #define FS_NULL_H | #define FS_NULL_H | ||||
| #define NULLM_CACHE 0x0001 | #define NULLM_CACHE 0x0001 | ||||
| #include <vm/uma.h> | |||||
| #include <sys/ck.h> | |||||
| struct null_mount { | struct null_mount { | ||||
| struct mount *nullm_vfs; | struct mount *nullm_vfs; | ||||
| struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ | struct vnode *nullm_lowerrootvp; /* Ref to lower root vnode */ | ||||
| uint64_t nullm_flags; | uint64_t nullm_flags; | ||||
| struct mount_upper_node upper_node; | struct mount_upper_node upper_node; | ||||
| struct mount_upper_node notify_node; | struct mount_upper_node notify_node; | ||||
| }; | }; | ||||
| #ifdef _KERNEL | #ifdef _KERNEL | ||||
| /* | /* | ||||
| * A cache of vnode references | * A cache of vnode references | ||||
| */ | */ | ||||
| struct null_node { | struct null_node { | ||||
| LIST_ENTRY(null_node) null_hash; /* Hash list */ | CK_LIST_ENTRY(null_node) null_hash; /* Hash list */ | ||||
| struct vnode *null_lowervp; /* VREFed once */ | struct vnode *null_lowervp; /* VREFed once */ | ||||
| struct vnode *null_vnode; /* Back pointer */ | struct vnode *null_vnode; /* Back pointer */ | ||||
| u_int null_flags; | u_int null_flags; | ||||
| }; | }; | ||||
| #define NULLV_NOUNLOCK 0x0001 | #define NULLV_NOUNLOCK 0x0001 | ||||
| #define NULLV_DROP 0x0002 | #define NULLV_DROP 0x0002 | ||||
| #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) | #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) | ||||
| #define VTONULL(vp) ((struct null_node *)(vp)->v_data) | #define VTONULL(vp) ((struct null_node *)(vp)->v_data) | ||||
| #define VTONULL_SMR(vp) ((struct null_node *)vn_load_v_data_smr(vp)) | |||||
| #define NULLTOV(xp) ((xp)->null_vnode) | #define NULLTOV(xp) ((xp)->null_vnode) | ||||
| int nullfs_init(struct vfsconf *vfsp); | int nullfs_init(struct vfsconf *vfsp); | ||||
| int nullfs_uninit(struct vfsconf *vfsp); | int nullfs_uninit(struct vfsconf *vfsp); | ||||
| int null_nodeget(struct mount *mp, struct vnode *target, struct vnode **vpp); | int null_nodeget(struct mount *mp, struct vnode *target, struct vnode **vpp); | ||||
| struct vnode *null_hashget(struct mount *mp, struct vnode *lowervp); | struct vnode *null_hashget(struct mount *mp, struct vnode *lowervp); | ||||
| void null_hashrem(struct null_node *xp); | void null_hashrem(struct null_node *xp); | ||||
| int null_bypass(struct vop_generic_args *ap); | int null_bypass(struct vop_generic_args *ap); | ||||
| #ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
| struct vnode *null_checkvp(struct vnode *vp, char *fil, int lno); | struct vnode *null_checkvp(struct vnode *vp, char *fil, int lno); | ||||
| #define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) | #define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) | ||||
| #else | #else | ||||
| #define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp) | #define NULLVPTOLOWERVP(vp) (VTONULL(vp)->null_lowervp) | ||||
| #endif | #endif | ||||
| extern struct vop_vector null_vnodeops; | extern struct vop_vector null_vnodeops; | ||||
| #ifdef MALLOC_DECLARE | extern uma_zone_t null_node_zone; | ||||
| MALLOC_DECLARE(M_NULLFSNODE); | |||||
| #endif | |||||
| #ifdef NULLFS_DEBUG | #ifdef NULLFS_DEBUG | ||||
| #define NULLFSDEBUG(format, args...) printf(format ,## args) | #define NULLFSDEBUG(format, args...) printf(format ,## args) | ||||
| #else | #else | ||||
| #define NULLFSDEBUG(format, args...) | #define NULLFSDEBUG(format, args...) | ||||
| #endif /* NULLFS_DEBUG */ | #endif /* NULLFS_DEBUG */ | ||||
| #endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
| #endif | #endif | ||||