* Handle the last reference to a file being closed. * * Without the noinline attribute clang keeps inlining the func thorough this * file when fdrop is used. */
| 3593 | * file when fdrop is used. |
| 3594 | */ |
| 3595 | int __noinline |
| 3596 | _fdrop(struct file *fp, struct thread *td) |
| 3597 | { |
| 3598 | int error; |
| 3599 | #ifdef INVARIANTS |
| 3600 | int count; |
| 3601 | |
| 3602 | count = refcount_load(&fp->f_count); |
| 3603 | if (count != 0) |
| 3604 | panic("fdrop: fp %p count %d", fp, count); |
| 3605 | #endif |
| 3606 | error = fo_close(fp, td); |
| 3607 | atomic_subtract_int(&openfiles, 1); |
| 3608 | crfree(fp->f_cred); |
| 3609 | free(fp->f_advice, M_FADVISE); |
| 3610 | uma_zfree(file_zone, fp); |
| 3611 | |
| 3612 | return (error); |
| 3613 | } |
| 3614 | |
| 3615 | /* |
| 3616 | * Apply an advisory lock on a file descriptor. |
no test coverage detected