From d32314913212d4ec68aaa8a62a04f57c5f4c3cf2 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Wed, 20 Aug 2014 06:25:43 +0000 Subject: [PATCH] 5047 don't use atomic_*_nv if you discard the return value Reviewed by: Garrett D'Amore Reviewed by: Jason King Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Josef 'Jeff' Sipek illumos/illumos-gate@640c1670a105457bb0040e8e11037b53ab6ebcfa --- uts/common/fs/zfs/dbuf.c | 8 ++++---- uts/common/fs/zfs/dmu.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uts/common/fs/zfs/dbuf.c b/uts/common/fs/zfs/dbuf.c index a56372197cd..f793192fd3c 100644 --- a/uts/common/fs/zfs/dbuf.c +++ b/uts/common/fs/zfs/dbuf.c @@ -1605,7 +1605,7 @@ dbuf_clear(dmu_buf_impl_t *db) dndb = dn->dn_dbuf; if (db->db_blkid != DMU_BONUS_BLKID && MUTEX_HELD(&dn->dn_dbufs_mtx)) { avl_remove(&dn->dn_dbufs, db); - (void) atomic_dec_32_nv(&dn->dn_dbufs_count); + atomic_dec_32(&dn->dn_dbufs_count); membar_producer(); DB_DNODE_EXIT(db); /* @@ -1781,7 +1781,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid, ASSERT(dn->dn_object == DMU_META_DNODE_OBJECT || refcount_count(&dn->dn_holds) > 0); (void) refcount_add(&dn->dn_holds, db); - (void) atomic_inc_32_nv(&dn->dn_dbufs_count); + atomic_inc_32(&dn->dn_dbufs_count); dprintf_dbuf(db, "db=%p\n", db); @@ -1827,7 +1827,7 @@ dbuf_destroy(dmu_buf_impl_t *db) dn = DB_DNODE(db); mutex_enter(&dn->dn_dbufs_mtx); avl_remove(&dn->dn_dbufs, db); - (void) atomic_dec_32_nv(&dn->dn_dbufs_count); + atomic_dec_32(&dn->dn_dbufs_count); mutex_exit(&dn->dn_dbufs_mtx); DB_DNODE_EXIT(db); /* @@ -2111,7 +2111,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag) * until the move completes. */ DB_DNODE_ENTER(db); - (void) atomic_dec_32_nv(&DB_DNODE(db)->dn_dbufs_count); + atomic_dec_32(&DB_DNODE(db)->dn_dbufs_count); DB_DNODE_EXIT(db); /* * The bonus buffer's dnode hold is no longer discounted diff --git a/uts/common/fs/zfs/dmu.c b/uts/common/fs/zfs/dmu.c index ff67a894bc2..619b3b4aa45 100644 --- a/uts/common/fs/zfs/dmu.c +++ b/uts/common/fs/zfs/dmu.c @@ -284,7 +284,7 @@ dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **dbp) /* as long as the bonus buf is held, the dnode will be held */ if (refcount_add(&db->db_holds, tag) == 1) { VERIFY(dnode_add_ref(dn, db)); - (void) atomic_inc_32_nv(&dn->dn_dbufs_count); + atomic_inc_32(&dn->dn_dbufs_count); } /*