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

Function arc_alloc_buf

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

* Allocate a new arc_buf_hdr_t and arc_buf_t and return the buf to the caller. * The buf is returned thawed since we expect the consumer to modify it. */

Source from the content-addressed store, hash-verified

3625 * The buf is returned thawed since we expect the consumer to modify it.
3626 */
3627arc_buf_t *
3628arc_alloc_buf(spa_t *spa, void *tag, arc_buf_contents_t type, int32_t size)
3629{
3630 arc_buf_hdr_t *hdr = arc_hdr_alloc(spa_load_guid(spa), size, size,
3631 B_FALSE, ZIO_COMPRESS_OFF, 0, type, B_FALSE);
3632
3633 arc_buf_t *buf = NULL;
3634 VERIFY0(arc_buf_alloc_impl(hdr, spa, NULL, tag, B_FALSE, B_FALSE,
3635 B_FALSE, B_FALSE, &buf));
3636 arc_buf_thaw(buf);
3637
3638 return (buf);
3639}
3640
3641/*
3642 * Allocate a compressed buf in the same manner as arc_alloc_buf. Don't use this

Callers 6

arc_loan_bufFunction · 0.85
dbuf_alloc_arcbufFunction · 0.85
dbuf_new_sizeFunction · 0.85
do_dumpFunction · 0.85
dmu_objset_open_implFunction · 0.85

Calls 4

arc_hdr_allocFunction · 0.85
spa_load_guidFunction · 0.85
arc_buf_alloc_implFunction · 0.85
arc_buf_thawFunction · 0.85

Tested by

no test coverage detected