* Remove a reference from this hdr. When the reference transitions from * 1 to 0 and we're not anonymous, then we add this hdr to the arc_state_t's * list making it eligible for eviction. */
| 2346 | * list making it eligible for eviction. |
| 2347 | */ |
| 2348 | static int |
| 2349 | remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) |
| 2350 | { |
| 2351 | int cnt; |
| 2352 | arc_state_t *state = hdr->b_l1hdr.b_state; |
| 2353 | |
| 2354 | ASSERT(HDR_HAS_L1HDR(hdr)); |
| 2355 | ASSERT(state == arc_anon || MUTEX_HELD(hash_lock)); |
| 2356 | ASSERT(!GHOST_STATE(state)); |
| 2357 | |
| 2358 | /* |
| 2359 | * arc_l2c_only counts as a ghost state so we don't need to explicitly |
| 2360 | * check to prevent usage of the arc_l2c_only list. |
| 2361 | */ |
| 2362 | if (((cnt = zfs_refcount_remove(&hdr->b_l1hdr.b_refcnt, tag)) == 0) && |
| 2363 | (state != arc_anon)) { |
| 2364 | multilist_insert(state->arcs_list[arc_buf_type(hdr)], hdr); |
| 2365 | ASSERT3U(hdr->b_l1hdr.b_bufcnt, >, 0); |
| 2366 | arc_evictable_space_increment(hdr, state); |
| 2367 | } |
| 2368 | return (cnt); |
| 2369 | } |
| 2370 | |
| 2371 | /* |
| 2372 | * Returns detailed information about a specific arc buffer. When the |
no test coverage detected