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

Function fdescfree_adapt_use

freebsd/kern/kern_descrip.c:2567–2593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2565}
2566
2567void
2568fdescfree_adapt_use(struct thread *td)
2569{
2570 struct proc *p;
2571 struct filedesc *fdp;
2572
2573 p = td->td_proc;
2574 fdp = p->p_fd;
2575 MPASS(fdp != NULL);
2576
2577#ifdef RACCT
2578 if (RACCT_ENABLED())
2579 racct_set_unlocked(p, RACCT_NOFILE, 0);
2580#endif
2581
2582 if (p->p_fdtol != NULL)
2583 fdclearlocks(td);
2584
2585 if (refcount_release(&fdp->fd_refcnt) == 0)
2586 return;
2587
2588 fdescfree_fds_adapt_use(td, fdp, 1);
2589
2590 PROC_LOCK(p);
2591 p->p_fd = NULL;
2592 PROC_UNLOCK(p);
2593}
2594
2595/*
2596 * Release a filedesc structure.

Callers 1

ff_adapt_user_proc_exitFunction · 0.85

Calls 4

racct_set_unlockedFunction · 0.85
fdclearlocksFunction · 0.85
refcount_releaseFunction · 0.85
fdescfree_fds_adapt_useFunction · 0.85

Tested by

no test coverage detected