/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 2007-2009 Google Inc.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions are8* met:9*10* * Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* * Redistributions in binary form must reproduce the above13* copyright notice, this list of conditions and the following disclaimer14* in the documentation and/or other materials provided with the15* distribution.16* * Neither the name of Google Inc. nor the names of its17* contributors may be used to endorse or promote products derived from18* this software without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31*32* Copyright (C) 2005 Csaba Henk.33* All rights reserved.34*35* Copyright (c) 2019 The FreeBSD Foundation36*37* Portions of this software were developed by BFF Storage Systems, LLC under38* sponsorship from the FreeBSD Foundation.39*40* Redistribution and use in source and binary forms, with or without41* modification, are permitted provided that the following conditions42* are met:43* 1. Redistributions of source code must retain the above copyright44* notice, this list of conditions and the following disclaimer.45* 2. Redistributions in binary form must reproduce the above copyright46* notice, this list of conditions and the following disclaimer in the47* documentation and/or other materials provided with the distribution.48*49* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND50* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE51* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE52* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE53* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL54* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS55* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)56* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT57* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY58* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF59* SUCH DAMAGE.60*/6162#include "fuse_kernel.h"6364#define FUSE_DEFAULT_DAEMON_TIMEOUT 60 /* s */65#define FUSE_MIN_DAEMON_TIMEOUT 0 /* s */66#define FUSE_MAX_DAEMON_TIMEOUT 600 /* s */6768/* misc */6970SYSCTL_DECL(_vfs_fusefs);71SYSCTL_DECL(_vfs_fusefs_stats);7273/* Fuse locking */7475extern struct mtx fuse_mtx;76#define FUSE_LOCK() fuse_lck_mtx_lock(fuse_mtx)77#define FUSE_UNLOCK() fuse_lck_mtx_unlock(fuse_mtx)7879#define RECTIFY_TDCR(td, cred) \80do { \81if (! (td)) \82(td) = curthread; \83if (! (cred)) \84(cred) = (td)->td_ucred; \85} while (0)8687#define fuse_lck_mtx_lock(mtx) mtx_lock(&(mtx))88#define fuse_lck_mtx_unlock(mtx) mtx_unlock(&(mtx))8990void fuse_ipc_init(void);91void fuse_ipc_destroy(void);9293int fuse_device_init(void);94void fuse_device_destroy(void);959697