2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 2007-2009 Google Inc. and Amit Singh
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following disclaimer
15 * in the documentation and/or other materials provided with the
17 * * Neither the name of Google Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Copyright (C) 2005 Csaba Henk.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
45 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 #include <sys/cdefs.h>
59 __FBSDID("$FreeBSD$");
61 #include <sys/types.h>
62 #include <sys/module.h>
63 #include <sys/systm.h>
64 #include <sys/errno.h>
65 #include <sys/param.h>
66 #include <sys/kernel.h>
69 #include <sys/malloc.h>
70 #include <sys/queue.h>
73 #include <sys/mutex.h>
75 #include <sys/mount.h>
76 #include <sys/vnode.h>
77 #include <sys/signalvar.h>
78 #include <sys/syscallsubr.h>
79 #include <sys/sysctl.h>
83 #include "fuse_node.h"
85 #include "fuse_internal.h"
87 #define FUSE_DEBUG_MODULE IPC
88 #include "fuse_debug.h"
90 static struct fuse_ticket *fticket_alloc(struct fuse_data *data);
91 static void fticket_refresh(struct fuse_ticket *ftick);
92 static void fticket_destroy(struct fuse_ticket *ftick);
93 static int fticket_wait_answer(struct fuse_ticket *ftick);
95 fticket_aw_pull_uio(struct fuse_ticket *ftick,
98 static int fuse_body_audit(struct fuse_ticket *ftick, size_t blen);
100 static fuse_handler_t fuse_standard_handler;
102 SYSCTL_NODE(_vfs, OID_AUTO, fuse, CTLFLAG_RW, 0, "FUSE tunables");
103 SYSCTL_STRING(_vfs_fuse, OID_AUTO, version, CTLFLAG_RD,
104 FUSE_FREEBSD_VERSION, 0, "fuse-freebsd version");
105 static int fuse_ticket_count = 0;
107 SYSCTL_INT(_vfs_fuse, OID_AUTO, ticket_count, CTLFLAG_RW,
108 &fuse_ticket_count, 0, "number of allocated tickets");
109 static long fuse_iov_permanent_bufsize = 1 << 19;
111 SYSCTL_LONG(_vfs_fuse, OID_AUTO, iov_permanent_bufsize, CTLFLAG_RW,
112 &fuse_iov_permanent_bufsize, 0,
113 "limit for permanently stored buffer size for fuse_iovs");
114 static int fuse_iov_credit = 16;
116 SYSCTL_INT(_vfs_fuse, OID_AUTO, iov_credit, CTLFLAG_RW,
118 "how many times is an oversized fuse_iov tolerated");
120 MALLOC_DEFINE(M_FUSEMSG, "fuse_msgbuf", "fuse message buffer");
121 static uma_zone_t ticket_zone;
124 fuse_block_sigs(sigset_t *oldset)
129 SIGDELSET(newset, SIGKILL);
130 if (kern_sigprocmask(curthread, SIG_BLOCK, &newset, oldset, 0))
131 panic("%s: Invalid operation for kern_sigprocmask()",
136 fuse_restore_sigs(sigset_t *oldset)
139 if (kern_sigprocmask(curthread, SIG_SETMASK, oldset, NULL, 0))
140 panic("%s: Invalid operation for kern_sigprocmask()",
145 fiov_init(struct fuse_iov *fiov, size_t size)
147 uint32_t msize = FU_AT_LEAST(size);
149 debug_printf("fiov=%p, size=%zd\n", fiov, size);
153 fiov->base = malloc(msize, M_FUSEMSG, M_WAITOK | M_ZERO);
155 fiov->allocated_size = msize;
156 fiov->credit = fuse_iov_credit;
160 fiov_teardown(struct fuse_iov *fiov)
162 debug_printf("fiov=%p\n", fiov);
164 MPASS(fiov->base != NULL);
165 free(fiov->base, M_FUSEMSG);
169 fiov_adjust(struct fuse_iov *fiov, size_t size)
171 debug_printf("fiov=%p, size=%zd\n", fiov, size);
173 if (fiov->allocated_size < size ||
174 (fuse_iov_permanent_bufsize >= 0 &&
175 fiov->allocated_size - size > fuse_iov_permanent_bufsize &&
176 --fiov->credit < 0)) {
178 fiov->base = realloc(fiov->base, FU_AT_LEAST(size), M_FUSEMSG,
181 panic("FUSE: realloc failed");
183 fiov->allocated_size = FU_AT_LEAST(size);
184 fiov->credit = fuse_iov_credit;
190 fiov_refresh(struct fuse_iov *fiov)
192 debug_printf("fiov=%p\n", fiov);
194 bzero(fiov->base, fiov->len);
195 fiov_adjust(fiov, 0);
199 fticket_ctor(void *mem, int size, void *arg, int flags)
201 struct fuse_ticket *ftick = mem;
202 struct fuse_data *data = arg;
204 debug_printf("ftick=%p data=%p\n", ftick, data);
206 FUSE_ASSERT_MS_DONE(ftick);
207 FUSE_ASSERT_AW_DONE(ftick);
209 ftick->tk_data = data;
211 if (ftick->tk_unique != 0)
212 fticket_refresh(ftick);
214 /* May be truncated to 32 bits */
215 ftick->tk_unique = atomic_fetchadd_long(&data->ticketer, 1);
216 if (ftick->tk_unique == 0)
217 ftick->tk_unique = atomic_fetchadd_long(&data->ticketer, 1);
219 refcount_init(&ftick->tk_refcount, 1);
220 atomic_add_acq_int(&fuse_ticket_count, 1);
226 fticket_dtor(void *mem, int size, void *arg)
228 struct fuse_ticket *ftick = mem;
230 debug_printf("ftick=%p\n", ftick);
232 FUSE_ASSERT_MS_DONE(ftick);
233 FUSE_ASSERT_AW_DONE(ftick);
235 atomic_subtract_acq_int(&fuse_ticket_count, 1);
239 fticket_init(void *mem, int size, int flags)
241 struct fuse_ticket *ftick = mem;
243 FS_DEBUG("ftick=%p\n", ftick);
245 bzero(ftick, sizeof(struct fuse_ticket));
247 fiov_init(&ftick->tk_ms_fiov, sizeof(struct fuse_in_header));
248 ftick->tk_ms_type = FT_M_FIOV;
250 mtx_init(&ftick->tk_aw_mtx, "fuse answer delivery mutex", NULL, MTX_DEF);
251 fiov_init(&ftick->tk_aw_fiov, 0);
252 ftick->tk_aw_type = FT_A_FIOV;
258 fticket_fini(void *mem, int size)
260 struct fuse_ticket *ftick = mem;
262 FS_DEBUG("ftick=%p\n", ftick);
264 fiov_teardown(&ftick->tk_ms_fiov);
265 fiov_teardown(&ftick->tk_aw_fiov);
266 mtx_destroy(&ftick->tk_aw_mtx);
269 static inline struct fuse_ticket *
270 fticket_alloc(struct fuse_data *data)
272 return uma_zalloc_arg(ticket_zone, data, M_WAITOK);
276 fticket_destroy(struct fuse_ticket *ftick)
278 return uma_zfree(ticket_zone, ftick);
283 fticket_refresh(struct fuse_ticket *ftick)
285 debug_printf("ftick=%p\n", ftick);
287 FUSE_ASSERT_MS_DONE(ftick);
288 FUSE_ASSERT_AW_DONE(ftick);
290 fiov_refresh(&ftick->tk_ms_fiov);
291 ftick->tk_ms_bufdata = NULL;
292 ftick->tk_ms_bufsize = 0;
293 ftick->tk_ms_type = FT_M_FIOV;
295 bzero(&ftick->tk_aw_ohead, sizeof(struct fuse_out_header));
297 fiov_refresh(&ftick->tk_aw_fiov);
298 ftick->tk_aw_errno = 0;
299 ftick->tk_aw_bufdata = NULL;
300 ftick->tk_aw_bufsize = 0;
301 ftick->tk_aw_type = FT_A_FIOV;
307 fticket_wait_answer(struct fuse_ticket *ftick)
311 struct fuse_data *data;
313 debug_printf("ftick=%p\n", ftick);
314 fuse_lck_mtx_lock(ftick->tk_aw_mtx);
316 if (fticket_answered(ftick)) {
319 data = ftick->tk_data;
321 if (fdata_get_dead(data)) {
323 fticket_set_answered(ftick);
326 fuse_block_sigs(&tset);
327 err = msleep(ftick, &ftick->tk_aw_mtx, PCATCH, "fu_ans",
328 data->daemon_timeout * hz);
329 fuse_restore_sigs(&tset);
330 if (err == EAGAIN) { /* same as EWOULDBLOCK */
331 #ifdef XXXIP /* die conditionally */
332 if (!fdata_get_dead(data)) {
333 fdata_set_dead(data);
337 fticket_set_answered(ftick);
340 if (!(err || fticket_answered(ftick))) {
341 debug_printf("FUSE: requester was woken up but still no answer");
344 fuse_lck_mtx_unlock(ftick->tk_aw_mtx);
351 fticket_aw_pull_uio(struct fuse_ticket *ftick, struct uio *uio)
354 size_t len = uio_resid(uio);
356 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
359 switch (ftick->tk_aw_type) {
361 fiov_adjust(fticket_resp(ftick), len);
362 err = uiomove(fticket_resp(ftick)->base, len, uio);
364 debug_printf("FUSE: FT_A_FIOV: error is %d"
366 err, fticket_resp(ftick)->base,
372 ftick->tk_aw_bufsize = len;
373 err = uiomove(ftick->tk_aw_bufdata, len, uio);
375 debug_printf("FUSE: FT_A_BUF: error is %d"
377 err, ftick->tk_aw_bufdata, len, uio);
382 panic("FUSE: unknown answer type for ticket %p", ftick);
389 fticket_pull(struct fuse_ticket *ftick, struct uio *uio)
393 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
395 if (ftick->tk_aw_ohead.error) {
398 err = fuse_body_audit(ftick, uio_resid(uio));
400 err = fticket_aw_pull_uio(ftick, uio);
406 fdata_alloc(struct cdev *fdev, struct ucred *cred)
408 struct fuse_data *data;
410 debug_printf("fdev=%p\n", fdev);
412 data = malloc(sizeof(struct fuse_data), M_FUSEMSG, M_WAITOK | M_ZERO);
415 mtx_init(&data->ms_mtx, "fuse message list mutex", NULL, MTX_DEF);
416 STAILQ_INIT(&data->ms_head);
417 mtx_init(&data->aw_mtx, "fuse answer list mutex", NULL, MTX_DEF);
418 TAILQ_INIT(&data->aw_head);
419 data->daemoncred = crhold(cred);
420 data->daemon_timeout = FUSE_DEFAULT_DAEMON_TIMEOUT;
421 sx_init(&data->rename_lock, "fuse rename lock");
428 fdata_trydestroy(struct fuse_data *data)
430 FS_DEBUG("data=%p data.mp=%p data.fdev=%p data.flags=%04x\n",
431 data, data->mp, data->fdev, data->dataflags);
433 FS_DEBUG("destroy: data=%p\n", data);
435 MPASS(data->ref >= 0);
439 /* Driving off stage all that stuff thrown at device... */
440 mtx_destroy(&data->ms_mtx);
441 mtx_destroy(&data->aw_mtx);
442 sx_destroy(&data->rename_lock);
444 crfree(data->daemoncred);
446 free(data, M_FUSEMSG);
450 fdata_set_dead(struct fuse_data *data)
452 debug_printf("data=%p\n", data);
455 if (fdata_get_dead(data)) {
459 fuse_lck_mtx_lock(data->ms_mtx);
460 data->dataflags |= FSESS_DEAD;
462 selwakeuppri(&data->ks_rsel, PZERO + 1);
463 wakeup(&data->ticketer);
464 fuse_lck_mtx_unlock(data->ms_mtx);
469 fuse_ticket_fetch(struct fuse_data *data)
472 struct fuse_ticket *ftick;
474 debug_printf("data=%p\n", data);
476 ftick = fticket_alloc(data);
478 if (!(data->dataflags & FSESS_INITED)) {
479 /* Sleep until get answer for INIT messsage */
481 if (!(data->dataflags & FSESS_INITED) && data->ticketer > 2) {
482 err = msleep(&data->ticketer, &fuse_mtx, PCATCH | PDROP,
485 fdata_set_dead(data);
493 fuse_ticket_drop(struct fuse_ticket *ftick)
497 die = refcount_release(&ftick->tk_refcount);
498 debug_printf("ftick=%p refcount=%d\n", ftick, ftick->tk_refcount);
500 fticket_destroy(ftick);
506 fuse_insert_callback(struct fuse_ticket *ftick, fuse_handler_t * handler)
508 debug_printf("ftick=%p, handler=%p data=%p\n", ftick, ftick->tk_data,
511 if (fdata_get_dead(ftick->tk_data)) {
514 ftick->tk_aw_handler = handler;
516 fuse_lck_mtx_lock(ftick->tk_data->aw_mtx);
518 fuse_lck_mtx_unlock(ftick->tk_data->aw_mtx);
522 fuse_insert_message(struct fuse_ticket *ftick)
524 debug_printf("ftick=%p\n", ftick);
526 if (ftick->tk_flag & FT_DIRTY) {
527 panic("FUSE: ticket reused without being refreshed");
529 ftick->tk_flag |= FT_DIRTY;
531 if (fdata_get_dead(ftick->tk_data)) {
534 fuse_lck_mtx_lock(ftick->tk_data->ms_mtx);
536 wakeup_one(ftick->tk_data);
537 selwakeuppri(&ftick->tk_data->ks_rsel, PZERO + 1);
538 fuse_lck_mtx_unlock(ftick->tk_data->ms_mtx);
542 fuse_body_audit(struct fuse_ticket *ftick, size_t blen)
545 enum fuse_opcode opcode;
547 debug_printf("ftick=%p, blen = %zu\n", ftick, blen);
549 opcode = fticket_opcode(ftick);
553 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
557 panic("FUSE: a handler has been intalled for FUSE_FORGET");
561 err = (blen == sizeof(struct fuse_attr_out)) ? 0 : EINVAL;
565 err = (blen == sizeof(struct fuse_attr_out)) ? 0 : EINVAL;
569 err = (PAGE_SIZE >= blen) ? 0 : EINVAL;
573 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
577 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
581 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
585 err = (blen == 0) ? 0 : EINVAL;
589 err = (blen == 0) ? 0 : EINVAL;
593 err = (blen == 0) ? 0 : EINVAL;
597 err = (blen == sizeof(struct fuse_entry_out)) ? 0 : EINVAL;
601 err = (blen == sizeof(struct fuse_open_out)) ? 0 : EINVAL;
605 err = (((struct fuse_read_in *)(
606 (char *)ftick->tk_ms_fiov.base +
607 sizeof(struct fuse_in_header)
608 ))->size >= blen) ? 0 : EINVAL;
612 err = (blen == sizeof(struct fuse_write_out)) ? 0 : EINVAL;
616 if (fuse_libabi_geq(ftick->tk_data, 7, 4)) {
617 err = (blen == sizeof(struct fuse_statfs_out)) ?
620 err = (blen == FUSE_COMPAT_STATFS_SIZE) ? 0 : EINVAL;
625 err = (blen == 0) ? 0 : EINVAL;
629 err = (blen == 0) ? 0 : EINVAL;
633 err = (blen == 0) ? 0 : EINVAL;
639 * These can have varying response lengths, and 0 length
640 * isn't necessarily invalid.
645 case FUSE_REMOVEXATTR:
646 err = (blen == 0) ? 0 : EINVAL;
650 err = (blen == 0) ? 0 : EINVAL;
654 if (blen == sizeof(struct fuse_init_out) || blen == 8) {
662 err = (blen == sizeof(struct fuse_open_out)) ? 0 : EINVAL;
666 err = (((struct fuse_read_in *)(
667 (char *)ftick->tk_ms_fiov.base +
668 sizeof(struct fuse_in_header)
669 ))->size >= blen) ? 0 : EINVAL;
672 case FUSE_RELEASEDIR:
673 err = (blen == 0) ? 0 : EINVAL;
677 err = (blen == 0) ? 0 : EINVAL;
681 panic("FUSE: no response body format check for FUSE_GETLK");
685 panic("FUSE: no response body format check for FUSE_SETLK");
689 panic("FUSE: no response body format check for FUSE_SETLKW");
693 err = (blen == 0) ? 0 : EINVAL;
697 err = (blen == sizeof(struct fuse_entry_out) +
698 sizeof(struct fuse_open_out)) ? 0 : EINVAL;
702 err = (blen == 0) ? 0 : EINVAL;
706 panic("FUSE: opcodes out of sync (%d)\n", opcode);
713 fuse_setup_ihead(struct fuse_in_header *ihead, struct fuse_ticket *ftick,
714 uint64_t nid, enum fuse_opcode op, size_t blen, pid_t pid,
717 ihead->len = sizeof(*ihead) + blen;
718 ihead->unique = ftick->tk_unique;
722 debug_printf("ihead=%p, ftick=%p, nid=%ju, op=%d, blen=%zu\n",
723 ihead, ftick, (uintmax_t)nid, op, blen);
726 ihead->uid = cred->cr_uid;
727 ihead->gid = cred->cr_rgid;
731 * fuse_standard_handler just pulls indata and wakes up pretender.
732 * Doesn't try to interpret data, that's left for the pretender.
733 * Though might do a basic size verification before the pull-in takes place
737 fuse_standard_handler(struct fuse_ticket *ftick, struct uio *uio)
741 debug_printf("ftick=%p, uio=%p\n", ftick, uio);
743 err = fticket_pull(ftick, uio);
745 fuse_lck_mtx_lock(ftick->tk_aw_mtx);
747 if (!fticket_answered(ftick)) {
748 fticket_set_answered(ftick);
749 ftick->tk_aw_errno = err;
752 fuse_lck_mtx_unlock(ftick->tk_aw_mtx);
758 fdisp_make_pid(struct fuse_dispatcher *fdip, enum fuse_opcode op,
759 struct mount *mp, uint64_t nid, pid_t pid, struct ucred *cred)
761 struct fuse_data *data = fuse_get_mpdata(mp);
763 debug_printf("fdip=%p, op=%d, mp=%p, nid=%ju\n",
764 fdip, op, mp, (uintmax_t)nid);
767 fticket_refresh(fdip->tick);
769 fdip->tick = fuse_ticket_fetch(data);
772 FUSE_DIMALLOC(&fdip->tick->tk_ms_fiov, fdip->finh,
773 fdip->indata, fdip->iosize);
775 fuse_setup_ihead(fdip->finh, fdip->tick, nid, op, fdip->iosize, pid, cred);
779 fdisp_make(struct fuse_dispatcher *fdip, enum fuse_opcode op, struct mount *mp,
780 uint64_t nid, struct thread *td, struct ucred *cred)
782 RECTIFY_TDCR(td, cred);
784 return fdisp_make_pid(fdip, op, mp, nid, td->td_proc->p_pid, cred);
788 fdisp_make_vp(struct fuse_dispatcher *fdip, enum fuse_opcode op,
789 struct vnode *vp, struct thread *td, struct ucred *cred)
791 debug_printf("fdip=%p, op=%d, vp=%p\n", fdip, op, vp);
792 RECTIFY_TDCR(td, cred);
793 return fdisp_make_pid(fdip, op, vnode_mount(vp), VTOI(vp),
794 td->td_proc->p_pid, cred);
798 fdisp_wait_answ(struct fuse_dispatcher *fdip)
803 fuse_insert_callback(fdip->tick, fuse_standard_handler);
804 fuse_insert_message(fdip->tick);
806 if ((err = fticket_wait_answer(fdip->tick))) {
807 debug_printf("IPC: interrupted, err = %d\n", err);
809 fuse_lck_mtx_lock(fdip->tick->tk_aw_mtx);
811 if (fticket_answered(fdip->tick)) {
813 * Just between noticing the interrupt and getting here,
814 * the standard handler has completed his job.
815 * So we drop the ticket and exit as usual.
817 debug_printf("IPC: already answered\n");
818 fuse_lck_mtx_unlock(fdip->tick->tk_aw_mtx);
822 * So we were faster than the standard handler.
823 * Then by setting the answered flag we get *him*
824 * to drop the ticket.
826 debug_printf("IPC: setting to answered\n");
827 fticket_set_answered(fdip->tick);
828 fuse_lck_mtx_unlock(fdip->tick->tk_aw_mtx);
832 debug_printf("IPC: not interrupted, err = %d\n", err);
834 if (fdip->tick->tk_aw_errno) {
835 debug_printf("IPC: explicit EIO-ing, tk_aw_errno = %d\n",
836 fdip->tick->tk_aw_errno);
840 if ((err = fdip->tick->tk_aw_ohead.error)) {
841 debug_printf("IPC: setting status to %d\n",
842 fdip->tick->tk_aw_ohead.error);
844 * This means a "proper" fuse syscall error.
845 * We record this value so the caller will
846 * be able to know it's not a boring messaging
847 * failure, if she wishes so (and if not, she can
848 * just simply propagate the return value of this routine).
849 * [XXX Maybe a bitflag would do the job too,
850 * if other flags needed, this will be converted thusly.]
852 fdip->answ_stat = err;
855 fdip->answ = fticket_resp(fdip->tick)->base;
856 fdip->iosize = fticket_resp(fdip->tick)->len;
858 debug_printf("IPC: all is well\n");
863 debug_printf("IPC: dropping ticket, err = %d\n", err);
871 ticket_zone = uma_zcreate("fuse_ticket", sizeof(struct fuse_ticket),
872 fticket_ctor, fticket_dtor, fticket_init, fticket_fini,
877 fuse_ipc_destroy(void)
879 uma_zdestroy(ticket_zone);