Skip to content

Commit 73ad4a9

Browse files
Josef 'Jeff' Sipekbehlendorf
authored andcommitted
Illumos 5047 - don't use atomic_*_nv if you discard the return value
5047 don't use atomic_*_nv if you discard the return value Author: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> References: https://www.illumos.org/issues/5047 illumos/illumos-gate@640c167 Porting Notes: Several hunks from the original patch where not specific to ZFS and thus were dropped. Ported-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <ryao@gentoo.org> Issue #3172
1 parent 7f3e466 commit 73ad4a9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

module/zfs/dbuf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ dbuf_clear(dmu_buf_impl_t *db)
16471647
dndb = dn->dn_dbuf;
16481648
if (db->db_blkid != DMU_BONUS_BLKID && MUTEX_HELD(&dn->dn_dbufs_mtx)) {
16491649
list_remove(&dn->dn_dbufs, db);
1650-
(void) atomic_dec_32_nv(&dn->dn_dbufs_count);
1650+
atomic_dec_32(&dn->dn_dbufs_count);
16511651
membar_producer();
16521652
DB_DNODE_EXIT(db);
16531653
/*
@@ -1832,7 +1832,7 @@ dbuf_create(dnode_t *dn, uint8_t level, uint64_t blkid,
18321832
ASSERT(dn->dn_object == DMU_META_DNODE_OBJECT ||
18331833
refcount_count(&dn->dn_holds) > 0);
18341834
(void) refcount_add(&dn->dn_holds, db);
1835-
(void) atomic_inc_32_nv(&dn->dn_dbufs_count);
1835+
atomic_inc_32(&dn->dn_dbufs_count);
18361836

18371837
dprintf_dbuf(db, "db=%p\n", db);
18381838

@@ -1878,7 +1878,7 @@ dbuf_destroy(dmu_buf_impl_t *db)
18781878
dn = DB_DNODE(db);
18791879
mutex_enter(&dn->dn_dbufs_mtx);
18801880
list_remove(&dn->dn_dbufs, db);
1881-
(void) atomic_dec_32_nv(&dn->dn_dbufs_count);
1881+
atomic_dec_32(&dn->dn_dbufs_count);
18821882
mutex_exit(&dn->dn_dbufs_mtx);
18831883
DB_DNODE_EXIT(db);
18841884
/*
@@ -2207,7 +2207,7 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag)
22072207
* until the move completes.
22082208
*/
22092209
DB_DNODE_ENTER(db);
2210-
(void) atomic_dec_32_nv(&DB_DNODE(db)->dn_dbufs_count);
2210+
atomic_dec_32(&DB_DNODE(db)->dn_dbufs_count);
22112211
DB_DNODE_EXIT(db);
22122212
/*
22132213
* The bonus buffer's dnode hold is no longer discounted

module/zfs/dmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **dbp)
283283
/* as long as the bonus buf is held, the dnode will be held */
284284
if (refcount_add(&db->db_holds, tag) == 1) {
285285
VERIFY(dnode_add_ref(dn, db));
286-
(void) atomic_inc_32_nv(&dn->dn_dbufs_count);
286+
atomic_inc_32(&dn->dn_dbufs_count);
287287
}
288288

289289
/*

0 commit comments

Comments
 (0)