svn commit: r313268 - head/sys/kern
Mateusz Guzik
mjg at FreeBSD.org
Sun Feb 5 03:23:17 UTC 2017
Author: mjg
Date: Sun Feb 5 03:23:16 2017
New Revision: 313268
URL: https://svnweb.freebsd.org/changeset/base/313268
Log:
vfs: use atomic_fcmpset in vfs_refcount_*
Modified:
head/sys/kern/vfs_subr.c
Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c Sun Feb 5 02:49:42 2017 (r313267)
+++ head/sys/kern/vfs_subr.c Sun Feb 5 03:23:16 2017 (r313268)
@@ -2461,11 +2461,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);
}
}
@@ -2475,11 +2475,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