svn commit: r364141 - in head/sys: kern sys

Mateusz Guzik mjg at FreeBSD.org
Wed Aug 12 04:53:21 UTC 2020


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);


More information about the svn-src-head mailing list