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

Function credbatch_add

freebsd/kern/kern_prot.c:1951–1975  ·  view source on GitHub ↗

* Batching. */

Source from the content-addressed store, hash-verified

1949 * Batching.
1950 */
1951void
1952credbatch_add(struct credbatch *crb, struct thread *td)
1953{
1954 struct ucred *cr;
1955
1956 MPASS(td->td_realucred != NULL);
1957 MPASS(td->td_realucred == td->td_ucred);
1958 MPASS(td->td_state == TDS_INACTIVE);
1959 cr = td->td_realucred;
1960 KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p",
1961 __func__, cr->cr_users, cr));
1962 if (crb->cred != cr) {
1963 if (crb->users > 0) {
1964 MPASS(crb->cred != NULL);
1965 crunusebatch(crb->cred, crb->users, crb->ref);
1966 crb->users = 0;
1967 crb->ref = 0;
1968 }
1969 }
1970 crb->cred = cr;
1971 crb->users++;
1972 crb->ref += td->td_ucredref;
1973 td->td_ucredref = 0;
1974 td->td_realucred = NULL;
1975}
1976
1977void
1978credbatch_final(struct credbatch *crb)

Callers 1

thread_reap_domainFunction · 0.85

Calls 1

crunusebatchFunction · 0.85

Tested by

no test coverage detected