aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-02-05 03:23:16 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-02-05 03:23:16 +0000
commit2d78a5531ef1ac9bd45e67b7a04dee2f52e1f224 (patch)
tree26a0cf4dc13571ec8af401cf4c179b9b1990c21a /sys/kern/vfs_subr.c
parent9613442e8388c66a89997769bc09af94b64e77cb (diff)
downloadsrc-2d78a5531ef1ac9bd45e67b7a04dee2f52e1f224.tar.gz
src-2d78a5531ef1ac9bd45e67b7a04dee2f52e1f224.zip
vfs: use atomic_fcmpset in vfs_refcount_*
Notes
Notes: svn path=/head/; revision=313268
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 792fbb610a84..039d06829e2c 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2461,11 +2461,11 @@ vfs_refcount_acquire_if_not_zero(volatile u_int *count)
{
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(volatile u_int *count)
{
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);
}
}