Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/src/linux_compat.c
Show First 20 Lines • Show All 1,492 Lines • ▼ Show 20 Lines | linux_file_close(struct file *file, struct thread *td) | ||||
struct linux_cdev *ldev; | struct linux_cdev *ldev; | ||||
int error; | int error; | ||||
filp = (struct linux_file *)file->f_data; | filp = (struct linux_file *)file->f_data; | ||||
KASSERT(file_count(filp) == 0, | KASSERT(file_count(filp) == 0, | ||||
("File refcount(%d) is not zero", file_count(filp))); | ("File refcount(%d) is not zero", file_count(filp))); | ||||
if (td == NULL) | |||||
td = curthread; | |||||
error = 0; | error = 0; | ||||
filp->f_flags = file->f_flag; | filp->f_flags = file->f_flag; | ||||
linux_set_current(td); | linux_set_current(td); | ||||
linux_poll_wait_dequeue(filp); | linux_poll_wait_dequeue(filp); | ||||
linux_get_fop(filp, &fop, &ldev); | linux_get_fop(filp, &fop, &ldev); | ||||
if (fop->release != NULL) | if (fop->release != NULL) | ||||
error = -OPW(file, td, fop->release(filp->f_vnode, filp)); | error = -OPW(file, td, fop->release(filp->f_vnode, filp)); | ||||
funsetown(&filp->f_sigio); | funsetown(&filp->f_sigio); | ||||
▲ Show 20 Lines • Show All 947 Lines • Show Last 20 Lines |