Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/vnode.h
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | struct vnode { | ||||
daddr_t v_lastw; /* v last write */ | daddr_t v_lastw; /* v last write */ | ||||
int v_clen; /* v length of cur. cluster */ | int v_clen; /* v length of cur. cluster */ | ||||
u_int v_holdcnt; /* I prevents recycling. */ | u_int v_holdcnt; /* I prevents recycling. */ | ||||
u_int v_usecount; /* I ref count of users */ | u_int v_usecount; /* I ref count of users */ | ||||
u_int v_iflag; /* i vnode flags (see below) */ | u_int v_iflag; /* i vnode flags (see below) */ | ||||
u_int v_vflag; /* v vnode flags */ | u_int v_vflag; /* v vnode flags */ | ||||
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; /* I ref count of writers or | ||||
(negative) text users */ | |||||
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 bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) | #define bo2vnode(bo) __containerof((bo), struct vnode, v_bufobj) | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
#define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ | #define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ | ||||
#define VI_OWEINACT 0x1000 /* Need to call inactive */ | #define VI_OWEINACT 0x1000 /* Need to call inactive */ | ||||
#define VV_ROOT 0x0001 /* root of its filesystem */ | #define VV_ROOT 0x0001 /* root of its filesystem */ | ||||
#define VV_ISTTY 0x0002 /* vnode represents a tty */ | #define VV_ISTTY 0x0002 /* vnode represents a tty */ | ||||
#define VV_NOSYNC 0x0004 /* unlinked, stop syncing */ | #define VV_NOSYNC 0x0004 /* unlinked, stop syncing */ | ||||
#define VV_ETERNALDEV 0x0008 /* device that is never destroyed */ | #define VV_ETERNALDEV 0x0008 /* device that is never destroyed */ | ||||
#define VV_CACHEDLABEL 0x0010 /* Vnode has valid cached MAC label */ | #define VV_CACHEDLABEL 0x0010 /* Vnode has valid cached MAC label */ | ||||
#define VV_TEXT 0x0020 /* vnode is a pure text prototype */ | |||||
#define VV_COPYONWRITE 0x0040 /* vnode is doing copy-on-write */ | #define VV_COPYONWRITE 0x0040 /* vnode is doing copy-on-write */ | ||||
#define VV_SYSTEM 0x0080 /* vnode being used by kernel */ | #define VV_SYSTEM 0x0080 /* vnode being used by kernel */ | ||||
#define VV_PROCDEP 0x0100 /* vnode is process dependent */ | #define VV_PROCDEP 0x0100 /* vnode is process dependent */ | ||||
#define VV_NOKNOTE 0x0200 /* don't activate knotes on this vnode */ | #define VV_NOKNOTE 0x0200 /* don't activate knotes on this vnode */ | ||||
#define VV_DELETED 0x0400 /* should be removed */ | #define VV_DELETED 0x0400 /* should be removed */ | ||||
#define VV_MD 0x0800 /* vnode backs the md device */ | #define VV_MD 0x0800 /* vnode backs the md device */ | ||||
#define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ | #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ | ||||
#define VV_READLINK 0x2000 /* fdescfs linux vnode */ | #define VV_READLINK 0x2000 /* fdescfs linux vnode */ | ||||
▲ Show 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | |||||
int vop_nopoll(struct vop_poll_args *); | int vop_nopoll(struct vop_poll_args *); | ||||
int vop_stdaccess(struct vop_access_args *ap); | int vop_stdaccess(struct vop_access_args *ap); | ||||
int vop_stdaccessx(struct vop_accessx_args *ap); | int vop_stdaccessx(struct vop_accessx_args *ap); | ||||
int vop_stdadvise(struct vop_advise_args *ap); | int vop_stdadvise(struct vop_advise_args *ap); | ||||
int vop_stdadvlock(struct vop_advlock_args *ap); | int vop_stdadvlock(struct vop_advlock_args *ap); | ||||
int vop_stdadvlockasync(struct vop_advlockasync_args *ap); | int vop_stdadvlockasync(struct vop_advlockasync_args *ap); | ||||
int vop_stdadvlockpurge(struct vop_advlockpurge_args *ap); | int vop_stdadvlockpurge(struct vop_advlockpurge_args *ap); | ||||
int vop_stdallocate(struct vop_allocate_args *ap); | int vop_stdallocate(struct vop_allocate_args *ap); | ||||
int vop_stdset_text(struct vop_set_text_args *ap); | |||||
int vop_stdpathconf(struct vop_pathconf_args *); | int vop_stdpathconf(struct vop_pathconf_args *); | ||||
int vop_stdpoll(struct vop_poll_args *); | int vop_stdpoll(struct vop_poll_args *); | ||||
int vop_stdvptocnp(struct vop_vptocnp_args *ap); | int vop_stdvptocnp(struct vop_vptocnp_args *ap); | ||||
int vop_stdvptofh(struct vop_vptofh_args *ap); | int vop_stdvptofh(struct vop_vptofh_args *ap); | ||||
int vop_stdunp_bind(struct vop_unp_bind_args *ap); | int vop_stdunp_bind(struct vop_unp_bind_args *ap); | ||||
int vop_stdunp_connect(struct vop_unp_connect_args *ap); | int vop_stdunp_connect(struct vop_unp_connect_args *ap); | ||||
int vop_stdunp_detach(struct vop_unp_detach_args *ap); | int vop_stdunp_detach(struct vop_unp_detach_args *ap); | ||||
int vop_eopnotsupp(struct vop_generic_args *ap); | int vop_eopnotsupp(struct vop_generic_args *ap); | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | #define VOP_WRITE_POST(ap, ret) \ | ||||
noffset = (ap)->a_uio->uio_offset; \ | noffset = (ap)->a_uio->uio_offset; \ | ||||
if (noffset > ooffset && !VN_KNLIST_EMPTY((ap)->a_vp)) { \ | if (noffset > ooffset && !VN_KNLIST_EMPTY((ap)->a_vp)) { \ | ||||
VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE \ | VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE \ | ||||
| (noffset > osize ? NOTE_EXTEND : 0)); \ | | (noffset > osize ? NOTE_EXTEND : 0)); \ | ||||
} | } | ||||
#define VOP_LOCK(vp, flags) VOP_LOCK1(vp, flags, __FILE__, __LINE__) | #define VOP_LOCK(vp, flags) VOP_LOCK1(vp, flags, __FILE__, __LINE__) | ||||
#ifdef INVARIANTS | |||||
#define VOP_ADD_WRITECOUNT_SUCCEED(vp, cnt) \ | |||||
markj: I think _CHECKED is a more common suffix for this type of wrapper, e.g. | |||||
do { \ | |||||
int error_; \ | |||||
\ | |||||
error_ = VOP_ADD_WRITECOUNT((vp), (cnt)); \ | |||||
MPASS(error_ == 0); \ | |||||
} while (0) | |||||
#define VOP_SET_TEXT_SUCCEED(vp) \ | |||||
do { \ | |||||
int error_; \ | |||||
\ | |||||
error_ = VOP_SET_TEXT((vp)); \ | |||||
MPASS(error_ == 0); \ | |||||
} while (0) | |||||
#define VOP_UNSET_TEXT_SUCCEED(vp) \ | |||||
do { \ | |||||
int error_; \ | |||||
\ | |||||
error_ = VOP_UNSET_TEXT((vp)); \ | |||||
MPASS(error_ == 0); \ | |||||
} while (0) | |||||
#else | |||||
#define VOP_ADD_WRITECOUNT_SUCCEED(vp, cnt) VOP_ADD_WRITECOUNT((vp), (cnt)) | |||||
#define VOP_SET_TEXT_SUCCEED(vp) VOP_SET_TEXT((vp)) | |||||
#define VOP_UNSET_TEXT_SUCCEED(vp) VOP_UNSET_TEXT((vp)) | |||||
#endif | |||||
void vput(struct vnode *vp); | void vput(struct vnode *vp); | ||||
void vrele(struct vnode *vp); | void vrele(struct vnode *vp); | ||||
void vref(struct vnode *vp); | void vref(struct vnode *vp); | ||||
void vrefl(struct vnode *vp); | void vrefl(struct vnode *vp); | ||||
void vrefact(struct vnode *vp); | void vrefact(struct vnode *vp); | ||||
int vrefcnt(struct vnode *vp); | int vrefcnt(struct vnode *vp); | ||||
void v_addpollinfo(struct vnode *vp); | void v_addpollinfo(struct vnode *vp); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
I think _CHECKED is a more common suffix for this type of wrapper, e.g., pmap_pcid_alloc_checked(), vm_page_replace_checked().