| 2565 | } |
| 2566 | |
| 2567 | void |
| 2568 | fdescfree_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. |
no test coverage detected