MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zfs_refcount_add_many

Function zfs_refcount_add_many

freebsd/contrib/openzfs/module/zfs/refcount.c:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124int64_t
125zfs_refcount_add_many(zfs_refcount_t *rc, uint64_t number, const void *holder)
126{
127 reference_t *ref = NULL;
128 int64_t count;
129
130 if (rc->rc_tracked) {
131 ref = kmem_cache_alloc(reference_cache, KM_SLEEP);
132 ref->ref_holder = holder;
133 ref->ref_number = number;
134 }
135 mutex_enter(&rc->rc_mtx);
136 ASSERT3U(rc->rc_count, >=, 0);
137 if (rc->rc_tracked)
138 list_insert_head(&rc->rc_list, ref);
139 rc->rc_count += number;
140 count = rc->rc_count;
141 mutex_exit(&rc->rc_mtx);
142
143 return (count);
144}
145
146int64_t
147zfs_refcount_add(zfs_refcount_t *rc, const void *holder)

Callers 15

dmu_zfetchFunction · 0.85
dmu_tx_count_writeFunction · 0.85
dmu_tx_count_dnodeFunction · 0.85
dmu_tx_hold_free_implFunction · 0.85
dmu_tx_hold_zap_implFunction · 0.85
dmu_tx_hold_spaceFunction · 0.85
dmu_tx_hold_spillFunction · 0.85
abd_get_offset_implFunction · 0.85
abd_borrow_bufFunction · 0.85
arc_change_stateFunction · 0.85
arc_hdr_reallocFunction · 0.85

Calls 4

kmem_cache_allocFunction · 0.85
mutex_enterFunction · 0.85
mutex_exitFunction · 0.85
list_insert_headFunction · 0.50

Tested by

no test coverage detected