Lines Matching refs:cdev
69 struct cuse_dev *cdev; member
375 struct cuse_dev *cdev; in cuse_dev_create() local
382 cdev = malloc(sizeof(*cdev)); in cuse_dev_create()
383 if (cdev == NULL) in cuse_dev_create()
386 memset(cdev, 0, sizeof(*cdev)); in cuse_dev_create()
388 cdev->mtod = mtod; in cuse_dev_create()
389 cdev->priv0 = priv0; in cuse_dev_create()
390 cdev->priv1 = priv1; in cuse_dev_create()
394 info.dev = cdev; in cuse_dev_create()
405 free(cdev); in cuse_dev_create()
409 TAILQ_INSERT_TAIL(&h_cuse, cdev, entry); in cuse_dev_create()
412 return (cdev); in cuse_dev_create()
417 cuse_dev_destroy(struct cuse_dev *cdev) in cuse_dev_destroy() argument
425 TAILQ_REMOVE(&h_cuse, cdev, entry); in cuse_dev_destroy()
428 error = ioctl(f_cuse, CUSE_IOCTL_DESTROY_DEV, &cdev); in cuse_dev_destroy()
432 free(cdev); in cuse_dev_destroy()
436 cuse_dev_get_priv0(struct cuse_dev *cdev) in cuse_dev_get_priv0() argument
438 return (cdev->priv0); in cuse_dev_get_priv0()
442 cuse_dev_get_priv1(struct cuse_dev *cdev) in cuse_dev_get_priv1() argument
444 return (cdev->priv1); in cuse_dev_get_priv1()
448 cuse_dev_set_priv0(struct cuse_dev *cdev, void *priv) in cuse_dev_set_priv0() argument
450 cdev->priv0 = priv; in cuse_dev_set_priv0()
454 cuse_dev_set_priv1(struct cuse_dev *cdev, void *priv) in cuse_dev_set_priv1() argument
456 cdev->priv1 = priv; in cuse_dev_set_priv1()
466 struct cuse_dev *cdev; in cuse_wait_and_process() local
476 cdev = info.dev; in cuse_wait_and_process()
484 enter.cdev = cdev; in cuse_wait_and_process()
494 if (cdev->mtod->cm_open != NULL) in cuse_wait_and_process()
495 error = (cdev->mtod->cm_open) (cdev, (int)info.fflags); in cuse_wait_and_process()
510 if (pe->cdev != cdev) in cuse_wait_and_process()
529 if (cdev->mtod->cm_close != NULL) in cuse_wait_and_process()
530 error = (cdev->mtod->cm_close) (cdev, (int)info.fflags); in cuse_wait_and_process()
536 if (cdev->mtod->cm_read != NULL) { in cuse_wait_and_process()
537 error = (cdev->mtod->cm_read) (cdev, (int)info.fflags, in cuse_wait_and_process()
545 if (cdev->mtod->cm_write != NULL) { in cuse_wait_and_process()
546 error = (cdev->mtod->cm_write) (cdev, (int)info.fflags, in cuse_wait_and_process()
554 if (cdev->mtod->cm_ioctl != NULL) { in cuse_wait_and_process()
555 error = (cdev->mtod->cm_ioctl) (cdev, (int)info.fflags, in cuse_wait_and_process()
563 if (cdev->mtod->cm_poll != NULL) { in cuse_wait_and_process()
564 error = (cdev->mtod->cm_poll) (cdev, (int)info.fflags, in cuse_wait_and_process()
574 if (pe->cdev != cdev) in cuse_wait_and_process()
621 cuse_dev_set_per_file_handle(struct cuse_dev *cdev, void *handle) in cuse_dev_set_per_file_handle() argument
626 if (pe == NULL || pe->cdev != cdev) in cuse_dev_set_per_file_handle()
634 cuse_dev_get_per_file_handle(struct cuse_dev *cdev) in cuse_dev_get_per_file_handle() argument
639 if (pe == NULL || pe->cdev != cdev) in cuse_dev_get_per_file_handle()
773 return (pe->cdev); in cuse_dev_get_current()