1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #pragma ident "%Z%%M% %I% %E% SMI" 27 /* SunOS-4.1 1.16 */ 28 29 #include <sys/types.h> 30 #include <sys/param.h> 31 #include <sys/vfs.h> 32 #include <sys/t_lock.h> 33 34 extern int swapinit(int fstype, char *name); 35 36 /* 37 * WARNING: THE POSITIONS OF FILESYSTEM TYPES IN THIS TABLE SHOULD NOT 38 * BE CHANGED. These positions are used in generating fsids and 39 * fhandles. Thus, changing positions will cause a server to change 40 * the fhandle it gives out for a file. It is okay to reuse formerly 41 * used slots, just be sure that we're not going to start supporting 42 * the former owner of the slot again. 43 * 44 * Since there's been some question about whether the above comment is 45 * true, let's provide more detail. Most filesystems call 46 * vfs_make_fsid with two arguments that go into making the fsid: the 47 * dev number, and the fs type number - which is the offset of the 48 * filesystem's entry in the below table. If you would like to check 49 * if the position of the filesystem in this table still affects the 50 * fsid, just check what arguments filesystems are calling 51 * vfs_make_fsid with. 52 * 53 * The scenario we're trying to prevent here is: 54 * 55 * NFS server gets upgraded to new kernel version with different vfssw 56 * Clients are -not- rebooted, still retain filehandles 57 * NFS server boots up and now the fsid of an exported fs is different 58 * --> Clients get stale file handle errors 59 */ 60 61 struct vfssw vfssw[] = { 62 { "BADVFS" }, /* invalid */ 63 { "specfs" }, /* SPECFS */ 64 { "ufs" }, /* UFS */ 65 { "fifofs" }, /* FIFOFS */ 66 { "namefs" }, /* NAMEFS */ 67 { "proc" }, /* PROCFS */ 68 { "samfs" }, /* QFS */ 69 { "nfs" }, /* NFS Version 2 */ 70 { "zfs" }, /* ZFS */ 71 { "hsfs" }, /* HSFS */ 72 { "lofs" }, /* LOFS */ 73 { "tmpfs" }, /* TMPFS */ 74 { "fd" }, /* FDFS */ 75 { "pcfs" }, /* PCFS */ 76 { "swapfs", swapinit }, /* SWAPFS */ 77 { "mntfs" }, /* MNTFS */ 78 { "devfs" }, /* DEVFS */ 79 { "dev" }, /* DEV */ 80 { "ctfs" }, /* CONTRACTFS */ 81 { "objfs" }, /* OBJFS */ 82 { "sharefs" }, /* SHAREFS */ 83 { "dcfs" }, /* DCFS */ 84 { "" }, /* reserved for loadable fs */ 85 { "" }, 86 { "" }, 87 { "" }, 88 { "" }, 89 { "" }, 90 { "" }, 91 { "" }, 92 { "" }, 93 { "" }, 94 { "" }, 95 { "" }, 96 { "" }, 97 { "" }, 98 }; 99 100 const int nfstype = (sizeof (vfssw) / sizeof (vfssw[0])); 101