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

Function crunusebatch

freebsd/kern/kern_prot.c:1891–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1889}
1890
1891static void
1892crunusebatch(struct ucred *cr, int users, int ref)
1893{
1894
1895 KASSERT(users > 0, ("%s: passed users %d not > 0 ; cred %p",
1896 __func__, users, cr));
1897 mtx_lock(&cr->cr_mtx);
1898 KASSERT(cr->cr_users >= users, ("%s: users %d not > %d on cred %p",
1899 __func__, cr->cr_users, users, cr));
1900 cr->cr_users -= users;
1901 cr->cr_ref += ref;
1902 cr->cr_ref -= users;
1903 if (cr->cr_users > 0) {
1904 mtx_unlock(&cr->cr_mtx);
1905 return;
1906 }
1907 KASSERT(cr->cr_ref >= 0, ("%s: ref %d not >= 0 on cred %p",
1908 __func__, cr->cr_ref, cr));
1909 if (cr->cr_ref > 0) {
1910 mtx_unlock(&cr->cr_mtx);
1911 return;
1912 }
1913 crfree_final(cr);
1914}
1915
1916void
1917crcowfree(struct thread *td)

Callers 2

credbatch_addFunction · 0.85
credbatch_finalFunction · 0.85

Calls 3

crfree_finalFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected