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

Function abd_borrow_buf

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

* Borrow a raw buffer from an ABD without copying the contents of the ABD * into the buffer. If the ABD is scattered, this will allocate a raw buffer * whose contents are undefined. To copy over the existing data in the ABD, use * abd_borrow_buf_copy() instead. */

Source from the content-addressed store, hash-verified

635 * abd_borrow_buf_copy() instead.
636 */
637void *
638abd_borrow_buf(abd_t *abd, size_t n)
639{
640 void *buf;
641 abd_verify(abd);
642 ASSERT3U(abd->abd_size, >=, n);
643 if (abd_is_linear(abd)) {
644 buf = abd_to_buf(abd);
645 } else {
646 buf = zio_buf_alloc(n);
647 }
648 (void) zfs_refcount_add_many(&abd->abd_children, n, buf);
649 return (buf);
650}
651
652void *
653abd_borrow_buf_copy(abd_t *abd, size_t n)

Callers 12

vdev_geom_io_startFunction · 0.85
vdev_file_io_strategyFunction · 0.85
zio_do_crypt_abdFunction · 0.85
vdev_file_io_strategyFunction · 0.85
zio_do_crypt_abdFunction · 0.85
abd_borrow_buf_copyFunction · 0.85
spa_do_crypt_abdFunction · 0.85
arc_hdr_decryptFunction · 0.85
l2arc_untransformFunction · 0.85
l2arc_apply_transformsFunction · 0.85
zio_decompressFunction · 0.85
zio_read_bp_initFunction · 0.85

Calls 5

abd_verifyFunction · 0.85
abd_is_linearFunction · 0.85
abd_to_bufFunction · 0.85
zio_buf_allocFunction · 0.85
zfs_refcount_add_manyFunction · 0.85

Tested by

no test coverage detected