| 122 | } |
| 123 | |
| 124 | int64_t |
| 125 | zfs_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 | |
| 146 | int64_t |
| 147 | zfs_refcount_add(zfs_refcount_t *rc, const void *holder) |
no test coverage detected