Illumos 5045 - use atomic_{inc,dec}_* instead of atomic_add_*

5045 use atomic_{inc,dec}_* instead of atomic_add_*
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>

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 <behlendorf1@llnl.gov>
Closes #4220
This commit is contained in:
Josef 'Jeff' Sipek
2016-01-13 16:37:41 -08:00
committed by Brian Behlendorf
parent e3e670d006
commit bc89ac8479
7 changed files with 70 additions and 73 deletions
+2 -2
View File
@@ -230,7 +230,7 @@ dbuf_hash_insert(dmu_buf_impl_t *db)
db->db_hash_next = h->hash_table[idx];
h->hash_table[idx] = db;
mutex_exit(DBUF_HASH_MUTEX(h, idx));
atomic_add_64(&dbuf_hash_count, 1);
atomic_inc_64(&dbuf_hash_count);
return (NULL);
}
@@ -266,7 +266,7 @@ dbuf_hash_remove(dmu_buf_impl_t *db)
*dbp = db->db_hash_next;
db->db_hash_next = NULL;
mutex_exit(DBUF_HASH_MUTEX(h, idx));
atomic_add_64(&dbuf_hash_count, -1);
atomic_dec_64(&dbuf_hash_count);
}
static arc_evict_func_t dbuf_do_evict;