Lines Matching full:pcc
177 #define CUSE_CLIENT_CLOSING(pcc) \ argument
178 ((pcc)->cflags & CUSE_CLI_IS_CLOSING)
359 struct cuse_client *pcc; in cuse_server_is_closing() local
366 TAILQ_FOREACH(pcc, &pcs->hcli, entry) { in cuse_server_is_closing()
367 cuse_client_is_closing(pcc); in cuse_server_is_closing()
374 struct cuse_client *pcc; in cuse_server_find_command() local
380 TAILQ_FOREACH(pcc, &pcs->hcli, entry) { in cuse_server_find_command()
381 if (CUSE_CLIENT_CLOSING(pcc)) in cuse_server_find_command()
384 if (pcc->cmds[n].entered == td) in cuse_server_find_command()
385 return (&pcc->cmds[n]); in cuse_server_find_command()
525 struct cuse_client *pcc; in cuse_client_get() local
529 error = devfs_get_cdevpriv((void **)&pcc); in cuse_client_get()
534 if (CUSE_CLIENT_CLOSING(pcc) || pcc->server->is_closing) { in cuse_client_get()
538 *ppcc = pcc; in cuse_client_get()
543 cuse_client_is_closing(struct cuse_client *pcc) in cuse_client_is_closing() argument
548 if (CUSE_CLIENT_CLOSING(pcc)) in cuse_client_is_closing()
551 pcc->cflags |= CUSE_CLI_IS_CLOSING; in cuse_client_is_closing()
552 pcc->server_dev = NULL; in cuse_client_is_closing()
555 pccmd = &pcc->cmds[n]; in cuse_client_is_closing()
558 TAILQ_REMOVE(&pcc->server->head, pccmd, entry); in cuse_client_is_closing()
672 struct cuse_client *pcc; in cuse_server_free_dev() local
682 TAILQ_FOREACH(pcc, &pcs->hcli, entry) { in cuse_server_free_dev()
683 if (pcc->server_dev == pcsd) in cuse_server_free_dev()
684 cuse_client_is_closing(pcc); in cuse_server_free_dev()
1069 struct cuse_client *pcc; in cuse_server_wakeup_all_client_locked() local
1071 TAILQ_FOREACH(pcc, &pcs->hcli, entry) { in cuse_server_wakeup_all_client_locked()
1072 pcc->cflags |= (CUSE_CLI_KNOTE_NEED_READ | in cuse_server_wakeup_all_client_locked()
1110 struct cuse_client *pcc; in cuse_server_ioctl() local
1260 pcc = pccmd->client; in cuse_server_ioctl()
1262 pcc->cmds[n].sub.per_file_handle = *(uintptr_t *)data; in cuse_server_ioctl()
1456 struct cuse_client *pcc = arg; in cuse_client_free() local
1461 pcs = pcc->server; in cuse_client_free()
1464 cuse_client_is_closing(pcc); in cuse_client_free()
1465 TAILQ_REMOVE(&pcs->hcli, pcc, entry); in cuse_client_free()
1469 pccmd = &pcc->cmds[n]; in cuse_client_free()
1475 free(pcc, M_CUSE); in cuse_client_free()
1486 struct cuse_client *pcc; in cuse_client_open() local
1516 pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO); in cuse_client_open()
1517 if (devfs_set_cdevpriv(pcc, &cuse_client_free)) { in cuse_client_open()
1521 free(pcc, M_CUSE); in cuse_client_open()
1524 pcc->fflags = fflags; in cuse_client_open()
1525 pcc->server_dev = pcsd; in cuse_client_open()
1526 pcc->server = pcs; in cuse_client_open()
1529 pccmd = &pcc->cmds[n]; in cuse_client_open()
1533 pccmd->client = pcc; in cuse_client_open()
1544 TAILQ_INSERT_TAIL(&pcs->hcli, pcc, entry); in cuse_client_open()
1558 pccmd = &pcc->cmds[CUSE_CMD_OPEN]; in cuse_client_open()
1563 cuse_client_send_command_locked(pccmd, 0, 0, pcc->fflags, 0); in cuse_client_open()
1586 struct cuse_client *pcc; in cuse_client_close() local
1590 error = cuse_client_get(&pcc); in cuse_client_close()
1594 pccmd = &pcc->cmds[CUSE_CMD_CLOSE]; in cuse_client_close()
1595 pcs = pcc->server; in cuse_client_close()
1600 cuse_client_send_command_locked(pccmd, 0, 0, pcc->fflags, 0); in cuse_client_close()
1605 cuse_client_is_closing(pcc); in cuse_client_close()
1612 cuse_client_kqfilter_poll(struct cdev *dev, struct cuse_client *pcc) in cuse_client_kqfilter_poll() argument
1614 struct cuse_server *pcs = pcc->server; in cuse_client_kqfilter_poll()
1618 temp = (pcc->cflags & (CUSE_CLI_KNOTE_HAS_READ | in cuse_client_kqfilter_poll()
1620 pcc->cflags &= ~(CUSE_CLI_KNOTE_NEED_READ | in cuse_client_kqfilter_poll()
1631 pcc->cflags |= CUSE_CLI_KNOTE_NEED_READ; in cuse_client_kqfilter_poll()
1633 pcc->cflags |= CUSE_CLI_KNOTE_NEED_WRITE; in cuse_client_kqfilter_poll()
1636 cuse_server_wakeup_locked(pcc->server); in cuse_client_kqfilter_poll()
1646 struct cuse_client *pcc; in cuse_client_read() local
1652 error = cuse_client_get(&pcc); in cuse_client_read()
1656 pccmd = &pcc->cmds[CUSE_CMD_READ]; in cuse_client_read()
1657 pcs = pcc->server; in cuse_client_read()
1676 pcc->read_base = (uintptr_t)uio->uio_iov->iov_base; in cuse_client_read()
1677 pcc->read_length = len; in cuse_client_read()
1681 (unsigned long)(unsigned int)len, pcc->fflags, ioflag); in cuse_client_read()
1689 pcc->read_base = 0; in cuse_client_read()
1690 pcc->read_length = 0; in cuse_client_read()
1702 temp = copyout(pcc->read_buffer, in cuse_client_read()
1726 cuse_client_kqfilter_poll(dev, pcc); in cuse_client_read()
1735 struct cuse_client *pcc; in cuse_client_write() local
1740 error = cuse_client_get(&pcc); in cuse_client_write()
1744 pccmd = &pcc->cmds[CUSE_CMD_WRITE]; in cuse_client_write()
1745 pcs = pcc->server; in cuse_client_write()
1763 pcc->write_buffer, len); in cuse_client_write()
1771 pcc->write_base = (uintptr_t)uio->uio_iov->iov_base; in cuse_client_write()
1772 pcc->write_length = len; in cuse_client_write()
1776 (unsigned long)(unsigned int)len, pcc->fflags, ioflag); in cuse_client_write()
1785 pcc->write_base = 0; in cuse_client_write()
1786 pcc->write_length = 0; in cuse_client_write()
1815 cuse_client_kqfilter_poll(dev, pcc); in cuse_client_write()
1825 struct cuse_client *pcc; in cuse_client_ioctl() local
1830 error = cuse_client_get(&pcc); in cuse_client_ioctl()
1838 pccmd = &pcc->cmds[CUSE_CMD_IOCTL]; in cuse_client_ioctl()
1839 pcs = pcc->server; in cuse_client_ioctl()
1844 memcpy(pcc->ioctl_buffer, data, len); in cuse_client_ioctl()
1855 (unsigned long)cmd, pcc->fflags, in cuse_client_ioctl()
1868 memcpy(data, pcc->ioctl_buffer, len); in cuse_client_ioctl()
1873 cuse_client_kqfilter_poll(dev, pcc); in cuse_client_ioctl()
1882 struct cuse_client *pcc; in cuse_client_poll() local
1888 error = cuse_client_get(&pcc); in cuse_client_poll()
1893 pcs = pcc->server; in cuse_client_poll()
1904 pccmd = &pcc->cmds[CUSE_CMD_POLL]; in cuse_client_poll()
1914 0, temp, pcc->fflags, IO_NDELAY); in cuse_client_poll()
1944 struct cuse_client *pcc; in cuse_client_mmap_single() local
1947 error = cuse_client_get(&pcc); in cuse_client_mmap_single()
1951 return (cuse_common_mmap_single(pcc->server, offset, size, object)); in cuse_client_mmap_single()
1957 struct cuse_client *pcc; in cuse_client_kqfilter_read_detach() local
1960 pcc = kn->kn_hook; in cuse_client_kqfilter_read_detach()
1961 pcs = pcc->server; in cuse_client_kqfilter_read_detach()
1971 struct cuse_client *pcc; in cuse_client_kqfilter_write_detach() local
1974 pcc = kn->kn_hook; in cuse_client_kqfilter_write_detach()
1975 pcs = pcc->server; in cuse_client_kqfilter_write_detach()
1985 struct cuse_client *pcc; in cuse_client_kqfilter_read_event() local
1987 pcc = kn->kn_hook; in cuse_client_kqfilter_read_event()
1989 mtx_assert(&pcc->server->mtx, MA_OWNED); in cuse_client_kqfilter_read_event()
1991 return ((pcc->cflags & CUSE_CLI_KNOTE_NEED_READ) ? 1 : 0); in cuse_client_kqfilter_read_event()
1997 struct cuse_client *pcc; in cuse_client_kqfilter_write_event() local
1999 pcc = kn->kn_hook; in cuse_client_kqfilter_write_event()
2001 mtx_assert(&pcc->server->mtx, MA_OWNED); in cuse_client_kqfilter_write_event()
2003 return ((pcc->cflags & CUSE_CLI_KNOTE_NEED_WRITE) ? 1 : 0); in cuse_client_kqfilter_write_event()
2009 struct cuse_client *pcc; in cuse_client_kqfilter() local
2013 error = cuse_client_get(&pcc); in cuse_client_kqfilter()
2017 pcs = pcc->server; in cuse_client_kqfilter()
2022 pcc->cflags |= CUSE_CLI_KNOTE_HAS_READ; in cuse_client_kqfilter()
2023 kn->kn_hook = pcc; in cuse_client_kqfilter()
2028 pcc->cflags |= CUSE_CLI_KNOTE_HAS_WRITE; in cuse_client_kqfilter()
2029 kn->kn_hook = pcc; in cuse_client_kqfilter()
2040 cuse_client_kqfilter_poll(dev, pcc); in cuse_client_kqfilter()