#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mount_internal.h>
#include <sys/vnode_internal.h>
#include <nfs/nfs_conf.h>
struct mount *rootfs;
struct vnode *rootvnode;
#ifdef CONFIG_IMGSRC_ACCESS
struct vnode *imgsrc_rootvnodes[MAX_IMAGEBOOT_NESTING];
#endif
int (*mountroot)(void) = NULL;
extern struct vfsops mfs_vfsops;
extern int mfs_mountroot(mount_t, vnode_t, vfs_context_t);
extern struct vfsops nfs_vfsops;
extern int nfs_mountroot(void);
extern struct vfsops afs_vfsops;
extern struct vfsops null_vfsops;
extern struct vfsops devfs_vfsops;
extern const struct vfsops routefs_vfsops;
extern struct vfsops nullfs_vfsops;
extern struct vfsops bindfs_vfsops;
#if MOCKFS
extern struct vfsops mockfs_vfsops;
extern int mockfs_mountroot(mount_t, vnode_t, vfs_context_t);
#endif
typedef int (*mountroot_t)(mount_t, vnode_t, vfs_context_t);
enum fs_type_num {
FT_NFS = 2,
FT_DEVFS = 19,
FT_SYNTHFS = 20,
FT_ROUTEFS = 21,
FT_NULLFS = 22,
FT_BINDFS = 23,
FT_MOCKFS = 0x6D6F636B
};
static struct vfstable vfstbllist[] = {
#if CONFIG_NFS_CLIENT
{
.vfc_vfsops = &nfs_vfsops,
.vfc_name = "nfs",
.vfc_typenum = FT_NFS,
.vfc_refcount = 0,
.vfc_flags = 0,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFSGENERICARGS | VFC_VFSPREFLIGHT | VFC_VFS64BITREADY | VFC_VFSREADDIR_EXTENDED,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
#if DEVFS
#if CONFIG_MACF
{
.vfc_vfsops = &devfs_vfsops,
.vfc_name = "devfs",
.vfc_typenum = FT_DEVFS,
.vfc_refcount = 0,
.vfc_flags = MNT_MULTILABEL,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFSGENERICARGS | VFC_VFS64BITREADY,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#else
{
.vfc_vfsops = &devfs_vfsops,
.vfc_name = "devfs",
.vfc_typenum = FT_DEVFS,
.vfc_refcount = 0,
.vfc_flags = 0,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFSGENERICARGS | VFC_VFS64BITREADY,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
#endif
#ifndef __LP64__
#endif
#if NULLFS
{
.vfc_vfsops = &nullfs_vfsops,
.vfc_name = "nullfs",
.vfc_typenum = FT_NULLFS,
.vfc_refcount = 0,
.vfc_flags = MNT_DONTBROWSE | MNT_RDONLY,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFS64BITREADY,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
#if BINDFS
{
.vfc_vfsops = &bindfs_vfsops,
.vfc_name = "bindfs",
.vfc_typenum = FT_BINDFS,
.vfc_refcount = 0,
.vfc_flags = MNT_DONTBROWSE | MNT_RDONLY,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFS64BITREADY,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
#if MOCKFS
{
.vfc_vfsops = &mockfs_vfsops,
.vfc_name = "mockfs",
.vfc_typenum = FT_MOCKFS,
.vfc_refcount = 0,
.vfc_flags = MNT_LOCAL,
.vfc_mountroot = mockfs_mountroot,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFSGENERICARGS,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
#if ROUTEFS
{
.vfc_vfsops = &routefs_vfsops,
.vfc_name = "routefs",
.vfc_typenum = FT_ROUTEFS,
.vfc_refcount = 0,
.vfc_flags = MNT_LOCAL,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = VFC_VFSGENERICARGS | VFC_VFS64BITREADY,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
#endif
{
.vfc_vfsops = NULL,
.vfc_name = "<unassigned>",
.vfc_typenum = 0,
.vfc_refcount = 0,
.vfc_flags = 0,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = 0,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
{
.vfc_vfsops = NULL,
.vfc_name = "<unassigned>",
.vfc_typenum = 0,
.vfc_refcount = 0,
.vfc_flags = 0,
.vfc_mountroot = NULL,
.vfc_next = NULL,
.vfc_reserved1 = 0,
.vfc_reserved2 = 0,
.vfc_vfsflags = 0,
.vfc_descptr = NULL,
.vfc_descsize = 0,
.vfc_sysctl = NULL
},
};
const int maxvfsslots = sizeof(vfstbllist) / sizeof(struct vfstable);
int numused_vfsslots = 0;
int numregistered_fses = 0;
int maxvfstypenum = VT_NON + 1;
struct vfstable *vfsconf = vfstbllist;
extern struct vnodeopv_desc mfs_vnodeop_opv_desc;
extern const struct vnodeopv_desc dead_vnodeop_opv_desc;
#if FIFO && SOCKETS
extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
#endif
extern const struct vnodeopv_desc spec_vnodeop_opv_desc;
extern const struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
extern const struct vnodeopv_desc spec_nfsv2nodeop_opv_desc;
extern const struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
#if CONFIG_NFS4
extern const struct vnodeopv_desc nfsv4_vnodeop_opv_desc;
extern const struct vnodeopv_desc spec_nfsv4nodeop_opv_desc;
extern const struct vnodeopv_desc fifo_nfsv4nodeop_opv_desc;
#endif
extern struct vnodeopv_desc null_vnodeop_opv_desc;
extern struct vnodeopv_desc devfs_vnodeop_opv_desc;
extern struct vnodeopv_desc devfs_spec_vnodeop_opv_desc;
#if FDESC
extern struct vnodeopv_desc devfs_devfd_vnodeop_opv_desc;
extern const struct vnodeopv_desc devfs_fdesc_vnodeop_opv_desc;
#endif
#if MOCKFS
extern const struct vnodeopv_desc mockfs_vnodeop_opv_desc;
#endif
extern const struct vnodeopv_desc nullfs_vnodeop_opv_desc;
extern const struct vnodeopv_desc bindfs_vnodeop_opv_desc;
const struct vnodeopv_desc *vfs_opv_descs[] = {
&dead_vnodeop_opv_desc,
#if FIFO && SOCKETS
&fifo_vnodeop_opv_desc,
#endif
&spec_vnodeop_opv_desc,
#if MFS
&mfs_vnodeop_opv_desc,
#endif
#if CONFIG_NFS_CLIENT
&nfsv2_vnodeop_opv_desc,
&spec_nfsv2nodeop_opv_desc,
#if CONFIG_NFS4
&nfsv4_vnodeop_opv_desc,
&spec_nfsv4nodeop_opv_desc,
#endif
#if FIFO
&fifo_nfsv2nodeop_opv_desc,
#if CONFIG_NFS4
&fifo_nfsv4nodeop_opv_desc,
#endif
#endif
#endif
#if DEVFS
&devfs_vnodeop_opv_desc,
&devfs_spec_vnodeop_opv_desc,
#if FDESC
&devfs_devfd_vnodeop_opv_desc,
&devfs_fdesc_vnodeop_opv_desc,
#endif
#endif
#if NULLFS
&nullfs_vnodeop_opv_desc,
#endif
#if BINDFS
&bindfs_vnodeop_opv_desc,
#endif
#if MOCKFS
&mockfs_vnodeop_opv_desc,
#endif
NULL
};