Date: Thu, 16 Mar 2017 06:04:26 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315373 - stable/11/sys/kern Message-ID: <201703160604.v2G64Q8t070050@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703160604.v2G64Q8t070050>