Annotation of kernel/bsd/vfs/vfs_conf.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
        !             7:  * Reserved.  This file contains Original Code and/or Modifications of
        !             8:  * Original Code as defined in and that are subject to the Apple Public
        !             9:  * Source License Version 1.1 (the "License").  You may not use this file
        !            10:  * except in compliance with the License.  Please obtain a copy of the
        !            11:  * License at http://www.apple.com/publicsource and read it before using
        !            12:  * this file.
        !            13:  * 
        !            14:  * The Original Code and all software distributed under the License are
        !            15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            19:  * License for the specific language governing rights and limitations
        !            20:  * under the License.
        !            21:  * 
        !            22:  * @APPLE_LICENSE_HEADER_END@
        !            23:  */
        !            24: 
        !            25: /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
        !            26: /*
        !            27:  * Copyright (c) 1989, 1993, 1995
        !            28:  *     The Regents of the University of California.  All rights reserved.
        !            29:  *
        !            30:  * Redistribution and use in source and binary forms, with or without
        !            31:  * modification, are permitted provided that the following conditions
        !            32:  * are met:
        !            33:  * 1. Redistributions of source code must retain the above copyright
        !            34:  *    notice, this list of conditions and the following disclaimer.
        !            35:  * 2. Redistributions in binary form must reproduce the above copyright
        !            36:  *    notice, this list of conditions and the following disclaimer in the
        !            37:  *    documentation and/or other materials provided with the distribution.
        !            38:  * 3. All advertising materials mentioning features or use of this software
        !            39:  *    must display the following acknowledgement:
        !            40:  *     This product includes software developed by the University of
        !            41:  *     California, Berkeley and its contributors.
        !            42:  * 4. Neither the name of the University nor the names of its contributors
        !            43:  *    may be used to endorse or promote products derived from this software
        !            44:  *    without specific prior written permission.
        !            45:  *
        !            46:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            47:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            48:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            49:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            50:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            51:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            52:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            53:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            54:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            55:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            56:  * SUCH DAMAGE.
        !            57:  *
        !            58:  *     @(#)vfs_conf.c  8.11 (Berkeley) 5/10/95
        !            59:  */
        !            60: 
        !            61: #include <sys/param.h>
        !            62: #include <sys/systm.h>
        !            63: #include <sys/mount.h>
        !            64: #include <sys/vnode.h>
        !            65: 
        !            66: /*
        !            67:  * These define the root filesystem, device, and root filesystem type.
        !            68:  */
        !            69: struct mount *rootfs;
        !            70: struct vnode *rootvnode;
        !            71: int (*mountroot)() = NULL;
        !            72: 
        !            73: /*
        !            74:  * Set up the initial array of known filesystem types.
        !            75:  */
        !            76: extern struct vfsops ufs_vfsops;
        !            77: extern int ffs_mountroot();
        !            78: extern struct vfsops lfs_vfsops;
        !            79: extern int lfs_mountroot();
        !            80: extern struct vfsops mfs_vfsops;
        !            81: extern int mfs_mountroot();
        !            82: extern  struct vfsops hfs_vfsops;
        !            83: extern struct vfsops cd9660_vfsops;
        !            84: extern int cd9660_mountroot();
        !            85: extern struct vfsops msdos_vfsops;
        !            86: extern struct vfsops adosfs_vfsops;
        !            87: extern struct vfsops nfs_vfsops;
        !            88: extern int nfs_mountroot();
        !            89: extern struct vfsops afs_vfsops;
        !            90: extern struct vfsops procfs_vfsops;
        !            91: extern struct vfsops null_vfsops;
        !            92: extern struct vfsops union_vfsops;
        !            93: extern struct vfsops umap_vfsops;
        !            94: extern struct vfsops portal_vfsops;
        !            95: extern struct vfsops fdesc_vfsops;
        !            96: extern struct vfsops kernfs_vfsops;
        !            97: 
        !            98: /*
        !            99:  * Set up the filesystem operations for vnodes.
        !           100:  */
        !           101: static struct vfsconf vfsconflist[] = {
        !           102: 
        !           103:        /* Fast Filesystem */
        !           104: #if FFS
        !           105:        { &ufs_vfsops, "ufs", 1, 0, MNT_LOCAL, ffs_mountroot, NULL },
        !           106: #endif
        !           107: 
        !           108:        /* Log-based Filesystem */
        !           109: #if LFS
        !           110:        { &lfs_vfsops, "lfs", 5, 0, MNT_LOCAL, lfs_mountroot, NULL },
        !           111: #endif
        !           112: 
        !           113:        /* Memory-based Filesystem */
        !           114: #if MFS
        !           115:        { &mfs_vfsops, "mfs", 3, 0, MNT_LOCAL, mfs_mountroot, NULL },
        !           116: #endif
        !           117: 
        !           118:        /* HFS/HFS+ Filesystem */
        !           119: #if HFS
        !           120:        { &hfs_vfsops, "hfs", 17, 0, MNT_LOCAL | MNT_DOVOLFS, NULL, NULL },
        !           121: #endif
        !           122:        /* ISO9660 (aka CDROM) Filesystem */
        !           123: #if CD9660
        !           124:        { &cd9660_vfsops, "cd9660", 14, 0, MNT_LOCAL, cd9660_mountroot, NULL },
        !           125: #endif
        !           126: 
        !           127:        /* MSDOS Filesystem */
        !           128: #if MSDOS
        !           129:        { &msdos_vfsops, "msdos", 4, 0, MNT_LOCAL, NULL, NULL },
        !           130: #endif
        !           131: 
        !           132:        /* AmigaDOS Filesystem */
        !           133: #if ADOSFS
        !           134:        { &adosfs_vfsops, "adosfs", 16, 0, MNT_LOCAL, NULL, NULL },
        !           135: #endif
        !           136: 
        !           137:        /* Sun-compatible Network Filesystem */
        !           138: #if NFSCLIENT
        !           139:        { &nfs_vfsops, "nfs", 2, 0, 0, nfs_mountroot, NULL },
        !           140: #endif
        !           141: 
        !           142:        /* Andrew Filesystem */
        !           143: #if AFS
        !           144:        { &afs_vfsops, "andrewfs", 13, 0, 0, afs_mountroot, NULL },
        !           145: #endif
        !           146: 
        !           147:        /* /proc Filesystem */
        !           148: #if PROCFS
        !           149:        { &procfs_vfsops, "procfs", 12, 0, 0, NULL, NULL },
        !           150: #endif
        !           151: 
        !           152:        /* Loopback (Minimal) Filesystem Layer */
        !           153: #if NULLFS
        !           154:        { &null_vfsops, "loopback", 9, 0, 0, NULL, NULL },
        !           155: #endif
        !           156: 
        !           157:        /* Union (translucent) Filesystem */
        !           158: #if UNION
        !           159:        { &union_vfsops, "union", 15, 0, 0, NULL, NULL },
        !           160: #endif
        !           161: 
        !           162:        /* User/Group Identifer Remapping Filesystem */
        !           163: #if UMAPFS
        !           164:        { &umap_vfsops, "umap", 10, 0, 0, NULL, NULL },
        !           165: #endif
        !           166: 
        !           167:        /* Portal Filesystem */
        !           168: #if PORTAL
        !           169:        { &portal_vfsops, "portal", 8, 0, 0, NULL, NULL },
        !           170: #endif
        !           171: 
        !           172:        /* File Descriptor Filesystem */
        !           173: #if FDESC
        !           174:        { &fdesc_vfsops, "fdesc", 7, 0, 0, NULL, NULL },
        !           175: #endif
        !           176: 
        !           177:        /* Kernel Information Filesystem */
        !           178: #if KERNFS
        !           179:        { &kernfs_vfsops, "kernfs", 11, 0, 0, NULL, NULL },
        !           180: #endif
        !           181:        {0},
        !           182:        {0},
        !           183:        {0},
        !           184:        {0},
        !           185:        {0},
        !           186:        {0},
        !           187:        {0},
        !           188:        {0}
        !           189: };
        !           190: 
        !           191: /*
        !           192:  * Initially the size of the list, vfs_init will set maxvfsconf
        !           193:  * to the highest defined type number.
        !           194:  */
        !           195: int maxvfsslots = sizeof(vfsconflist) / sizeof (struct vfsconf);
        !           196: int numused_vfsslots = 0;
        !           197: int maxvfsconf = sizeof(vfsconflist) / sizeof (struct vfsconf);
        !           198: struct vfsconf *vfsconf = vfsconflist;
        !           199: 
        !           200: /*
        !           201:  *
        !           202:  * vfs_opv_descs enumerates the list of vnode classes, each with it's own
        !           203:  * vnode operation vector.  It is consulted at system boot to build operation
        !           204:  * vectors.  It is NULL terminated.
        !           205:  *
        !           206:  */
        !           207: extern struct vnodeopv_desc ffs_vnodeop_opv_desc;
        !           208: extern struct vnodeopv_desc ffs_specop_opv_desc;
        !           209: extern struct vnodeopv_desc ffs_fifoop_opv_desc;
        !           210: extern struct vnodeopv_desc lfs_vnodeop_opv_desc;
        !           211: extern struct vnodeopv_desc lfs_specop_opv_desc;
        !           212: extern struct vnodeopv_desc lfs_fifoop_opv_desc;
        !           213: extern struct vnodeopv_desc mfs_vnodeop_opv_desc;
        !           214: extern struct vnodeopv_desc dead_vnodeop_opv_desc;
        !           215: extern struct vnodeopv_desc fifo_vnodeop_opv_desc;
        !           216: extern struct vnodeopv_desc spec_vnodeop_opv_desc;
        !           217: extern struct vnodeopv_desc nfsv2_vnodeop_opv_desc;
        !           218: extern struct vnodeopv_desc spec_nfsv2nodeop_opv_desc;
        !           219: extern struct vnodeopv_desc fifo_nfsv2nodeop_opv_desc;
        !           220: extern struct vnodeopv_desc fdesc_vnodeop_opv_desc;
        !           221: extern struct vnodeopv_desc portal_vnodeop_opv_desc;
        !           222: extern struct vnodeopv_desc null_vnodeop_opv_desc;
        !           223: extern struct vnodeopv_desc umap_vnodeop_opv_desc;
        !           224: extern struct vnodeopv_desc kernfs_vnodeop_opv_desc;
        !           225: extern struct vnodeopv_desc procfs_vnodeop_opv_desc;
        !           226: extern struct vnodeopv_desc hfs_vnodeop_opv_desc;
        !           227: extern struct vnodeopv_desc cd9660_vnodeop_opv_desc;
        !           228: extern struct vnodeopv_desc cd9660_specop_opv_desc;
        !           229: extern struct vnodeopv_desc cd9660_fifoop_opv_desc;
        !           230: extern struct vnodeopv_desc union_vnodeop_opv_desc;
        !           231: 
        !           232: struct vnodeopv_desc *vfs_opv_descs[] = {
        !           233:        &ffs_vnodeop_opv_desc,
        !           234:        &ffs_specop_opv_desc,
        !           235: #if FIFO
        !           236:        &ffs_fifoop_opv_desc,
        !           237: #endif
        !           238:        &dead_vnodeop_opv_desc,
        !           239: #if FIFO
        !           240:        &fifo_vnodeop_opv_desc,
        !           241: #endif
        !           242:        &spec_vnodeop_opv_desc,
        !           243: #if LFS
        !           244:        &lfs_vnodeop_opv_desc,
        !           245:        &lfs_specop_opv_desc,
        !           246: #if FIFO
        !           247:        &lfs_fifoop_opv_desc,
        !           248: #endif
        !           249: #endif
        !           250: #if MFS
        !           251:        &mfs_vnodeop_opv_desc,
        !           252: #endif
        !           253: #if NFSCLIENT
        !           254:        &nfsv2_vnodeop_opv_desc,
        !           255:        &spec_nfsv2nodeop_opv_desc,
        !           256: #if FIFO
        !           257:        &fifo_nfsv2nodeop_opv_desc,
        !           258: #endif
        !           259: #endif
        !           260: #if FDESC
        !           261:        &fdesc_vnodeop_opv_desc,
        !           262: #endif
        !           263: #if PORTAL
        !           264:        &portal_vnodeop_opv_desc,
        !           265: #endif
        !           266: #if NULLFS
        !           267:        &null_vnodeop_opv_desc,
        !           268: #endif
        !           269: #if UMAPFS
        !           270:        &umap_vnodeop_opv_desc,
        !           271: #endif
        !           272: #if KERNFS
        !           273:        &kernfs_vnodeop_opv_desc,
        !           274: #endif
        !           275: #if PROCFS
        !           276:        &procfs_vnodeop_opv_desc,
        !           277: #endif
        !           278: #if HFS
        !           279:        &hfs_vnodeop_opv_desc,
        !           280: #endif
        !           281: #if CD9660
        !           282:        &cd9660_vnodeop_opv_desc,
        !           283:        &cd9660_specop_opv_desc,
        !           284: #if FIFO
        !           285:        &cd9660_fifoop_opv_desc,
        !           286: #endif
        !           287: #endif
        !           288: #if UNION
        !           289:        &union_vnodeop_opv_desc,
        !           290: #endif
        !           291:        NULL
        !           292: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.