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

Function l2arc_write_eligible

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

Source from the content-addressed store, hash-verified

8012 */
8013
8014static boolean_t
8015l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *hdr)
8016{
8017 /*
8018 * A buffer is *not* eligible for the L2ARC if it:
8019 * 1. belongs to a different spa.
8020 * 2. is already cached on the L2ARC.
8021 * 3. has an I/O in progress (it may be an incomplete read).
8022 * 4. is flagged not eligible (zfs property).
8023 */
8024 if (hdr->b_spa != spa_guid || HDR_HAS_L2HDR(hdr) ||
8025 HDR_IO_IN_PROGRESS(hdr) || !HDR_L2CACHE(hdr))
8026 return (B_FALSE);
8027
8028 return (B_TRUE);
8029}
8030
8031static uint64_t
8032l2arc_write_size(l2arc_dev_t *dev)

Callers 2

arc_evict_hdrFunction · 0.85
l2arc_write_buffersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected