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

Function crcowget

freebsd/kern/kern_prot.c:1852–1863  ·  view source on GitHub ↗

* Credential management. * * struct ucred objects are rarely allocated but gain and lose references all * the time (e.g., on struct file alloc/dealloc) turning refcount updates into * a significant source of cache-line ping ponging. Common cases are worked * around by modifying thread-local counter instead if the cred to operate on * matches td_realucred. * * The counter is split into 2 pa

Source from the content-addressed store, hash-verified

1850 * accumulated updates.
1851 */
1852struct ucred *
1853crcowget(struct ucred *cr)
1854{
1855
1856 mtx_lock(&cr->cr_mtx);
1857 KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p",
1858 __func__, cr->cr_users, cr));
1859 cr->cr_users++;
1860 cr->cr_ref++;
1861 mtx_unlock(&cr->cr_mtx);
1862 return (cr);
1863}
1864
1865static struct ucred *
1866crunuse(struct thread *td)

Callers 5

crcowsyncFunction · 0.85
proc_set_cred_initFunction · 0.85
thread_cow_get_procFunction · 0.85
thread_cow_getFunction · 0.85
create_initFunction · 0.85

Calls 2

mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected