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

Function arc_free_data_impl

freebsd/contrib/openzfs/module/zfs/arc.c:5389–5412  ·  view source on GitHub ↗

* Free the arc data buffer. */

Source from the content-addressed store, hash-verified

5387 * Free the arc data buffer.
5388 */
5389static void
5390arc_free_data_impl(arc_buf_hdr_t *hdr, uint64_t size, void *tag)
5391{
5392 arc_state_t *state = hdr->b_l1hdr.b_state;
5393 arc_buf_contents_t type = arc_buf_type(hdr);
5394
5395 /* protected by hash lock, if in the hash table */
5396 if (multilist_link_active(&hdr->b_l1hdr.b_arc_node)) {
5397 ASSERT(zfs_refcount_is_zero(&hdr->b_l1hdr.b_refcnt));
5398 ASSERT(state != arc_anon && state != arc_l2c_only);
5399
5400 (void) zfs_refcount_remove_many(&state->arcs_esize[type],
5401 size, tag);
5402 }
5403 (void) zfs_refcount_remove_many(&state->arcs_size, size, tag);
5404
5405 VERIFY3U(hdr->b_type, ==, type);
5406 if (type == ARC_BUFC_METADATA) {
5407 arc_space_return(size, ARC_SPACE_META);
5408 } else {
5409 ASSERT(type == ARC_BUFC_DATA);
5410 arc_space_return(size, ARC_SPACE_DATA);
5411 }
5412}
5413
5414/*
5415 * This routine is called whenever a buffer is accessed.

Callers 2

arc_free_data_abdFunction · 0.85
arc_free_data_bufFunction · 0.85

Calls 5

arc_buf_typeFunction · 0.85
multilist_link_activeFunction · 0.85
zfs_refcount_is_zeroFunction · 0.85
zfs_refcount_remove_manyFunction · 0.85
arc_space_returnFunction · 0.85

Tested by

no test coverage detected