* 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. */
| 3625 | * The buf is returned thawed since we expect the consumer to modify it. |
| 3626 | */ |
| 3627 | arc_buf_t * |
| 3628 | arc_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 |
no test coverage detected