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

Function zio_buf_alloc

freebsd/contrib/openzfs/module/zfs/zio.c:321–332  ·  view source on GitHub ↗

* Use zio_buf_alloc to allocate ZFS metadata. This data will appear in a * crashdump if the kernel panics, so use it judiciously. Obviously, it's * useful to inspect ZFS metadata, but if possible, we should avoid keeping * excess / transient data in-core during a crashdump. */

Source from the content-addressed store, hash-verified

319 * excess / transient data in-core during a crashdump.
320 */
321void *
322zio_buf_alloc(size_t size)
323{
324 size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
325
326 VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
327#if defined(ZFS_DEBUG) && !defined(_KERNEL)
328 atomic_add_64(&zio_buf_cache_allocs[c], 1);
329#endif
330
331 return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE));
332}
333
334/*
335 * Use zio_data_buf_alloc to allocate data. The data will not appear in a

Callers 15

zio_crypt_init_uios_zilFunction · 0.85
zio_crypt_init_uios_zilFunction · 0.85
raidz_reconstructFunction · 0.85
abd_alloc_linearFunction · 0.85
abd_borrow_bufFunction · 0.85
arc_hdr_authenticateFunction · 0.85
arc_get_data_bufFunction · 0.85
l2arc_log_blk_commitFunction · 0.85
zio_decryptFunction · 0.85

Calls 2

kmem_cache_allocFunction · 0.85
atomic_add_64Function · 0.50

Tested by

no test coverage detected