Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/vnode.h
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | struct vnode { | ||||
/* | /* | ||||
* Filesystem instance stuff | * Filesystem instance stuff | ||||
*/ | */ | ||||
struct mount *v_mount; /* u ptr to vfs we are in */ | struct mount *v_mount; /* u ptr to vfs we are in */ | ||||
TAILQ_ENTRY(vnode) v_nmntvnodes; /* m vnodes for mount point */ | TAILQ_ENTRY(vnode) v_nmntvnodes; /* m vnodes for mount point */ | ||||
/* | /* | ||||
* Type specific fields, only one applies to any given vnode. | * Type specific fields, only one applies to any given vnode. | ||||
* See #defines below for renaming to v_* namespace. | |||||
*/ | */ | ||||
union { | union { | ||||
struct mount *vu_mount; /* v ptr to mountpoint (VDIR) */ | struct mount *v_mountedhere; /* v ptr to mountpoint (VDIR) */ | ||||
struct socket *vu_socket; /* v unix domain net (VSOCK) */ | struct unpcb *v_unpcb; /* v unix domain net (VSOCK) */ | ||||
struct cdev *vu_cdev; /* v device (VCHR, VBLK) */ | struct cdev *v_rdev; /* v device (VCHR, VBLK) */ | ||||
struct fifoinfo *vu_fifoinfo; /* v fifo (VFIFO) */ | struct fifoinfo *v_fifoinfo; /* v fifo (VFIFO) */ | ||||
} v_un; | }; | ||||
/* | /* | ||||
* vfs_hash: (mount + inode) -> vnode hash. The hash value | * vfs_hash: (mount + inode) -> vnode hash. The hash value | ||||
* itself is grouped with other int fields, to avoid padding. | * itself is grouped with other int fields, to avoid padding. | ||||
*/ | */ | ||||
LIST_ENTRY(vnode) v_hashlist; | LIST_ENTRY(vnode) v_hashlist; | ||||
/* | /* | ||||
Show All 39 Lines | struct vnode { | ||||
u_int v_mflag; /* l mnt-specific vnode flags */ | u_int v_mflag; /* l mnt-specific vnode flags */ | ||||
int v_writecount; /* v ref count of writers */ | int v_writecount; /* v ref count of writers */ | ||||
u_int v_hash; | u_int v_hash; | ||||
enum vtype v_type; /* u vnode type */ | enum vtype v_type; /* u vnode type */ | ||||
}; | }; | ||||
#endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ | #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ | ||||
#define v_mountedhere v_un.vu_mount | |||||
#define v_socket v_un.vu_socket | |||||
#define v_rdev v_un.vu_cdev | |||||
#define v_fifoinfo v_un.vu_fifoinfo | |||||
#define bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) | #define bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) | ||||
/* XXX: These are temporary to avoid a source sweep at this time */ | /* XXX: These are temporary to avoid a source sweep at this time */ | ||||
#define v_object v_bufobj.bo_object | #define v_object v_bufobj.bo_object | ||||
/* | /* | ||||
* Userland version of struct vnode, for sysctl. | * Userland version of struct vnode, for sysctl. | ||||
*/ | */ | ||||
struct xvnode { | struct xvnode { | ||||
size_t xv_size; /* sizeof(struct xvnode) */ | size_t xv_size; /* sizeof(struct xvnode) */ | ||||
void *xv_vnode; /* address of real vnode */ | void *xv_vnode; /* address of real vnode */ | ||||
u_long xv_flag; /* vnode vflags */ | u_long xv_flag; /* vnode vflags */ | ||||
int xv_usecount; /* reference count of users */ | int xv_usecount; /* reference count of users */ | ||||
int xv_writecount; /* reference count of writers */ | int xv_writecount; /* reference count of writers */ | ||||
int xv_holdcnt; /* page & buffer references */ | int xv_holdcnt; /* page & buffer references */ | ||||
u_long xv_id; /* capability identifier */ | u_long xv_id; /* capability identifier */ | ||||
void *xv_mount; /* address of parent mount */ | void *xv_mount; /* address of parent mount */ | ||||
long xv_numoutput; /* num of writes in progress */ | long xv_numoutput; /* num of writes in progress */ | ||||
enum vtype xv_type; /* vnode type */ | enum vtype xv_type; /* vnode type */ | ||||
union { | union { | ||||
void *xvu_socket; /* socket, if VSOCK */ | void *xvu_socket; /* unpcb, if VSOCK */ | ||||
void *xvu_fifo; /* fifo, if VFIFO */ | void *xvu_fifo; /* fifo, if VFIFO */ | ||||
dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */ | dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */ | ||||
struct { | struct { | ||||
dev_t xvu_dev; /* device, if VDIR/VREG/VLNK */ | dev_t xvu_dev; /* device, if VDIR/VREG/VLNK */ | ||||
ino_t xvu_ino; /* id, if VDIR/VREG/VLNK */ | ino_t xvu_ino; /* id, if VDIR/VREG/VLNK */ | ||||
} xv_uns; | } xv_uns; | ||||
} xv_un; | } xv_un; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 675 Lines • Show Last 20 Lines |