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

Function cache_alloc_uma

freebsd/kern/vfs_cache.c:605–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605static struct namecache *
606cache_alloc_uma(int len, bool ts)
607{
608 struct namecache_ts *ncp_ts;
609 struct namecache *ncp;
610
611 if (__predict_false(ts)) {
612 if (len <= CACHE_PATH_CUTOFF)
613 ncp_ts = uma_zalloc_smr(cache_zone_small_ts, M_WAITOK);
614 else
615 ncp_ts = uma_zalloc_smr(cache_zone_large_ts, M_WAITOK);
616 ncp = &ncp_ts->nc_nc;
617 } else {
618 if (len <= CACHE_PATH_CUTOFF)
619 ncp = uma_zalloc_smr(cache_zone_small, M_WAITOK);
620 else
621 ncp = uma_zalloc_smr(cache_zone_large, M_WAITOK);
622 }
623 return (ncp);
624}
625
626static void
627cache_free_uma(struct namecache *ncp)

Callers 1

cache_allocFunction · 0.85

Calls 1

uma_zalloc_smrFunction · 0.85

Tested by

no test coverage detected