2 * Copyright (c) 2007-2009 Google Inc. and Amit Singh
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * Copyright (C) 2005 Csaba Henk.
32 * All rights reserved.
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions
37 * 1. Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * 2. Redistributions in binary form must reproduce the above copyright
40 * notice, this list of conditions and the following disclaimer in the
41 * documentation and/or other materials provided with the distribution.
43 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
44 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 #include <sys/cdefs.h>
57 __FBSDID("$FreeBSD$");
59 #include <sys/types.h>
60 #include <sys/module.h>
61 #include <sys/systm.h>
62 #include <sys/errno.h>
63 #include <sys/param.h>
64 #include <sys/kernel.h>
67 #include <sys/malloc.h>
68 #include <sys/queue.h>
71 #include <sys/mutex.h>
73 #include <sys/mount.h>
74 #include <sys/vnode.h>
75 #include <sys/signalvar.h>
76 #include <sys/syscallsubr.h>
77 #include <sys/sysctl.h>
81 #include "fuse_node.h"
83 #include "fuse_internal.h"
85 #define FUSE_DEBUG_MODULE IPC
86 #include "fuse_debug.h"
88 static struct fuse_ticket *fticket_alloc(struct fuse_data *data);
89 static void fticket_refresh(struct fuse_ticket *ftick);
90 static void fticket_destroy(struct fuse_ticket *ftick);
91 static int fticket_wait_answer(struct fuse_ticket *ftick);
93 fticket_aw_pull_uio(struct fuse_ticket *ftick,
96 static int fuse_body_audit(struct fuse_ticket *ftick, size_t blen);
97 static __inline__ void
98 fuse_setup_ihead(struct fuse_in_header *ihead,
99 struct fuse_ticket *ftick,
106 static fuse_handler_t fuse_standard_handler;
108 SYSCTL_NODE(_vfs, OID_AUTO, fuse, CTLFLAG_RW, 0, "FUSE tunables");
109 SYSCTL_STRING(_vfs_fuse, OID_AUTO, version, CTLFLAG_RD,
110 FUSE_FREEBSD_VERSION, 0, "fuse-freebsd version");
111 static int fuse_ticket_count = 0;
113 SYSCTL_INT(_vfs_fuse, OID_AUTO, ticket_count, CTLFLAG_RW,
114 &fuse_ticket_count, 0, "number of allocated tickets");
115 static long fuse_iov_permanent_bufsize = 1 << 19;
117 SYSCTL_LONG(_vfs_fuse, OID_AUTO, iov_permanent_bufsize, CTLFLAG_RW,
118 &fuse_iov_permanent_bufsize, 0,
119 "limit for permanently stored buffer size for fuse_iovs");
120 static int fuse_iov_credit = 16;
122 SYSCTL_INT(_vfs_fuse, OID_AUTO, iov_credit, CTLFLAG_RW,
124 "how many times is an oversized fuse_iov tolerated");
126 MALLOC_DEFINE(M_FUSEMSG, "fuse_msgbuf", "fuse message buffer");
127 static uma_zone_t ticket_zone;
130 fuse_block_sigs(sigset_t *oldset)
135 SIGDELSET(newset, SIGKILL);
136 if (kern_sigprocmask(curthread, SIG_BLOCK, &newset, oldset, 0))
137 panic("%s: Invalid operation for kern_sigprocmask()",
142 fuse_restore_sigs(sigset_t *oldset)
145 if (kern_sigprocmask(curthread, SIG_SETMASK, oldset, NULL, 0))
146 panic("%s: Invalid operation for kern_sigprocmask()",
151 fiov_init(struct fuse_iov *fiov, size_t size)
153 uint32_t msize = FU_AT_LEAST(size);
155 debug_printf("fiov=%p, size=%zd\n", fiov, size);
159 fiov->base = malloc(msize, M_FUSEMSG, M_WAITOK | M_ZERO);
161 fiov->allocated_size = msize;
162 fiov->credit = fuse_iov_credit;
166 fiov_teardown(struct fuse_iov *fiov)
168 debug_printf("fiov=%p\n", fiov);
170 MPASS(fiov->base != NULL);
171 free(fiov->base, M_FUSEMSG);
175 fiov_adjust(struct fuse_iov *fiov, size_t size)
177 debug_printf("fiov=%p, size=%zd\n", fiov, size);
179 if (fiov->allocated_size < size ||
180 (fuse_iov_permanent_bufsize >= 0 &&
181 fiov->allocated_size - size > fuse_iov_permanent_bufsize &&
182 --fiov->credit < 0)) {
184 fiov->base = realloc(fiov->base, FU_AT_LEAST(size), M_FUSEMSG,
187 panic("FUSE: realloc failed");
189 fiov->allocated_size = FU_AT_LEAST(size);
190 fiov->credit = fuse_iov_credit;
196 fiov_refresh(struct fuse_iov *fiov)
198 debug_printf("fiov=%p\n", fiov);
200 bzero(fiov->base, fiov->len);
201 fiov_adjust(fiov, 0);
205 fticket_ctor(void *mem, int size, void *arg, int flags)
207 struct fuse_ticket *ftick = mem;
208 struct fuse_data *data = arg;
210 debug_printf("ftick=%p data=%p\n", ftick, data);
212 FUSE_ASSERT_MS_DONE(ftick);
213 FUSE_ASSERT_AW_DONE(ftick);
215 ftick->tk_data = data;
217 if (ftick->tk_unique != 0)
218 fticket_refresh(ftick);
220 /* May be truncated to 32 bits */
221 ftick->tk_unique = atomic_fetchadd_long(&data->ticketer, 1);
222 if (ftick->tk_unique == 0)
223 ftick->tk_unique = atomic_fetchadd_long(&data->ticketer, 1);
225 refcount_init(&ftick->tk_refcount, 1);
226 atomic_add_acq_int(&fuse_ticket_count, 1);
232 fticket_dtor(void *mem, int size, void *arg)
234 struct fuse_ticket *ftick = mem;
236 debug_printf("ftick=%p\n", ftick);
238 FUSE_ASSERT_MS_DONE(ftick);
239 FUSE_ASSERT_AW_DONE(ftick);
241 atomic_subtract_acq_int(&fuse_ticket_count, 1);
245 fticket_init(void *mem, int size, int flags)
247 struct fuse_ticket *ftick = mem;
249 FS_DEBUG("ftick=%p\n", ftick);
251 bzero(ftick, sizeof(struct fuse_ticket));
253 fiov_init(&ftick->tk_ms_fiov, sizeof(struct fuse_in_header));
254 ftick->tk_ms_type = FT_M_FIOV;
256 mtx_init(&ftick->tk_aw_mtx, "fuse answer delivery mutex", NULL, MTX_DEF);
257 fiov_init(&ftick->tk_aw_fiov, 0);
258 ftick->tk_aw_type = FT_A_FIOV;
264 fticket_fini(void *mem, int size)
266 struct fuse_ticket *ftick = mem;
268 FS_DEBUG("ftick=%p\n", ftick);
270 fiov_teardown(&ftick->tk_ms_fiov);
271 fiov_teardown(&ftick->tk_aw_fiov);
272 mtx_destroy(&ftick->tk_aw_mtx);
275 static __inline struct fuse_ticket *
276 fticket_alloc(struct fuse_data *data)
278 return uma_zalloc_arg(ticket_zone, data, M_WAITOK);
282 fticket_destroy(struct fuse_ticket *ftick)
284 return uma_zfree(ticket_zone, ftick);
289 fticket_refresh(struct fuse_ticket *ftick)
291 debug_printf("ftick=%p\n", ftick);
293 FUSE_ASSERT_MS_DONE(ftick);
294 FUSE_ASSERT_AW_DONE(ftick);
296 fiov_refresh(&ftick->tk_ms_fiov);
297 ftick->tk_ms_bufdata = NULL;
298 ftick->tk_ms_bufsize = 0;
299 ftick->tk_ms_type = FT_M_FIOV;
301 bzero(&ftick->tk_aw_ohead, sizeof(struct fuse_out_header));
303 fiov_refresh(&ftick->tk_aw_fiov);
304 ftick->tk_aw_errno = 0;
305 ftick->tk_aw_bufdata = NULL;
306 ftick->tk_aw_bufsize = 0;
307 ftick->tk_aw_type = FT_A_FIOV;
313 fticket_wait_answer(struct fuse_ticket *ftick)
317 struct fuse_data *data;
319 debug_printf("ftick=%p\n", ftick);
320 fuse_lck_mtx_lock(ftick->tk_aw_mtx);
322 if (fticket_answered(ftick)) {
325 data = ftick->tk_data;
327 if (fdata_get_dead(data)) {
329 fticket_set_answered(ftick);
332 fuse_block_sigs(&tset);
333 err = msleep(ftick, &ftick->tk_aw_mtx, PCATCH, "fu_ans",
334 data->daemon_timeout * hz);
335 fuse_restore_sigs(&tset);
336 if (err == EAGAIN) { /* same as EWOULDBLOCK */
337 #ifdef XXXIP /* die conditionally */
338 if (!fdata_get_dead(data)) {
339 fdata_set_dead(data);
343 fticket_set_answered(ftick);
346 if (!(err || fticket_answered(ftick))) {
347 debug_printf("FUSE: requester was woken up but still no answer");
350 fuse_lck_mtx_unlock(ftick->tk_aw_mtx);
357 fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio)
360 size_t len = uio_resid(uio);
362 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
365 switch (ftick->tk_aw_type) {
367 fiov_adjust(fticket_resp(ftick), len);
368 err = uiomove(fticket_resp(ftick)->base, len, uio);
370 debug_printf("FUSE: FT_A_FIOV: error is %d"
372 err, fticket_resp(ftick)->base,
378 ftick->tk_aw_bufsize = len;
379 err = uiomove(ftick->tk_aw_bufdata, len, uio);
381 debug_printf("FUSE: FT_A_BUF: error is %d"
383 err, ftick->tk_aw_bufdata, len, uio);
388 panic("FUSE: unknown answer type for ticket %p", ftick);
395 fticket_pull(struct fuse_ticket *ftick, struct uio *uio)
399 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
401 if (ftick->tk_aw_ohead.error) {
404 err = fuse_body_audit(ftick, uio_resid(uio));
406 err = fticket_aw_pull_uio(ftick, uio);
412 fdata_alloc(struct cdev *fdev, struct ucred *cred)
414 struct fuse_data *data;
416 debug_printf("fdev=%p\n", fdev);
418 data = malloc(sizeof(struct fuse_data), M_FUSEMSG, M_WAITOK | M_ZERO);
421 mtx_init(&data->ms_mtx, "fuse message list mutex", NULL, MTX_DEF);
422 STAILQ_INIT(&data->ms_head);
423 mtx_init(&data->aw_mtx, "fuse answer list mutex", NULL, MTX_DEF);
424 TAILQ_INIT(&data->aw_head);
425 data->daemoncred = crhold(cred);
426 data->daemon_timeout = FUSE_DEFAULT_DAEMON_TIMEOUT;
427 sx_init(&data->rename_lock, "fuse rename lock");
434 fdata_trydestroy(struct fuse_data *data)
436 FS_DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n",
437 data, data->mp, data->fdev, data->dataflags);
439 FS_DEBUG("destroy: data=%p\n", data);
441 MPASS(data->ref >= 0);
445 /* Driving off stage all that stuff thrown at device... */
446 mtx_destroy(&data->ms_mtx);
447 mtx_destroy(&data->aw_mtx);
448 sx_destroy(&data->rename_lock);
450 crfree(data->daemoncred);
452 free(data, M_FUSEMSG);
456 fdata_set_dead(struct fuse_data *data)
458 debug_printf("data=%p\n", data);
461 if (fdata_get_dead(data)) {
465 fuse_lck_mtx_lock(data->ms_mtx);
466 data->dataflags |= FSESS_DEAD;
468 selwakeuppri(&data->ks_rsel, PZERO + 1);
469 wakeup(&data->ticketer);
470 fuse_lck_mtx_unlock(data->ms_mtx);
475 fuse_ticket_fetch(struct fuse_data *data)
478 struct fuse_ticket *ftick;
480 debug_printf("data=%p\n", data);
482 ftick = fticket_alloc(data);
484 if (!(data->dataflags & FSESS_INITED)) {
485 /* Sleep until get answer for INIT messsage */
487 if (!(data->dataflags & FSESS_INITED) && data->ticketer > 2) {
488 err = msleep(&data->ticketer, &fuse_mtx, PCATCH | PDROP,
491 fdata_set_dead(data);
499 fuse_ticket_drop(struct fuse_ticket *ftick)
503 die = refcount_release(&ftick->tk_refcount);
504 debug_printf("ftick=%p refcount=%d\n", ftick, ftick->tk_refcount);
506 fticket_destroy(ftick);
512 fuse_insert_callback(struct fuse_ticket *ftick, fuse_handler_t * handler)
514 debug_printf("ftick=%p, handler=%p data=%p\n", ftick, ftick->tk_data,
517 if (fdata_get_dead(ftick->tk_data)) {
520 ftick->tk_aw_handler = handler;
522 fuse_lck_mtx_lock(ftick->tk_data->aw_mtx);
524 fuse_lck_mtx_unlock(ftick->tk_data->aw_mtx);
528 fuse_insert_message(struct fuse_ticket *ftick)
530 debug_printf("ftick=%p\n", ftick);
532 if (ftick->tk_flag & FT_DIRTY) {
533 panic("FUSE: ticket reused without being refreshed");
535 ftick->tk_flag |= FT_DIRTY;
537 if (fdata_get_dead(ftick->tk_data)) {
540 fuse_lck_mtx_lock(ftick->tk_data->ms_mtx);
542 wakeup_one(ftick->tk_data);
543 selwakeuppri(&ftick->tk_data->ks_rsel, PZERO + 1);
544 fuse_lck_mtx_unlock(ftick->tk_data->ms_mtx);
548 fuse_body_audit(struct fuse_ticket *ftick, size_t blen)
551 enum fuse_opcode opcode;
553 debug_printf("ftick=%p, blen = %zu\n", ftick, blen);
555 opcode = fticket_opcode(ftick);
559 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
563 panic("FUSE: a handler has been intalled for FUSE_FORGET");
567 err = (blen == sizeof(struct fuse_attr_out)) ? 0 : EINVAL;
571 err = (blen == sizeof(struct fuse_attr_out)) ? 0 : EINVAL;
575 err = (PAGE_SIZE >= blen) ? 0 : EINVAL;
579 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
583 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
587 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
591 err = (blen == 0) ? 0 : EINVAL;
595 err = (blen == 0) ? 0 : EINVAL;
599 err = (blen == 0) ? 0 : EINVAL;
603 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
607 err = (blen == sizeof(struct fuse_open_out)) ? 0 : EINVAL;
611 err = (((struct fuse_read_in *)(
612 (char *)ftick->tk_ms_fiov.base +
613 sizeof(struct fuse_in_header)
614 ))->size >= blen) ? 0 : EINVAL;
618 err = (blen == sizeof(struct fuse_write_out)) ? 0 : EINVAL;
622 if (fuse_libabi_geq(ftick->tk_data, 7, 4)) {
623 err = (blen == sizeof(struct fuse_statfs_out)) ?
626 err = (blen == FUSE_COMPAT_STATFS_SIZE) ? 0 : EINVAL;
631 err = (blen == 0) ? 0 : EINVAL;
635 err = (blen == 0) ? 0 : EINVAL;
639 panic("FUSE_SETXATTR implementor has forgotten to define a"
640 " response body format check");
644 panic("FUSE_GETXATTR implementor has forgotten to define a"
645 " response body format check");
649 panic("FUSE_LISTXATTR implementor has forgotten to define a"
650 " response body format check");
653 case FUSE_REMOVEXATTR:
654 panic("FUSE_REMOVEXATTR implementor has forgotten to define a"
655 " response body format check");
659 err = (blen == 0) ? 0 : EINVAL;
663 if (blen == sizeof(struct fuse_init_out) || blen == 8) {
671 err = (blen == sizeof(struct fuse_open_out)) ? 0 : EINVAL;
675 err = (((struct fuse_read_in *)(
676 (char *)ftick->tk_ms_fiov.base +
677 sizeof(struct fuse_in_header)
678 ))->size >= blen) ? 0 : EINVAL;
681 case FUSE_RELEASEDIR:
682 err = (blen == 0) ? 0 : EINVAL;
686 err = (blen == 0) ? 0 : EINVAL;
690 panic("FUSE: no response body format check for FUSE_GETLK");
694 panic("FUSE: no response body format check for FUSE_SETLK");
698 panic("FUSE: no response body format check for FUSE_SETLKW");
702 err = (blen == 0) ? 0 : EINVAL;
706 err = (blen == sizeof(struct fuse_entry_out) +
707 sizeof(struct fuse_open_out)) ? 0 : EINVAL;
711 err = (blen == 0) ? 0 : EINVAL;
715 panic("FUSE: opcodes out of sync (%d)\n", opcode);
722 fuse_setup_ihead(struct fuse_in_header *ihead,
723 struct fuse_ticket *ftick,
730 ihead->len = sizeof(*ihead) + blen;
731 ihead->unique = ftick->tk_unique;
735 debug_printf("ihead=%p, ftick=%p, nid=%ju, op=%d, blen=%zu\n",
736 ihead, ftick, (uintmax_t)nid, op, blen);
739 ihead->uid = cred->cr_uid;
740 ihead->gid = cred->cr_rgid;
744 * fuse_standard_handler just pulls indata and wakes up pretender.
745 * Doesn't try to interpret data, that's left for the pretender.
746 * Though might do a basic size verification before the pull-in takes place
750 fuse_standard_handler(struct fuse_ticket *ftick, struct uio *uio)
754 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
756 err = fticket_pull(ftick, uio);
758 fuse_lck_mtx_lock(ftick->tk_aw_mtx);
760 if (!fticket_answered(ftick)) {
761 fticket_set_answered(ftick);
762 ftick->tk_aw_errno = err;
765 fuse_lck_mtx_unlock(ftick->tk_aw_mtx);
771 fdisp_make_pid(struct fuse_dispatcher *fdip,
778 struct fuse_data *data = fuse_get_mpdata(mp);
780 debug_printf("fdip=%p, op=%d, mp=%p, nid=%ju\n",
781 fdip, op, mp, (uintmax_t)nid);
784 fticket_refresh(fdip->tick);
786 fdip->tick = fuse_ticket_fetch(data);
789 FUSE_DIMALLOC(&fdip->tick->tk_ms_fiov, fdip->finh,
790 fdip->indata, fdip->iosize);
792 fuse_setup_ihead(fdip->finh, fdip->tick, nid, op, fdip->iosize, pid, cred);
796 fdisp_make(struct fuse_dispatcher *fdip,
803 RECTIFY_TDCR(td, cred);
805 return fdisp_make_pid(fdip, op, mp, nid, td->td_proc->p_pid, cred);
809 fdisp_make_vp(struct fuse_dispatcher *fdip,
815 debug_printf("fdip=%p, op=%d, vp=%p\n", fdip, op, vp);
816 RECTIFY_TDCR(td, cred);
817 return fdisp_make_pid(fdip, op, vnode_mount(vp), VTOI(vp),
818 td->td_proc->p_pid, cred);
822 fdisp_wait_answ(struct fuse_dispatcher *fdip)
827 fuse_insert_callback(fdip->tick, fuse_standard_handler);
828 fuse_insert_message(fdip->tick);
830 if ((err = fticket_wait_answer(fdip->tick))) {
831 debug_printf("IPC: interrupted, err = %d\n", err);
833 fuse_lck_mtx_lock(fdip->tick->tk_aw_mtx);
835 if (fticket_answered(fdip->tick)) {
837 * Just between noticing the interrupt and getting here,
838 * the standard handler has completed his job.
839 * So we drop the ticket and exit as usual.
841 debug_printf("IPC: already answered\n");
842 fuse_lck_mtx_unlock(fdip->tick->tk_aw_mtx);
846 * So we were faster than the standard handler.
847 * Then by setting the answered flag we get *him*
848 * to drop the ticket.
850 debug_printf("IPC: setting to answered\n");
851 fticket_set_answered(fdip->tick);
852 fuse_lck_mtx_unlock(fdip->tick->tk_aw_mtx);
856 debug_printf("IPC: not interrupted, err = %d\n", err);
858 if (fdip->tick->tk_aw_errno) {
859 debug_printf("IPC: explicit EIO-ing, tk_aw_errno = %d\n",
860 fdip->tick->tk_aw_errno);
864 if ((err = fdip->tick->tk_aw_ohead.error)) {
865 debug_printf("IPC: setting status to %d\n",
866 fdip->tick->tk_aw_ohead.error);
868 * This means a "proper" fuse syscall error.
869 * We record this value so the caller will
870 * be able to know it's not a boring messaging
871 * failure, if she wishes so (and if not, she can
872 * just simply propagate the return value of this routine).
873 * [XXX Maybe a bitflag would do the job too,
874 * if other flags needed, this will be converted thusly.]
876 fdip->answ_stat = err;
879 fdip->answ = fticket_resp(fdip->tick)->base;
880 fdip->iosize = fticket_resp(fdip->tick)->len;
882 debug_printf("IPC: all is well\n");
887 debug_printf("IPC: dropping ticket, err = %d\n", err);
895 ticket_zone = uma_zcreate("fuse_ticket", sizeof(struct fuse_ticket),
896 fticket_ctor, fticket_dtor, fticket_init, fticket_fini,
901 fuse_ipc_destroy(void)
903 uma_zdestroy(ticket_zone);