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

Function abd_get_from_buf

freebsd/contrib/openzfs/module/zfs/abd.c:598–618  ·  view source on GitHub ↗

* Allocate a linear ABD structure for buf. You must free this with abd_put() * since the resulting ABD doesn't own its own buffer. */

Source from the content-addressed store, hash-verified

596 * since the resulting ABD doesn't own its own buffer.
597 */
598abd_t *
599abd_get_from_buf(void *buf, size_t size)
600{
601 abd_t *abd = abd_alloc_struct(0);
602
603 VERIFY3U(size, <=, SPA_MAXBLOCKSIZE);
604
605 /*
606 * Even if this buf is filesystem metadata, we only track that if we
607 * own the underlying data buffer, which is not true in this case.
608 * Therefore, we don't ever use ABD_FLAG_META here.
609 */
610 abd->abd_flags = ABD_FLAG_LINEAR;
611 abd->abd_size = size;
612 abd->abd_parent = NULL;
613 zfs_refcount_create(&abd->abd_children);
614
615 ABD_LINEAR_BUF(abd) = buf;
616
617 return (abd);
618}
619
620/*
621 * Get the raw buffer associated with a linear ABD.

Callers 15

arc_hdr_authenticateFunction · 0.85
arc_share_bufFunction · 0.85
arc_writeFunction · 0.85
l2arc_dev_hdr_readFunction · 0.85
l2arc_log_blk_fetchFunction · 0.85
l2arc_dev_hdr_updateFunction · 0.85
l2arc_log_blk_commitFunction · 0.85
dbuf_writeFunction · 0.85
dmu_sync_late_arrivalFunction · 0.85
zio_write_compressFunction · 0.85
zio_rewrite_gangFunction · 0.85
zio_gang_tree_assembleFunction · 0.85

Calls 2

zfs_refcount_createFunction · 0.85
abd_alloc_structFunction · 0.50

Tested by

no test coverage detected