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 (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
23 *
24 * Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
25 * All rights reserved.
26 */
27
28 #include <sys/param.h>
29 #include <sys/types.h>
30 #include <sys/systm.h>
31 #include <sys/cred.h>
32 #include <sys/vfs.h>
33 #include <sys/vfs_opreg.h>
34 #include <sys/vnode.h>
35 #include <sys/pathname.h>
36 #include <sys/sysmacros.h>
37 #include <sys/kmem.h>
38 #include <sys/mkdev.h>
39 #include <sys/mount.h>
40 #include <sys/mntent.h>
41 #include <sys/statvfs.h>
42 #include <sys/errno.h>
1118
1119 p2 = p = allpc;
1120 while (p != NULL && p != mi->mi_pathconf) {
1121 p2 = p;
1122 p = p->pc_next;
1123 }
1124 if (p == NULL) {
1125 panic("mi->pathconf");
1126 /*NOTREACHED*/
1127 }
1128 if (p == allpc)
1129 allpc = p->pc_next;
1130 else
1131 p2->pc_next = p->pc_next;
1132 kmem_free(p, sizeof (*p));
1133 mi->mi_pathconf = NULL;
1134 }
1135 }
1136 }
1137
1138 static int nfs_dynamic = 1; /* global variable to enable dynamic retrans. */
1139 static ushort_t nfs_max_threads = 8; /* max number of active async threads */
1140 static uint_t nfs_async_clusters = 1; /* # of reqs from each async queue */
1141 static uint_t nfs_cots_timeo = NFS_COTS_TIMEO;
1142
1143 static int
1144 nfsrootvp(vnode_t **rtvpp, vfs_t *vfsp, struct servinfo *svp,
1145 int flags, cred_t *cr, zone_t *zone)
1146 {
1147 vnode_t *rtvp;
1148 mntinfo_t *mi;
1149 dev_t nfs_dev;
1150 struct vattr va;
1151 int error;
1152 rnode_t *rp;
1153 int i;
1154 struct nfs_stats *nfsstatsp;
1155 cred_t *lcr = NULL, *tcr = cr;
1156
1157 nfsstatsp = zone_getspecific(nfsstat_zone_key, nfs_zone());
1158 ASSERT(nfsstatsp != NULL);
1159
1160 /*
1161 * Create a mount record and link it to the vfs struct.
|
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 (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
24 *
25 * Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
26 * All rights reserved.
27 */
28
29 #include <sys/param.h>
30 #include <sys/types.h>
31 #include <sys/systm.h>
32 #include <sys/cred.h>
33 #include <sys/vfs.h>
34 #include <sys/vfs_opreg.h>
35 #include <sys/vnode.h>
36 #include <sys/pathname.h>
37 #include <sys/sysmacros.h>
38 #include <sys/kmem.h>
39 #include <sys/mkdev.h>
40 #include <sys/mount.h>
41 #include <sys/mntent.h>
42 #include <sys/statvfs.h>
43 #include <sys/errno.h>
1119
1120 p2 = p = allpc;
1121 while (p != NULL && p != mi->mi_pathconf) {
1122 p2 = p;
1123 p = p->pc_next;
1124 }
1125 if (p == NULL) {
1126 panic("mi->pathconf");
1127 /*NOTREACHED*/
1128 }
1129 if (p == allpc)
1130 allpc = p->pc_next;
1131 else
1132 p2->pc_next = p->pc_next;
1133 kmem_free(p, sizeof (*p));
1134 mi->mi_pathconf = NULL;
1135 }
1136 }
1137 }
1138
1139 volatile int nfs_dynamic = 1; /* global variable to enable dynamic retrans. */
1140 volatile ushort_t nfs_max_threads = 8; /* max number of active async threads */
1141 volatile uint_t nfs_async_clusters = 1; /* # of reqs from each async queue */
1142 volatile uint_t nfs_cots_timeo = NFS_COTS_TIMEO;
1143
1144 static int
1145 nfsrootvp(vnode_t **rtvpp, vfs_t *vfsp, struct servinfo *svp,
1146 int flags, cred_t *cr, zone_t *zone)
1147 {
1148 vnode_t *rtvp;
1149 mntinfo_t *mi;
1150 dev_t nfs_dev;
1151 struct vattr va;
1152 int error;
1153 rnode_t *rp;
1154 int i;
1155 struct nfs_stats *nfsstatsp;
1156 cred_t *lcr = NULL, *tcr = cr;
1157
1158 nfsstatsp = zone_getspecific(nfsstat_zone_key, nfs_zone());
1159 ASSERT(nfsstatsp != NULL);
1160
1161 /*
1162 * Create a mount record and link it to the vfs struct.
|