Date: Wed, 12 Aug 2020 04:53:20 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364141 - in head/sys: kern sys Message-ID: <202008120453.07C4rKPU065834@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Wed Aug 12 04:53:20 2020 New Revision: 364141 URL: https://svnweb.freebsd.org/changeset/base/364141 Log: vfs: inline vrefcnt Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 12 04:53:02 2020 (r364140) +++ head/sys/kern/vfs_subr.c Wed Aug 12 04:53:20 2020 (r364141) @@ -2952,22 +2952,6 @@ vrefact(struct vnode *vp) #endif } -/* - * Return reference count of a vnode. - * - * The results of this call are only guaranteed when some mechanism is used to - * stop other processes from gaining references to the vnode. This may be the - * case if the caller holds the only reference. This is also useful when stale - * data is acceptable as race conditions may be accounted for by some other - * means. - */ -int -vrefcnt(struct vnode *vp) -{ - - return (vp->v_usecount); -} - void vlazy(struct vnode *vp) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Aug 12 04:53:02 2020 (r364140) +++ head/sys/sys/vnode.h Wed Aug 12 04:53:20 2020 (r364141) @@ -967,8 +967,13 @@ void vrele(struct vnode *vp); void vref(struct vnode *vp); void vrefl(struct vnode *vp); void vrefact(struct vnode *vp); -int vrefcnt(struct vnode *vp); void v_addpollinfo(struct vnode *vp); +static __inline int +vrefcnt(struct vnode *vp) +{ + + return (vp->v_usecount); +} int vnode_create_vobject(struct vnode *vp, off_t size, struct thread *td); void vnode_destroy_vobject(struct vnode *vp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008120453.07C4rKPU065834>