1 /*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 4. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
33 */
34
35 #include <sys/cdefs.h>
36 __FBSDID("$FreeBSD$");
37
38
39 #include "opt_bootp.h"
40 #include "opt_nfsroot.h"
41
42 #include <sys/param.h>
43 #include <sys/systm.h>
44 #include <sys/kernel.h>
45 #include <sys/bio.h>
46 #include <sys/buf.h>
47 #include <sys/clock.h>
48 #include <sys/lock.h>
49 #include <sys/malloc.h>
50 #include <sys/mbuf.h>
51 #include <sys/module.h>
52 #include <sys/mount.h>
53 #include <sys/proc.h>
54 #include <sys/socket.h>
55 #include <sys/socketvar.h>
56 #include <sys/sockio.h>
57 #include <sys/sysctl.h>
58 #include <sys/vnode.h>
59 #include <sys/signalvar.h>
60
61 #include <vm/vm.h>
62 #include <vm/vm_extern.h>
63 #include <vm/uma.h>
64
65 #include <net/if.h>
66 #include <net/route.h>
67 #include <netinet/in.h>
68
69 #include <rpc/rpcclnt.h>
70
71 #include <nfs/rpcv2.h>
72 #include <nfs/nfsproto.h>
73 #include <nfsclient/nfs.h>
74 #include <nfsclient/nfsnode.h>
75 #include <nfsclient/nfsmount.h>
76 #include <nfs/xdr_subs.h>
77 #include <nfsclient/nfsm_subs.h>
78 #include <nfsclient/nfsdiskless.h>
79
80 MALLOC_DEFINE(M_NFSREQ, "nfsclient_req", "NFS request header");
81 MALLOC_DEFINE(M_NFSBIGFH, "nfsclient_bigfh", "NFS version 3 file handle");
82 MALLOC_DEFINE(M_NFSDIROFF, "nfsclient_diroff", "NFS directory offset data");
83 MALLOC_DEFINE(M_NFSHASH, "nfsclient_hash", "NFS hash tables");
84 MALLOC_DEFINE(M_NFSDIRECTIO, "nfsclient_directio", "NFS Direct IO async write state");
85
86 uma_zone_t nfsmount_zone;
87
88 struct nfsstats nfsstats;
89
90 SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem");
91 SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RW,
92 &nfsstats, nfsstats, "S,nfsstats");
93 static int nfs_ip_paranoia = 1;
94 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW,
95 &nfs_ip_paranoia, 0, "");
96 #ifdef NFS_DEBUG
97 int nfs_debug;
98 SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, "");
99 #endif
100 static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY;
101 SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL_DELAY,
102 downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, "");
103 /* how long between console messages "nfs server foo not responding" */
104 static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
105 SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY,
106 downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
107
108 static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp,
109 struct nfs_args *argp, const char *hostname);
110 static int mountnfs(struct nfs_args *, struct mount *,
111 struct sockaddr *, char *, struct vnode **,
112 struct ucred *cred);
113 static vfs_mount_t nfs_mount;
114 static vfs_cmount_t nfs_cmount;
115 static vfs_unmount_t nfs_unmount;
116 static vfs_root_t nfs_root;
117 static vfs_statfs_t nfs_statfs;
118 static vfs_sync_t nfs_sync;
119 static vfs_sysctl_t nfs_sysctl;
120
121 /*
122 * nfs vfs operations.
123 */
124 static struct vfsops nfs_vfsops = {
125 .vfs_init = nfs_init,
126 .vfs_mount = nfs_mount,
127 .vfs_cmount = nfs_cmount,
128 .vfs_root = nfs_root,
129 .vfs_statfs = nfs_statfs,
130 .vfs_sync = nfs_sync,
131 .vfs_uninit = nfs_uninit,
132 .vfs_unmount = nfs_unmount,
133 .vfs_sysctl = nfs_sysctl,
134 };
135 VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK);
136
137 /* So that loader and kldload(2) can find us, wherever we are.. */
138 MODULE_VERSION(nfs, 1);
139
140 static struct nfs_rpcops nfs_rpcops = {
141 nfs_readrpc,
142 nfs_writerpc,
143 nfs_writebp,
144 nfs_readlinkrpc,
145 nfs_invaldir,
146 nfs_commit,
147 };
148
149 /*
150 * This structure must be filled in by a primary bootstrap or bootstrap
151 * server for a diskless/dataless machine. It is initialized below just
152 * to ensure that it is allocated to initialized data (.data not .bss).
153 */
154 struct nfs_diskless nfs_diskless = { { { 0 } } };
155 struct nfsv3_diskless nfsv3_diskless = { { { 0 } } };
156 int nfs_diskless_valid = 0;
157
158 SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD,
159 &nfs_diskless_valid, 0, "");
160
161 SYSCTL_STRING(_vfs_nfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD,
162 nfsv3_diskless.root_hostnam, 0, "");
163
164 SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD,
165 &nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr,
166 "%Ssockaddr_in", "");
167
168
169 void nfsargs_ntoh(struct nfs_args *);
170 static int nfs_mountdiskless(char *, int,
171 struct sockaddr_in *, struct nfs_args *,
172 struct thread *, struct vnode **, struct mount *);
173 static void nfs_convert_diskless(void);
174 static void nfs_convert_oargs(struct nfs_args *args,
175 struct onfs_args *oargs);
176
177 int
178 nfs_iosize(struct nfsmount *nmp)
179 {
180 int iosize;
181
182 /*
183 * Calculate the size used for io buffers. Use the larger
184 * of the two sizes to minimise nfs requests but make sure
185 * that it is at least one VM page to avoid wasting buffer
186 * space.
187 */
188 iosize = imax(nmp->nm_rsize, nmp->nm_wsize);
189 iosize = imax(iosize, PAGE_SIZE);
190 return (iosize);
191 }
192
193 static void
194 nfs_convert_oargs(struct nfs_args *args, struct onfs_args *oargs)
195 {
196
197 args->version = NFS_ARGSVERSION;
198 args->addr = oargs->addr;
199 args->addrlen = oargs->addrlen;
200 args->sotype = oargs->sotype;
201 args->proto = oargs->proto;
202 args->fh = oargs->fh;
203 args->fhsize = oargs->fhsize;
204 args->flags = oargs->flags;
205 args->wsize = oargs->wsize;
206 args->rsize = oargs->rsize;
207 args->readdirsize = oargs->readdirsize;
208 args->timeo = oargs->timeo;
209 args->retrans = oargs->retrans;
210 args->maxgrouplist = oargs->maxgrouplist;
211 args->readahead = oargs->readahead;
212 args->deadthresh = oargs->deadthresh;
213 args->hostname = oargs->hostname;
214 }
215
216 static void
217 nfs_convert_diskless(void)
218 {
219
220 bcopy(&nfs_diskless.myif, &nfsv3_diskless.myif,
221 sizeof(struct ifaliasreq));
222 bcopy(&nfs_diskless.mygateway, &nfsv3_diskless.mygateway,
223 sizeof(struct sockaddr_in));
224 nfs_convert_oargs(&nfsv3_diskless.root_args,&nfs_diskless.root_args);
225 if (nfsv3_diskless.root_args.flags & NFSMNT_NFSV3) {
226 nfsv3_diskless.root_fhsize = NFSX_V3FH;
227 bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_V3FH);
228 } else {
229 nfsv3_diskless.root_fhsize = NFSX_V2FH;
230 bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_V2FH);
231 }
232 bcopy(&nfs_diskless.root_saddr,&nfsv3_diskless.root_saddr,
233 sizeof(struct sockaddr_in));
234 bcopy(nfs_diskless.root_hostnam, nfsv3_diskless.root_hostnam, MNAMELEN);
235 nfsv3_diskless.root_time = nfs_diskless.root_time;
236 bcopy(nfs_diskless.my_hostnam, nfsv3_diskless.my_hostnam,
237 MAXHOSTNAMELEN);
238 nfs_diskless_valid = 3;
239 }
240
241 /*
242 * nfs statfs call
243 */
244 static int
245 nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
246 {
247 struct vnode *vp;
248 struct nfs_statfs *sfp;
249 caddr_t bpos, dpos;
250 struct nfsmount *nmp = VFSTONFS(mp);
251 int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
252 struct mbuf *mreq, *mrep, *md, *mb;
253 struct nfsnode *np;
254 u_quad_t tquad;
255
256 #ifndef nolint
257 sfp = NULL;
258 #endif
259 error = vfs_busy(mp, LK_NOWAIT, NULL, td);
260 if (error)
261 return (error);
262 error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE);
263 if (error) {
264 vfs_unbusy(mp, td);
265 return (error);
266 }
267 vp = NFSTOV(np);
268 mtx_lock(&nmp->nm_mtx);
269 if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) {
270 mtx_unlock(&nmp->nm_mtx);
271 (void)nfs_fsinfo(nmp, vp, td->td_ucred, td);
272 } else
273 mtx_unlock(&nmp->nm_mtx);
274 nfsstats.rpccnt[NFSPROC_FSSTAT]++;
275 mreq = nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
276 mb = mreq;
277 bpos = mtod(mb, caddr_t);
278 nfsm_fhtom(vp, v3);
279 nfsm_request(vp, NFSPROC_FSSTAT, td, td->td_ucred);
280 if (v3)
281 nfsm_postop_attr(vp, retattr);
282 if (error) {
283 if (mrep != NULL)
284 m_freem(mrep);
285 goto nfsmout;
286 }
287 sfp = nfsm_dissect(struct nfs_statfs *, NFSX_STATFS(v3));
288 mtx_lock(&nmp->nm_mtx);
289 sbp->f_iosize = nfs_iosize(nmp);
290 mtx_unlock(&nmp->nm_mtx);
291 if (v3) {
292 sbp->f_bsize = NFS_FABLKSIZE;
293 tquad = fxdr_hyper(&sfp->sf_tbytes);
294 sbp->f_blocks = tquad / NFS_FABLKSIZE;
295 tquad = fxdr_hyper(&sfp->sf_fbytes);
296 sbp->f_bfree = tquad / NFS_FABLKSIZE;
297 tquad = fxdr_hyper(&sfp->sf_abytes);
298 sbp->f_bavail = tquad / NFS_FABLKSIZE;
299 sbp->f_files = (fxdr_unsigned(int32_t,
300 sfp->sf_tfiles.nfsuquad[1]) & 0x7fffffff);
301 sbp->f_ffree = (fxdr_unsigned(int32_t,
302 sfp->sf_ffiles.nfsuquad[1]) & 0x7fffffff);
303 } else {
304 sbp->f_bsize = fxdr_unsigned(int32_t, sfp->sf_bsize);
305 sbp->f_blocks = fxdr_unsigned(int32_t, sfp->sf_blocks);
306 sbp->f_bfree = fxdr_unsigned(int32_t, sfp->sf_bfree);
307 sbp->f_bavail = fxdr_unsigned(int32_t, sfp->sf_bavail);
308 sbp->f_files = 0;
309 sbp->f_ffree = 0;
310 }
311 m_freem(mrep);
312 nfsmout:
313 vput(vp);
314 vfs_unbusy(mp, td);
315 return (error);
316 }
317
318 /*
319 * nfs version 3 fsinfo rpc call
320 */
321 int
322 nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred,
323 struct thread *td)
324 {
325 struct nfsv3_fsinfo *fsp;
326 u_int32_t pref, max;
327 caddr_t bpos, dpos;
328 int error = 0, retattr;
329 struct mbuf *mreq, *mrep, *md, *mb;
330 u_int64_t maxfsize;
331
332 nfsstats.rpccnt[NFSPROC_FSINFO]++;
333 mreq = nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1));
334 mb = mreq;
335 bpos = mtod(mb, caddr_t);
336 nfsm_fhtom(vp, 1);
337 nfsm_request(vp, NFSPROC_FSINFO, td, cred);
338 nfsm_postop_attr(vp, retattr);
339 if (!error) {
340 fsp = nfsm_dissect(struct nfsv3_fsinfo *, NFSX_V3FSINFO);
341 pref = fxdr_unsigned(u_int32_t, fsp->fs_wtpref);
342 mtx_lock(&nmp->nm_mtx);
343 if (pref < nmp->nm_wsize && pref >= NFS_FABLKSIZE)
344 nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) &
345 ~(NFS_FABLKSIZE - 1);
346 max = fxdr_unsigned(u_int32_t, fsp->fs_wtmax);
347 if (max < nmp->nm_wsize && max > 0) {
348 nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1);
349 if (nmp->nm_wsize == 0)
350 nmp->nm_wsize = max;
351 }
352 pref = fxdr_unsigned(u_int32_t, fsp->fs_rtpref);
353 if (pref < nmp->nm_rsize && pref >= NFS_FABLKSIZE)
354 nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) &
355 ~(NFS_FABLKSIZE - 1);
356 max = fxdr_unsigned(u_int32_t, fsp->fs_rtmax);
357 if (max < nmp->nm_rsize && max > 0) {
358 nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1);
359 if (nmp->nm_rsize == 0)
360 nmp->nm_rsize = max;
361 }
362 pref = fxdr_unsigned(u_int32_t, fsp->fs_dtpref);
363 if (pref < nmp->nm_readdirsize && pref >= NFS_DIRBLKSIZ)
364 nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) &
365 ~(NFS_DIRBLKSIZ - 1);
366 if (max < nmp->nm_readdirsize && max > 0) {
367 nmp->nm_readdirsize = max & ~(NFS_DIRBLKSIZ - 1);
368 if (nmp->nm_readdirsize == 0)
369 nmp->nm_readdirsize = max;
370 }
371 maxfsize = fxdr_hyper(&fsp->fs_maxfilesize);
372 if (maxfsize > 0 && maxfsize < nmp->nm_maxfilesize)
373 nmp->nm_maxfilesize = maxfsize;
374 nmp->nm_mountp->mnt_stat.f_iosize = nfs_iosize(nmp);
375 nmp->nm_state |= NFSSTA_GOTFSINFO;
376 mtx_unlock(&nmp->nm_mtx);
377 }
378 m_freem(mrep);
379 nfsmout:
380 return (error);
381 }
382
383 /*
384 * Mount a remote root fs via. nfs. This depends on the info in the
385 * nfs_diskless structure that has been filled in properly by some primary
386 * bootstrap.
387 * It goes something like this:
388 * - do enough of "ifconfig" by calling ifioctl() so that the system
389 * can talk to the server
390 * - If nfs_diskless.mygateway is filled in, use that address as
391 * a default gateway.
392 * - build the rootfs mount point and call mountnfs() to do the rest.
393 *
394 * It is assumed to be safe to read, modify, and write the nfsv3_diskless
395 * structure, as well as other global NFS client variables here, as
396 * nfs_mountroot() will be called once in the boot before any other NFS
397 * client activity occurs.
398 */
399 int
400 nfs_mountroot(struct mount *mp, struct thread *td)
401 {
402 struct nfsv3_diskless *nd = &nfsv3_diskless;
403 struct socket *so;
404 struct vnode *vp;
405 struct ifreq ir;
406 int error, i;
407 u_long l;
408 char buf[128];
409 char *cp;
410
411 #if defined(BOOTP_NFSROOT) && defined(BOOTP)
412 bootpc_init(); /* use bootp to get nfs_diskless filled in */
413 #elif defined(NFS_ROOT)
414 nfs_setup_diskless();
415 #endif
416
417 if (nfs_diskless_valid == 0)
418 return (-1);
419 if (nfs_diskless_valid == 1)
420 nfs_convert_diskless();
421
422 /*
423 * XXX splnet, so networks will receive...
424 */
425 splnet();
426
427 /*
428 * Do enough of ifconfig(8) so that the critical net interface can
429 * talk to the server.
430 */
431 error = socreate(nd->myif.ifra_addr.sa_family, &so, nd->root_args.sotype, 0,
432 td->td_ucred, td);
433 if (error)
434 panic("nfs_mountroot: socreate(%04x): %d",
435 nd->myif.ifra_addr.sa_family, error);
436
437 #if 0 /* XXX Bad idea */
438 /*
439 * We might not have been told the right interface, so we pass
440 * over the first ten interfaces of the same kind, until we get
441 * one of them configured.
442 */
443
444 for (i = strlen(nd->myif.ifra_name) - 1;
445 nd->myif.ifra_name[i] >= '' &&
446 nd->myif.ifra_name[i] <= '9';
447 nd->myif.ifra_name[i] ++) {
448 error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
449 if(!error)
450 break;
451 }
452 #endif
453 error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
454 if (error)
455 panic("nfs_mountroot: SIOCAIFADDR: %d", error);
456 if ((cp = getenv("boot.netif.mtu")) != NULL) {
457 ir.ifr_mtu = strtol(cp, NULL, 10);
458 bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ);
459 freeenv(cp);
460 error = ifioctl(so, SIOCSIFMTU, (caddr_t)&ir, td);
461 if (error)
462 printf("nfs_mountroot: SIOCSIFMTU: %d", error);
463 }
464 soclose(so);
465
466 /*
467 * If the gateway field is filled in, set it as the default route.
468 * Note that pxeboot will set a default route of 0 if the route
469 * is not set by the DHCP server. Check also for a value of 0
470 * to avoid panicking inappropriately in that situation.
471 */
472 if (nd->mygateway.sin_len != 0 &&
473 nd->mygateway.sin_addr.s_addr != 0) {
474 struct sockaddr_in mask, sin;
475
476 bzero((caddr_t)&mask, sizeof(mask));
477 sin = mask;
478 sin.sin_family = AF_INET;
479 sin.sin_len = sizeof(sin);
480 /* XXX MRT use table 0 for this sort of thing */
481 error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
482 (struct sockaddr *)&nd->mygateway,
483 (struct sockaddr *)&mask,
484 RTF_UP | RTF_GATEWAY, NULL);
485 if (error)
486 panic("nfs_mountroot: RTM_ADD: %d", error);
487 }
488
489 /*
490 * Create the rootfs mount point.
491 */
492 nd->root_args.fh = nd->root_fh;
493 nd->root_args.fhsize = nd->root_fhsize;
494 l = ntohl(nd->root_saddr.sin_addr.s_addr);
495 snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s",
496 (l >> 24) & 0xff, (l >> 16) & 0xff,
497 (l >> 8) & 0xff, (l >> 0) & 0xff, nd->root_hostnam);
498 printf("NFS ROOT: %s\n", buf);
499 nd->root_args.hostname = buf;
500 if ((error = nfs_mountdiskless(buf, MNT_RDONLY,
501 &nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) {
502 return (error);
503 }
504
505 /*
506 * This is not really an nfs issue, but it is much easier to
507 * set hostname here and then let the "/etc/rc.xxx" files
508 * mount the right /var based upon its preset value.
509 */
510 bcopy(nd->my_hostnam, hostname, MAXHOSTNAMELEN);
511 hostname[MAXHOSTNAMELEN - 1] = '\0';
512 for (i = 0; i < MAXHOSTNAMELEN; i++)
513 if (hostname[i] == '\0')
514 break;
515 inittodr(ntohl(nd->root_time));
516 return (0);
517 }
518
519 /*
520 * Internal version of mount system call for diskless setup.
521 */
522 static int
523 nfs_mountdiskless(char *path, int mountflag,
524 struct sockaddr_in *sin, struct nfs_args *args, struct thread *td,
525 struct vnode **vpp, struct mount *mp)
526 {
527 struct sockaddr *nam;
528 int error;
529
530 MNT_ILOCK(mp);
531 mp->mnt_kern_flag = 0;
532 mp->mnt_flag = mountflag;
533 MNT_IUNLOCK(mp);
534 nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK);
535 if ((error = mountnfs(args, mp, nam, path, vpp,
536 td->td_ucred)) != 0) {
537 printf("nfs_mountroot: mount %s on /: %d\n", path, error);
538 return (error);
539 }
540 return (0);
541 }
542
543 static void
544 nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
545 const char *hostname)
546 {
547 int s;
548 int adjsock;
549 int maxio;
550 char *p;
551
552 s = splnet();
553
554 /*
555 * Set read-only flag if requested; otherwise, clear it if this is
556 * an update. If this is not an update, then either the read-only
557 * flag is already clear, or this is a root mount and it was set
558 * intentionally at some previous point.
559 */
560 if (vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL) == 0) {
561 MNT_ILOCK(mp);
562 mp->mnt_flag |= MNT_RDONLY;
563 MNT_IUNLOCK(mp);
564 } else if (mp->mnt_flag & MNT_UPDATE) {
565 MNT_ILOCK(mp);
566 mp->mnt_flag &= ~MNT_RDONLY;
567 MNT_IUNLOCK(mp);
568 }
569
570 /*
571 * Silently clear NFSMNT_NOCONN if it's a TCP mount, it makes
572 * no sense in that context. Also, set up appropriate retransmit
573 * and soft timeout behavior.
574 */
575 if (argp->sotype == SOCK_STREAM) {
576 nmp->nm_flag &= ~NFSMNT_NOCONN;
577 nmp->nm_flag |= NFSMNT_DUMBTIMR;
578 nmp->nm_timeo = NFS_MAXTIMEO;
579 nmp->nm_retry = NFS_RETRANS_TCP;
580 }
581
582 /* Also clear RDIRPLUS if not NFSv3, it crashes some servers */
583 if ((argp->flags & NFSMNT_NFSV3) == 0)
584 nmp->nm_flag &= ~NFSMNT_RDIRPLUS;
585
586 /* Re-bind if rsrvd port requested and wasn't on one */
587 adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT)
588 && (argp->flags & NFSMNT_RESVPORT);
589 /* Also re-bind if we're switching to/from a connected UDP socket */
590 adjsock |= ((nmp->nm_flag & NFSMNT_NOCONN) !=
591 (argp->flags & NFSMNT_NOCONN));
592
593 /* Update flags atomically. Don't change the lock bits. */
594 nmp->nm_flag = argp->flags | nmp->nm_flag;
595 splx(s);
596
597 if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) {
598 nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10;
599 if (nmp->nm_timeo < NFS_MINTIMEO)
600 nmp->nm_timeo = NFS_MINTIMEO;
601 else if (nmp->nm_timeo > NFS_MAXTIMEO)
602 nmp->nm_timeo = NFS_MAXTIMEO;
603 }
604
605 if ((argp->flags & NFSMNT_RETRANS) && argp->retrans > 1) {
606 nmp->nm_retry = argp->retrans;
607 if (nmp->nm_retry > NFS_MAXREXMIT)
608 nmp->nm_retry = NFS_MAXREXMIT;
609 }
610
611 if (argp->flags & NFSMNT_NFSV3) {
612 if (argp->sotype == SOCK_DGRAM)
613 maxio = NFS_MAXDGRAMDATA;
614 else
615 maxio = NFS_MAXDATA;
616 } else
617 maxio = NFS_V2MAXDATA;
618
619 if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) {
620 nmp->nm_wsize = argp->wsize;
621 /* Round down to multiple of blocksize */
622 nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1);
623 if (nmp->nm_wsize <= 0)
624 nmp->nm_wsize = NFS_FABLKSIZE;
625 }
626 if (nmp->nm_wsize > maxio)
627 nmp->nm_wsize = maxio;
628 if (nmp->nm_wsize > MAXBSIZE)
629 nmp->nm_wsize = MAXBSIZE;
630
631 if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) {
632 nmp->nm_rsize = argp->rsize;
633 /* Round down to multiple of blocksize */
634 nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1);
635 if (nmp->nm_rsize <= 0)
636 nmp->nm_rsize = NFS_FABLKSIZE;
637 }
638 if (nmp->nm_rsize > maxio)
639 nmp->nm_rsize = maxio;
640 if (nmp->nm_rsize > MAXBSIZE)
641 nmp->nm_rsize = MAXBSIZE;
642
643 if ((argp->flags & NFSMNT_READDIRSIZE) && argp->readdirsize > 0) {
644 nmp->nm_readdirsize = argp->readdirsize;
645 }
646 if (nmp->nm_readdirsize > maxio)
647 nmp->nm_readdirsize = maxio;
648 if (nmp->nm_readdirsize > nmp->nm_rsize)
649 nmp->nm_readdirsize = nmp->nm_rsize;
650
651 if ((argp->flags & NFSMNT_ACREGMIN) && argp->acregmin >= 0)
652 nmp->nm_acregmin = argp->acregmin;
653 else
654 nmp->nm_acregmin = NFS_MINATTRTIMO;
655 if ((argp->flags & NFSMNT_ACREGMAX) && argp->acregmax >= 0)
656 nmp->nm_acregmax = argp->acregmax;
657 else
658 nmp->nm_acregmax = NFS_MAXATTRTIMO;
659 if ((argp->flags & NFSMNT_ACDIRMIN) && argp->acdirmin >= 0)
660 nmp->nm_acdirmin = argp->acdirmin;
661 else
662 nmp->nm_acdirmin = NFS_MINDIRATTRTIMO;
663 if ((argp->flags & NFSMNT_ACDIRMAX) && argp->acdirmax >= 0)
664 nmp->nm_acdirmax = argp->acdirmax;
665 else
666 nmp->nm_acdirmax = NFS_MAXDIRATTRTIMO;
667 if (nmp->nm_acdirmin > nmp->nm_acdirmax)
668 nmp->nm_acdirmin = nmp->nm_acdirmax;
669 if (nmp->nm_acregmin > nmp->nm_acregmax)
670 nmp->nm_acregmin = nmp->nm_acregmax;
671
672 if ((argp->flags & NFSMNT_MAXGRPS) && argp->maxgrouplist >= 0) {
673 if (argp->maxgrouplist <= NFS_MAXGRPS)
674 nmp->nm_numgrps = argp->maxgrouplist;
675 else
676 nmp->nm_numgrps = NFS_MAXGRPS;
677 }
678 if ((argp->flags & NFSMNT_READAHEAD) && argp->readahead >= 0) {
679 if (argp->readahead <= NFS_MAXRAHEAD)
680 nmp->nm_readahead = argp->readahead;
681 else
682 nmp->nm_readahead = NFS_MAXRAHEAD;
683 }
684 if ((argp->flags & NFSMNT_WCOMMITSIZE) && argp->wcommitsize >= 0) {
685 if (argp->wcommitsize < nmp->nm_wsize)
686 nmp->nm_wcommitsize = nmp->nm_wsize;
687 else
688 nmp->nm_wcommitsize = argp->wcommitsize;
689 }
690 if ((argp->flags & NFSMNT_DEADTHRESH) && argp->deadthresh >= 0) {
691 if (argp->deadthresh <= NFS_MAXDEADTHRESH)
692 nmp->nm_deadthresh = argp->deadthresh;
693 else
694 nmp->nm_deadthresh = NFS_MAXDEADTHRESH;
695 }
696
697 adjsock |= ((nmp->nm_sotype != argp->sotype) ||
698 (nmp->nm_soproto != argp->proto));
699 nmp->nm_sotype = argp->sotype;
700 nmp->nm_soproto = argp->proto;
701
702 if (nmp->nm_so && adjsock) {
703 nfs_safedisconnect(nmp);
704 if (nmp->nm_sotype == SOCK_DGRAM)
705 while (nfs_connect(nmp, NULL)) {
706 printf("nfs_args: retrying connect\n");
707 (void) tsleep((caddr_t)&lbolt, PSOCK, "nfscon", 0);
708 }
709 }
710
711 if (hostname) {
712 strlcpy(nmp->nm_hostname, hostname,
713 sizeof(nmp->nm_hostname));
714 p = strchr(nmp->nm_hostname, ':');
715 if (p)
716 *p = '\0';
717 }
718 }
719
720 static const char *nfs_opts[] = { "from", "nfs_args", NULL };
721
722 /*
723 * VFS Operations.
724 *
725 * mount system call
726 * It seems a bit dumb to copyinstr() the host and path here and then
727 * bcopy() them in mountnfs(), but I wanted to detect errors before
728 * doing the sockargs() call because sockargs() allocates an mbuf and
729 * an error after that means that I have to release the mbuf.
730 */
731 /* ARGSUSED */
732 static int
733 nfs_mount(struct mount *mp, struct thread *td)
734 {
735 int error;
736 struct nfs_args args;
737 struct sockaddr *nam;
738 struct vnode *vp;
739 char hst[MNAMELEN];
740 size_t len;
741 u_char nfh[NFSX_V3FHMAX];
742
743 if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
744 error = EINVAL;
745 goto out;
746 }
747
748 if (mp->mnt_flag & MNT_ROOTFS) {
749 error = nfs_mountroot(mp, td);
750 goto out;
751 }
752
753 error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, sizeof args);
754 if (error)
755 goto out;
756
757 if (args.version != NFS_ARGSVERSION) {
758 error = EPROGMISMATCH;
759 goto out;
760 }
761 if (mp->mnt_flag & MNT_UPDATE) {
762 struct nfsmount *nmp = VFSTONFS(mp);
763
764 if (nmp == NULL) {
765 error = EIO;
766 goto out;
767 }
768 /*
769 * When doing an update, we can't change from or to
770 * v3, switch lockd strategies or change cookie translation
771 */
772 args.flags = (args.flags &
773 ~(NFSMNT_NFSV3 | NFSMNT_NOLOCKD /*|NFSMNT_XLATECOOKIE*/)) |
774 (nmp->nm_flag &
775 (NFSMNT_NFSV3 | NFSMNT_NOLOCKD /*|NFSMNT_XLATECOOKIE*/));
776 nfs_decode_args(mp, nmp, &args, NULL);
777 goto out;
778 }
779
780 /*
781 * Make the nfs_ip_paranoia sysctl serve as the default connection
782 * or no-connection mode for those protocols that support
783 * no-connection mode (the flag will be cleared later for protocols
784 * that do not support no-connection mode). This will allow a client
785 * to receive replies from a different IP then the request was
786 * sent to. Note: default value for nfs_ip_paranoia is 1 (paranoid),
787 * not 0.
788 */
789 if (nfs_ip_paranoia == 0)
790 args.flags |= NFSMNT_NOCONN;
791 if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) {
792 error = EINVAL;
793 goto out;
794 }
795 error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
796 if (error)
797 goto out;
798 error = copyinstr(args.hostname, hst, MNAMELEN-1, &len);
799 if (error)
800 goto out;
801 bzero(&hst[len], MNAMELEN - len);
802 /* sockargs() call must be after above copyin() calls */
803 error = getsockaddr(&nam, (caddr_t)args.addr, args.addrlen);
804 if (error)
805 goto out;
806 args.fh = nfh;
807 error = mountnfs(&args, mp, nam, hst, &vp, td->td_ucred);
808 out:
809 if (!error) {
810 MNT_ILOCK(mp);
811 mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED);
812 MNT_IUNLOCK(mp);
813 }
814 return (error);
815 }
816
817
818 /*
819 * VFS Operations.
820 *
821 * mount system call
822 * It seems a bit dumb to copyinstr() the host and path here and then
823 * bcopy() them in mountnfs(), but I wanted to detect errors before
824 * doing the sockargs() call because sockargs() allocates an mbuf and
825 * an error after that means that I have to release the mbuf.
826 */
827 /* ARGSUSED */
828 static int
829 nfs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td)
830 {
831 int error;
832 struct nfs_args args;
833
834 error = copyin(data, &args, sizeof (struct nfs_args));
835 if (error)
836 return error;
837
838 ma = mount_arg(ma, "nfs_args", &args, sizeof args);
839
840 error = kernel_mount(ma, flags);
841 return (error);
842 }
843
844 /*
845 * Common code for mount and mountroot
846 */
847 static int
848 mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
849 char *hst, struct vnode **vpp, struct ucred *cred)
850 {
851 struct nfsmount *nmp;
852 struct nfsnode *np;
853 int error;
854 struct vattr attrs;
855
856 if (mp->mnt_flag & MNT_UPDATE) {
857 nmp = VFSTONFS(mp);
858 /* update paths, file handles, etc, here XXX */
859 FREE(nam, M_SONAME);
860 return (0);
861 } else {
862 nmp = uma_zalloc(nfsmount_zone, M_WAITOK);
863 bzero((caddr_t)nmp, sizeof (struct nfsmount));
864 TAILQ_INIT(&nmp->nm_bufq);
865 mp->mnt_data = (qaddr_t)nmp;
866 }
867 vfs_getnewfsid(mp);
868 nmp->nm_mountp = mp;
869 mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF);
870
871 /*
872 * V2 can only handle 32 bit filesizes. A 4GB-1 limit may be too
873 * high, depending on whether we end up with negative offsets in
874 * the client or server somewhere. 2GB-1 may be safer.
875 *
876 * For V3, nfs_fsinfo will adjust this as necessary. Assume maximum
877 * that we can handle until we find out otherwise.
878 * XXX Our "safe" limit on the client is what we can store in our
879 * buffer cache using signed(!) block numbers.
880 */
881 if ((argp->flags & NFSMNT_NFSV3) == 0)
882 nmp->nm_maxfilesize = 0xffffffffLL;
883 else
884 nmp->nm_maxfilesize = (u_int64_t)0x80000000 * DEV_BSIZE - 1;
885
886 nmp->nm_timeo = NFS_TIMEO;
887 nmp->nm_retry = NFS_RETRANS;
888 if ((argp->flags & NFSMNT_NFSV3) && argp->sotype == SOCK_STREAM) {
889 nmp->nm_wsize = nmp->nm_rsize = NFS_MAXDATA;
890 } else {
891 nmp->nm_wsize = NFS_WSIZE;
892 nmp->nm_rsize = NFS_RSIZE;
893 }
894 nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);
895 nmp->nm_readdirsize = NFS_READDIRSIZE;
896 nmp->nm_numgrps = NFS_MAXGRPS;
897 nmp->nm_readahead = NFS_DEFRAHEAD;
898 nmp->nm_deadthresh = NFS_MAXDEADTHRESH;
899 nmp->nm_tprintf_delay = nfs_tprintf_delay;
900 if (nmp->nm_tprintf_delay < 0)
901 nmp->nm_tprintf_delay = 0;
902 nmp->nm_tprintf_initial_delay = nfs_tprintf_initial_delay;
903 if (nmp->nm_tprintf_initial_delay < 0)
904 nmp->nm_tprintf_initial_delay = 0;
905 nmp->nm_fhsize = argp->fhsize;
906 bcopy((caddr_t)argp->fh, (caddr_t)nmp->nm_fh, argp->fhsize);
907 bcopy(hst, mp->mnt_stat.f_mntfromname, MNAMELEN);
908 nmp->nm_nam = nam;
909 /* Set up the sockets and per-host congestion */
910 nmp->nm_sotype = argp->sotype;
911 nmp->nm_soproto = argp->proto;
912 nmp->nm_rpcops = &nfs_rpcops;
913
914 nfs_decode_args(mp, nmp, argp, hst);
915
916 /*
917 * For Connection based sockets (TCP,...) defer the connect until
918 * the first request, in case the server is not responding.
919 */
920 if (nmp->nm_sotype == SOCK_DGRAM &&
921 (error = nfs_connect(nmp, NULL)))
922 goto bad;
923
924 /*
925 * This is silly, but it has to be set so that vinifod() works.
926 * We do not want to do an nfs_statfs() here since we can get
927 * stuck on a dead server and we are holding a lock on the mount
928 * point.
929 */
930 mtx_lock(&nmp->nm_mtx);
931 mp->mnt_stat.f_iosize = nfs_iosize(nmp);
932 mtx_unlock(&nmp->nm_mtx);
933 /*
934 * A reference count is needed on the nfsnode representing the
935 * remote root. If this object is not persistent, then backward
936 * traversals of the mount point (i.e. "..") will not work if
937 * the nfsnode gets flushed out of the cache. Ufs does not have
938 * this problem, because one can identify root inodes by their
939 * number == ROOTINO (2).
940 */
941 error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE);
942 if (error)
943 goto bad;
944 *vpp = NFSTOV(np);
945
946 /*
947 * Get file attributes and transfer parameters for the
948 * mountpoint. This has the side effect of filling in
949 * (*vpp)->v_type with the correct value.
950 */
951 if (argp->flags & NFSMNT_NFSV3)
952 nfs_fsinfo(nmp, *vpp, curthread->td_ucred, curthread);
953 else
954 VOP_GETATTR(*vpp, &attrs, curthread->td_ucred, curthread);
955
956 /*
957 * Lose the lock but keep the ref.
958 */
959 VOP_UNLOCK(*vpp, 0, curthread);
960
961 return (0);
962 bad:
963 nfs_disconnect(nmp);
964 mtx_destroy(&nmp->nm_mtx);
965 uma_zfree(nfsmount_zone, nmp);
966 FREE(nam, M_SONAME);
967 return (error);
968 }
969
970 /*
971 * unmount system call
972 */
973 static int
974 nfs_unmount(struct mount *mp, int mntflags, struct thread *td)
975 {
976 struct nfsmount *nmp;
977 int error, flags = 0;
978
979 if (mntflags & MNT_FORCE)
980 flags |= FORCECLOSE;
981 nmp = VFSTONFS(mp);
982 /*
983 * Goes something like this..
984 * - Call vflush() to clear out vnodes for this filesystem
985 * - Close the socket
986 * - Free up the data structures
987 */
988 /* In the forced case, cancel any outstanding requests. */
989 if (flags & FORCECLOSE) {
990 error = nfs_nmcancelreqs(nmp);
991 if (error)
992 goto out;
993 }
994 /* We hold 1 extra ref on the root vnode; see comment in mountnfs(). */
995 error = vflush(mp, 1, flags, td);
996 if (error)
997 goto out;
998
999 /*
1000 * We are now committed to the unmount.
1001 */
1002 nfs_disconnect(nmp);
1003 FREE(nmp->nm_nam, M_SONAME);
1004
1005 mtx_destroy(&nmp->nm_mtx);
1006 uma_zfree(nfsmount_zone, nmp);
1007 out:
1008 return (error);
1009 }
1010
1011 /*
1012 * Return root of a filesystem
1013 */
1014 static int
1015 nfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td)
1016 {
1017 struct vnode *vp;
1018 struct nfsmount *nmp;
1019 struct nfsnode *np;
1020 int error;
1021
1022 nmp = VFSTONFS(mp);
1023 error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, flags);
1024 if (error)
1025 return error;
1026 vp = NFSTOV(np);
1027 /*
1028 * Get transfer parameters and attributes for root vnode once.
1029 */
1030 mtx_lock(&nmp->nm_mtx);
1031 if ((nmp->nm_state & NFSSTA_GOTFSINFO) == 0 &&
1032 (nmp->nm_flag & NFSMNT_NFSV3)) {
1033 mtx_unlock(&nmp->nm_mtx);
1034 nfs_fsinfo(nmp, vp, curthread->td_ucred, curthread);
1035 } else
1036 mtx_unlock(&nmp->nm_mtx);
1037 if (vp->v_type == VNON)
1038 vp->v_type = VDIR;
1039 vp->v_vflag |= VV_ROOT;
1040 *vpp = vp;
1041 return (0);
1042 }
1043
1044 /*
1045 * Flush out the buffer cache
1046 */
1047 /* ARGSUSED */
1048 static int
1049 nfs_sync(struct mount *mp, int waitfor, struct thread *td)
1050 {
1051 struct vnode *vp, *mvp;
1052 int error, allerror = 0;
1053
1054 /*
1055 * Force stale buffer cache information to be flushed.
1056 */
1057 MNT_ILOCK(mp);
1058 loop:
1059 MNT_VNODE_FOREACH(vp, mp, mvp) {
1060 VI_LOCK(vp);
1061 MNT_IUNLOCK(mp);
1062 if (VOP_ISLOCKED(vp, NULL) ||
1063 vp->v_bufobj.bo_dirty.bv_cnt == 0 ||
1064 waitfor == MNT_LAZY) {
1065 VI_UNLOCK(vp);
1066 MNT_ILOCK(mp);
1067 continue;
1068 }
1069 if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
1070 MNT_ILOCK(mp);
1071 MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);
1072 goto loop;
1073 }
1074 error = VOP_FSYNC(vp, waitfor, td);
1075 if (error)
1076 allerror = error;
1077 VOP_UNLOCK(vp, 0, td);
1078 vrele(vp);
1079
1080 MNT_ILOCK(mp);
1081 }
1082 MNT_IUNLOCK(mp);
1083 return (allerror);
1084 }
1085
1086 static int
1087 nfs_sysctl(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
1088 {
1089 struct nfsmount *nmp = VFSTONFS(mp);
1090 struct vfsquery vq;
1091 int error;
1092
1093 bzero(&vq, sizeof(vq));
1094 switch (op) {
1095 #if 0
1096 case VFS_CTL_NOLOCKS:
1097 val = (nmp->nm_flag & NFSMNT_NOLOCKS) ? 1 : 0;
1098 if (req->oldptr != NULL) {
1099 error = SYSCTL_OUT(req, &val, sizeof(val));
1100 if (error)
1101 return (error);
1102 }
1103 if (req->newptr != NULL) {
1104 error = SYSCTL_IN(req, &val, sizeof(val));
1105 if (error)
1106 return (error);
1107 if (val)
1108 nmp->nm_flag |= NFSMNT_NOLOCKS;
1109 else
1110 nmp->nm_flag &= ~NFSMNT_NOLOCKS;
1111 }
1112 break;
1113 #endif
1114 case VFS_CTL_QUERY:
1115 mtx_lock(&nmp->nm_mtx);
1116 if (nmp->nm_state & NFSSTA_TIMEO)
1117 vq.vq_flags |= VQ_NOTRESP;
1118 mtx_unlock(&nmp->nm_mtx);
1119 #if 0
1120 if (!(nmp->nm_flag & NFSMNT_NOLOCKS) &&
1121 (nmp->nm_state & NFSSTA_LOCKTIMEO))
1122 vq.vq_flags |= VQ_NOTRESPLOCK;
1123 #endif
1124 error = SYSCTL_OUT(req, &vq, sizeof(vq));
1125 break;
1126 case VFS_CTL_TIMEO:
1127 if (req->oldptr != NULL) {
1128 error = SYSCTL_OUT(req, &nmp->nm_tprintf_initial_delay,
1129 sizeof(nmp->nm_tprintf_initial_delay));
1130 if (error)
1131 return (error);
1132 }
1133 if (req->newptr != NULL) {
1134 error = vfs_suser(mp, req->td);
1135 if (error)
1136 return (error);
1137 error = SYSCTL_IN(req, &nmp->nm_tprintf_initial_delay,
1138 sizeof(nmp->nm_tprintf_initial_delay));
1139 if (error)
1140 return (error);
1141 if (nmp->nm_tprintf_initial_delay < 0)
1142 nmp->nm_tprintf_initial_delay = 0;
1143 }
1144 break;
1145 default:
1146 return (ENOTSUP);
1147 }
1148 return (0);
1149 }
Cache object: b03622f4e05437cce2512debcec887de
|