svn commit: r315373 - stable/11/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Mar 16 06:04:27 UTC 2017


Author: mjg
Date: Thu Mar 16 06:04:26 2017
New Revision: 315373
URL: https://svnweb.freebsd.org/changeset/base/315373

Log:
  MFC r313268:
  
  vfs: use atomic_fcmpset in vfs_refcount_*

Modified:
  stable/11/sys/kern/vfs_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_subr.c
==============================================================================
--- stable/11/sys/kern/vfs_subr.c	Thu Mar 16 06:03:27 2017	(r315372)
+++ stable/11/sys/kern/vfs_subr.c	Thu Mar 16 06:04:26 2017	(r315373)
@@ -2389,11 +2389,11 @@ vfs_refcount_acquire_if_not_zero(volatil
 {
 	u_int old;
 
+	old = *count;
 	for (;;) {
-		old = *count;
 		if (old == 0)
 			return (0);
-		if (atomic_cmpset_int(count, old, old + 1))
+		if (atomic_fcmpset_int(count, &old, old + 1))
 			return (1);
 	}
 }
@@ -2403,11 +2403,11 @@ vfs_refcount_release_if_not_last(volatil
 {
 	u_int old;
 
+	old = *count;
 	for (;;) {
-		old = *count;
 		if (old == 1)
 			return (0);
-		if (atomic_cmpset_int(count, old, old - 1))
+		if (atomic_fcmpset_int(count, &old, old - 1))
 			return (1);
 	}
 }


More information about the svn-src-all mailing list