| 1636 | } |
| 1637 | |
| 1638 | static int |
| 1639 | kqueue_acquire(struct file *fp, struct kqueue **kqp) |
| 1640 | { |
| 1641 | int error; |
| 1642 | struct kqueue *kq; |
| 1643 | |
| 1644 | error = 0; |
| 1645 | |
| 1646 | kq = fp->f_data; |
| 1647 | if (fp->f_type != DTYPE_KQUEUE || kq == NULL) |
| 1648 | return (EBADF); |
| 1649 | *kqp = kq; |
| 1650 | KQ_LOCK(kq); |
| 1651 | if ((kq->kq_state & KQ_CLOSING) == KQ_CLOSING) { |
| 1652 | KQ_UNLOCK(kq); |
| 1653 | return (EBADF); |
| 1654 | } |
| 1655 | kq->kq_refcnt++; |
| 1656 | KQ_UNLOCK(kq); |
| 1657 | |
| 1658 | return error; |
| 1659 | } |
| 1660 | |
| 1661 | static void |
| 1662 | kqueue_release(struct kqueue *kq, int locked) |
no outgoing calls
no test coverage detected