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

Function pddrop

freebsd/kern/kern_descrip.c:2236–2258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2234}
2235
2236static void
2237pddrop(struct pwddesc *pdp)
2238{
2239 struct pwd *pwd;
2240
2241 if (refcount_release_if_not_last(&pdp->pd_refcount))
2242 return;
2243
2244 PWDDESC_XLOCK(pdp);
2245 if (refcount_release(&pdp->pd_refcount) == 0) {
2246 PWDDESC_XUNLOCK(pdp);
2247 return;
2248 }
2249 #pragma GCC diagnostic ignored "-Wcast-qual"
2250 pwd = PWDDESC_XLOCKED_LOAD_PWD(pdp);
2251 #pragma GCC diagnostic error "-Wcast-qual"
2252 pwd_set(pdp, NULL);
2253 PWDDESC_XUNLOCK(pdp);
2254 pwd_drop(pwd);
2255
2256 PWDDESC_LOCK_DESTROY(pdp);
2257 free(pdp, M_PWDDESC);
2258}
2259
2260/*
2261 * Share a filedesc structure.

Callers 5

pdescfreeFunction · 0.85
mountcheckdirsFunction · 0.85
kern_proc_filedesc_outFunction · 0.85
kern_proc_cwd_outFunction · 0.85

Calls 5

refcount_releaseFunction · 0.85
pwd_setFunction · 0.85
pwd_dropFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected