diff options
author | Josef 'Jeff' Sipek <[email protected]> | 2016-01-13 16:37:41 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-01-15 15:38:36 -0800 |
commit | bc89ac8479c0b265c539b579fda2bef1997d423c (patch) | |
tree | b3133293ba8520485062165fae5b56d3bf97108b /include/sys/refcount.h | |
parent | e3e670d0061ff121293dafb37d1f14a7069d49d5 (diff) |
Illumos 5045 - use atomic_{inc,dec}_* instead of atomic_add_*
5045 use atomic_{inc,dec}_* instead of atomic_add_*
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Garrett D'Amore <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
References:
https://www.illumos.org/issues/5045
https://github.com/illumos/illumos-gate/commit/1a5e258
Porting notes:
- All changes to non-ZFS files dropped.
- Changes to zfs_vfsops.c dropped because they were Illumos specific.
Ported-by: Brian Behlendorf <[email protected]>
Closes #4220
Diffstat (limited to 'include/sys/refcount.h')
-rw-r--r-- | include/sys/refcount.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/refcount.h b/include/sys/refcount.h index b69c46cf7..d3f90fdc6 100644 --- a/include/sys/refcount.h +++ b/include/sys/refcount.h @@ -86,8 +86,8 @@ typedef struct refcount { #define refcount_destroy_many(rc, number) ((rc)->rc_count = 0) #define refcount_is_zero(rc) ((rc)->rc_count == 0) #define refcount_count(rc) ((rc)->rc_count) -#define refcount_add(rc, holder) atomic_add_64_nv(&(rc)->rc_count, 1) -#define refcount_remove(rc, holder) atomic_add_64_nv(&(rc)->rc_count, -1) +#define refcount_add(rc, holder) atomic_inc_64_nv(&(rc)->rc_count) +#define refcount_remove(rc, holder) atomic_dec_64_nv(&(rc)->rc_count) #define refcount_add_many(rc, number, holder) \ atomic_add_64_nv(&(rc)->rc_count, number) #define refcount_remove_many(rc, number, holder) \ |