/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1992, 19934* The Regents of the University of California. All rights reserved.5*6* This code is derived from software donated to Berkeley by7* Jan-Simon Pendry.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. Neither the name of the University nor the names of its contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/3334#ifndef _FS_FDESC_H_35#define _FS_FDESC_H_3637/* Private mount flags for fdescfs. */38#define FMNT_UNMOUNTF 0x0139#define FMNT_LINRDLNKF 0x0240#define FMNT_NODUP 0x0441#define FMNT_RDLNKF 0x084243struct fdescmount {44struct vnode *f_root; /* Root node */45int flags;46};4748#define FD_ROOT 149#define FD_DESC 35051typedef enum {52Froot,53Fdesc54} fdntype;5556struct fdescnode {57LIST_ENTRY(fdescnode) fd_hash; /* Hash list */58struct vnode *fd_vnode; /* Back ptr to vnode */59fdntype fd_type; /* Type of this node */60unsigned fd_fd; /* Fd to be dup'ed */61int fd_ix; /* filesystem index */62};6364extern struct mtx fdesc_hashmtx;65#define VFSTOFDESC(mp) ((struct fdescmount *)((mp)->mnt_data))66#define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data)6768extern vfs_init_t fdesc_init;69extern vfs_uninit_t fdesc_uninit;70extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *,71struct vnode **);72#endif /* !_FS_FDESC_H_ */737475