Home | History | Annotate | Line # | Download | only in common
nfsport.h revision 1.1.1.1.12.2
      1  1.1.1.1.12.2     skrll /*	$NetBSD: nfsport.h,v 1.1.1.1.12.2 2017/02/05 13:40:55 skrll Exp $	*/
      2           1.1  dholland /*-
      3           1.1  dholland  * Copyright (c) 1989, 1993
      4           1.1  dholland  *	The Regents of the University of California.  All rights reserved.
      5           1.1  dholland  *
      6           1.1  dholland  * This code is derived from software contributed to Berkeley by
      7           1.1  dholland  * Rick Macklem at The University of Guelph.
      8           1.1  dholland  *
      9           1.1  dholland  * Redistribution and use in source and binary forms, with or without
     10           1.1  dholland  * modification, are permitted provided that the following conditions
     11           1.1  dholland  * are met:
     12           1.1  dholland  * 1. Redistributions of source code must retain the above copyright
     13           1.1  dholland  *    notice, this list of conditions and the following disclaimer.
     14           1.1  dholland  * 2. Redistributions in binary form must reproduce the above copyright
     15           1.1  dholland  *    notice, this list of conditions and the following disclaimer in the
     16           1.1  dholland  *    documentation and/or other materials provided with the distribution.
     17           1.1  dholland  * 4. Neither the name of the University nor the names of its contributors
     18           1.1  dholland  *    may be used to endorse or promote products derived from this software
     19           1.1  dholland  *    without specific prior written permission.
     20           1.1  dholland  *
     21           1.1  dholland  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22           1.1  dholland  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23           1.1  dholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24           1.1  dholland  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25           1.1  dholland  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26           1.1  dholland  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27           1.1  dholland  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28           1.1  dholland  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29           1.1  dholland  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30           1.1  dholland  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31           1.1  dholland  * SUCH DAMAGE.
     32           1.1  dholland  *
     33  1.1.1.1.12.1     skrll  * FreeBSD: head/sys/fs/nfs/nfsport.h 304026 2016-08-12 22:44:59Z rmacklem
     34  1.1.1.1.12.2     skrll  * $NetBSD: nfsport.h,v 1.1.1.1.12.2 2017/02/05 13:40:55 skrll Exp $
     35           1.1  dholland  */
     36           1.1  dholland 
     37           1.1  dholland #ifndef _NFS_NFSPORT_H_
     38           1.1  dholland #define	_NFS_NFSPORT_H_
     39           1.1  dholland 
     40           1.1  dholland /*
     41           1.1  dholland  * In general, I'm not fond of #includes in .h files, but this seems
     42           1.1  dholland  * to be the cleanest way to handle #include files for the ports.
     43           1.1  dholland  */
     44           1.1  dholland #ifdef _KERNEL
     45           1.1  dholland #include <sys/unistd.h>
     46           1.1  dholland #include <sys/param.h>
     47           1.1  dholland #include <sys/systm.h>
     48           1.1  dholland #include <sys/conf.h>
     49           1.1  dholland #include <sys/dirent.h>
     50           1.1  dholland #include <sys/domain.h>
     51           1.1  dholland #include <sys/fcntl.h>
     52           1.1  dholland #include <sys/file.h>
     53           1.1  dholland #include <sys/filedesc.h>
     54           1.1  dholland #include <sys/kernel.h>
     55           1.1  dholland #include <sys/lockf.h>
     56           1.1  dholland #include <sys/malloc.h>
     57           1.1  dholland #include <sys/mbuf.h>
     58           1.1  dholland #include <sys/mount.h>
     59  1.1.1.1.12.1     skrll #include <sys/mutex.h>
     60           1.1  dholland #include <sys/namei.h>
     61           1.1  dholland #include <sys/proc.h>
     62           1.1  dholland #include <sys/protosw.h>
     63           1.1  dholland #include <sys/reboot.h>
     64           1.1  dholland #include <sys/resourcevar.h>
     65           1.1  dholland #include <sys/signalvar.h>
     66           1.1  dholland #include <sys/socket.h>
     67           1.1  dholland #include <sys/socketvar.h>
     68           1.1  dholland #include <sys/stat.h>
     69           1.1  dholland #include <sys/syslog.h>
     70           1.1  dholland #include <sys/time.h>
     71           1.1  dholland #include <sys/uio.h>
     72           1.1  dholland #include <sys/vnode.h>
     73           1.1  dholland #include <sys/buf.h>
     74           1.1  dholland #include <sys/module.h>
     75           1.1  dholland #include <sys/syscall.h>
     76           1.1  dholland #include <sys/kthread.h>
     77  1.1.1.1.12.2     skrll #include <sys/lwp.h>
     78  1.1.1.1.12.1     skrll 
     79           1.1  dholland #include <net/if.h>
     80           1.1  dholland #include <net/radix.h>
     81           1.1  dholland #include <net/route.h>
     82           1.1  dholland #include <net/if_dl.h>
     83  1.1.1.1.12.1     skrll 
     84           1.1  dholland #include <netinet/in.h>
     85           1.1  dholland #include <netinet/in_pcb.h>
     86           1.1  dholland #include <netinet/in_systm.h>
     87           1.1  dholland #include <netinet/in_var.h>
     88           1.1  dholland #include <netinet/ip.h>
     89           1.1  dholland #include <netinet/ip_var.h>
     90           1.1  dholland #include <netinet/tcp.h>
     91           1.1  dholland #include <netinet/tcp_fsm.h>
     92           1.1  dholland #include <netinet/tcp_seq.h>
     93           1.1  dholland #include <netinet/tcp_timer.h>
     94           1.1  dholland #include <netinet/tcp_var.h>
     95  1.1.1.1.12.1     skrll 
     96           1.1  dholland #include <crypto/des/des.h>
     97           1.1  dholland #include <sys/md5.h>
     98           1.1  dholland 
     99           1.1  dholland /*
    100           1.1  dholland  * For Darwin, these functions should be "static" when built in a kext.
    101           1.1  dholland  * (This is always defined as nil otherwise.)
    102           1.1  dholland  */
    103           1.1  dholland #define	APPLESTATIC
    104           1.1  dholland #include <ufs/ufs/dir.h>
    105           1.1  dholland #include <ufs/ufs/quota.h>
    106           1.1  dholland #include <ufs/ufs/inode.h>
    107           1.1  dholland #include <ufs/ufs/extattr.h>
    108           1.1  dholland #include <ufs/ufs/ufsmount.h>
    109  1.1.1.1.12.1     skrll 
    110  1.1.1.1.12.1     skrll #ifdef _KERNEL_OPT
    111  1.1.1.1.12.1     skrll #include "opt_newnfs.h"
    112  1.1.1.1.12.1     skrll #include "opt_ffs.h"
    113  1.1.1.1.12.1     skrll #endif
    114  1.1.1.1.12.1     skrll 
    115  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfssvc.h>
    116           1.1  dholland 
    117           1.1  dholland /*
    118           1.1  dholland  * These types must be defined before the nfs includes.
    119           1.1  dholland  */
    120           1.1  dholland #define	NFSSOCKADDR_T	struct sockaddr *
    121  1.1.1.1.12.2     skrll #define	NFSPROC_T	struct lwp
    122           1.1  dholland #define	NFSDEV_T	dev_t
    123           1.1  dholland #define	NFSSVCARGS	nfssvc_args
    124           1.1  dholland #define	NFSACL_T	struct acl
    125           1.1  dholland 
    126           1.1  dholland /*
    127           1.1  dholland  * These should be defined as the types used for the corresponding VOP's
    128           1.1  dholland  * argument type.
    129           1.1  dholland  */
    130           1.1  dholland #define	NFS_ACCESS_ARGS		struct vop_access_args
    131           1.1  dholland #define	NFS_OPEN_ARGS		struct vop_open_args
    132           1.1  dholland #define	NFS_GETATTR_ARGS	struct vop_getattr_args
    133           1.1  dholland #define	NFS_LOOKUP_ARGS		struct vop_lookup_args
    134           1.1  dholland #define	NFS_READDIR_ARGS	struct vop_readdir_args
    135           1.1  dholland 
    136           1.1  dholland /*
    137           1.1  dholland  * Allocate mbufs. Must succeed and never set the mbuf ptr to NULL.
    138           1.1  dholland  */
    139           1.1  dholland #define	NFSMGET(m)	do { 					\
    140           1.1  dholland 		MGET((m), M_WAITOK, MT_DATA); 			\
    141           1.1  dholland 		while ((m) == NULL ) { 				\
    142           1.1  dholland 			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
    143           1.1  dholland 			MGET((m), M_WAITOK, MT_DATA); 		\
    144           1.1  dholland 		} 						\
    145           1.1  dholland 	} while (0)
    146           1.1  dholland #define	NFSMGETHDR(m)	do { 					\
    147           1.1  dholland 		MGETHDR((m), M_WAITOK, MT_DATA);		\
    148           1.1  dholland 		while ((m) == NULL ) { 				\
    149           1.1  dholland 			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
    150           1.1  dholland 			MGETHDR((m), M_WAITOK, MT_DATA); 	\
    151           1.1  dholland 		} 						\
    152           1.1  dholland 	} while (0)
    153           1.1  dholland #define	NFSMCLGET(m, w)	do { 					\
    154           1.1  dholland 		MGET((m), M_WAITOK, MT_DATA); 			\
    155           1.1  dholland 		while ((m) == NULL ) { 				\
    156           1.1  dholland 			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
    157           1.1  dholland 			MGET((m), M_WAITOK, MT_DATA); 		\
    158           1.1  dholland 		} 						\
    159           1.1  dholland 		MCLGET((m), (w));				\
    160           1.1  dholland 	} while (0)
    161           1.1  dholland #define	NFSMCLGETHDR(m, w) do { 				\
    162           1.1  dholland 		MGETHDR((m), M_WAITOK, MT_DATA);		\
    163           1.1  dholland 		while ((m) == NULL ) { 				\
    164           1.1  dholland 			(void) nfs_catnap(PZERO, 0, "nfsmget");	\
    165           1.1  dholland 			MGETHDR((m), M_WAITOK, MT_DATA); 	\
    166           1.1  dholland 		} 						\
    167           1.1  dholland 	} while (0)
    168           1.1  dholland #define	NFSMTOD	mtod
    169           1.1  dholland 
    170           1.1  dholland /*
    171           1.1  dholland  * Client side constant for size of a lockowner name.
    172           1.1  dholland  */
    173           1.1  dholland #define	NFSV4CL_LOCKNAMELEN	12
    174           1.1  dholland 
    175           1.1  dholland /*
    176           1.1  dholland  * Type for a mutex lock.
    177           1.1  dholland  */
    178  1.1.1.1.12.2     skrll #define	NFSMUTEX_T		kmutex_t
    179           1.1  dholland 
    180           1.1  dholland #endif	/* _KERNEL */
    181           1.1  dholland 
    182           1.1  dholland /*
    183           1.1  dholland  * NFSv4 Operation numbers.
    184           1.1  dholland  */
    185           1.1  dholland #define	NFSV4OP_ACCESS		3
    186           1.1  dholland #define	NFSV4OP_CLOSE		4
    187           1.1  dholland #define	NFSV4OP_COMMIT		5
    188           1.1  dholland #define	NFSV4OP_CREATE		6
    189           1.1  dholland #define	NFSV4OP_DELEGPURGE	7
    190           1.1  dholland #define	NFSV4OP_DELEGRETURN	8
    191           1.1  dholland #define	NFSV4OP_GETATTR		9
    192           1.1  dholland #define	NFSV4OP_GETFH		10
    193           1.1  dholland #define	NFSV4OP_LINK		11
    194           1.1  dholland #define	NFSV4OP_LOCK		12
    195           1.1  dholland #define	NFSV4OP_LOCKT		13
    196           1.1  dholland #define	NFSV4OP_LOCKU		14
    197           1.1  dholland #define	NFSV4OP_LOOKUP		15
    198           1.1  dholland #define	NFSV4OP_LOOKUPP		16
    199           1.1  dholland #define	NFSV4OP_NVERIFY		17
    200           1.1  dholland #define	NFSV4OP_OPEN		18
    201           1.1  dholland #define	NFSV4OP_OPENATTR	19
    202           1.1  dholland #define	NFSV4OP_OPENCONFIRM	20
    203           1.1  dholland #define	NFSV4OP_OPENDOWNGRADE	21
    204           1.1  dholland #define	NFSV4OP_PUTFH		22
    205           1.1  dholland #define	NFSV4OP_PUTPUBFH	23
    206           1.1  dholland #define	NFSV4OP_PUTROOTFH	24
    207           1.1  dholland #define	NFSV4OP_READ		25
    208           1.1  dholland #define	NFSV4OP_READDIR		26
    209           1.1  dholland #define	NFSV4OP_READLINK	27
    210           1.1  dholland #define	NFSV4OP_REMOVE		28
    211           1.1  dholland #define	NFSV4OP_RENAME		29
    212           1.1  dholland #define	NFSV4OP_RENEW		30
    213           1.1  dholland #define	NFSV4OP_RESTOREFH	31
    214           1.1  dholland #define	NFSV4OP_SAVEFH		32
    215           1.1  dholland #define	NFSV4OP_SECINFO		33
    216           1.1  dholland #define	NFSV4OP_SETATTR		34
    217           1.1  dholland #define	NFSV4OP_SETCLIENTID	35
    218           1.1  dholland #define	NFSV4OP_SETCLIENTIDCFRM	36
    219           1.1  dholland #define	NFSV4OP_VERIFY		37
    220           1.1  dholland #define	NFSV4OP_WRITE		38
    221           1.1  dholland #define	NFSV4OP_RELEASELCKOWN	39
    222           1.1  dholland 
    223           1.1  dholland /*
    224           1.1  dholland  * Must be one greater than the last Operation#.
    225           1.1  dholland  */
    226           1.1  dholland #define	NFSV4OP_NOPS		40
    227           1.1  dholland 
    228           1.1  dholland /*
    229           1.1  dholland  * Additional Ops for NFSv4.1.
    230           1.1  dholland  */
    231           1.1  dholland #define	NFSV4OP_BACKCHANNELCTL	40
    232           1.1  dholland #define	NFSV4OP_BINDCONNTOSESS	41
    233           1.1  dholland #define	NFSV4OP_EXCHANGEID	42
    234           1.1  dholland #define	NFSV4OP_CREATESESSION	43
    235           1.1  dholland #define	NFSV4OP_DESTROYSESSION	44
    236           1.1  dholland #define	NFSV4OP_FREESTATEID	45
    237           1.1  dholland #define	NFSV4OP_GETDIRDELEG	46
    238           1.1  dholland #define	NFSV4OP_GETDEVINFO	47
    239           1.1  dholland #define	NFSV4OP_GETDEVLIST	48
    240           1.1  dholland #define	NFSV4OP_LAYOUTCOMMIT	49
    241           1.1  dholland #define	NFSV4OP_LAYOUTGET	50
    242           1.1  dholland #define	NFSV4OP_LAYOUTRETURN	51
    243           1.1  dholland #define	NFSV4OP_SECINFONONAME	52
    244           1.1  dholland #define	NFSV4OP_SEQUENCE	53
    245           1.1  dholland #define	NFSV4OP_SETSSV		54
    246           1.1  dholland #define	NFSV4OP_TESTSTATEID	55
    247           1.1  dholland #define	NFSV4OP_WANTDELEG	56
    248           1.1  dholland #define	NFSV4OP_DESTROYCLIENTID	57
    249           1.1  dholland #define	NFSV4OP_RECLAIMCOMPL	58
    250           1.1  dholland 
    251           1.1  dholland /*
    252           1.1  dholland  * Must be one more than last op#.
    253  1.1.1.1.12.1     skrll  * NFSv4.2 isn't implemented yet, but define the op# limit for it.
    254           1.1  dholland  */
    255           1.1  dholland #define	NFSV41_NOPS		59
    256  1.1.1.1.12.1     skrll #define	NFSV42_NOPS		72
    257           1.1  dholland 
    258           1.1  dholland /* Quirky case if the illegal op code */
    259           1.1  dholland #define	NFSV4OP_OPILLEGAL	10044
    260           1.1  dholland 
    261           1.1  dholland /*
    262  1.1.1.1.12.1     skrll  * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV42_NOPS.
    263           1.1  dholland  */
    264  1.1.1.1.12.1     skrll #define	NFSV4OP_SYMLINK		(NFSV42_NOPS)
    265  1.1.1.1.12.1     skrll #define	NFSV4OP_MKDIR		(NFSV42_NOPS + 1)
    266  1.1.1.1.12.1     skrll #define	NFSV4OP_RMDIR		(NFSV42_NOPS + 2)
    267  1.1.1.1.12.1     skrll #define	NFSV4OP_READDIRPLUS	(NFSV42_NOPS + 3)
    268  1.1.1.1.12.1     skrll #define	NFSV4OP_MKNOD		(NFSV42_NOPS + 4)
    269  1.1.1.1.12.1     skrll #define	NFSV4OP_FSSTAT		(NFSV42_NOPS + 5)
    270  1.1.1.1.12.1     skrll #define	NFSV4OP_FSINFO		(NFSV42_NOPS + 6)
    271  1.1.1.1.12.1     skrll #define	NFSV4OP_PATHCONF	(NFSV42_NOPS + 7)
    272  1.1.1.1.12.1     skrll #define	NFSV4OP_V3CREATE	(NFSV42_NOPS + 8)
    273           1.1  dholland 
    274           1.1  dholland /*
    275           1.1  dholland  * This is the count of the fake operations listed above.
    276           1.1  dholland  */
    277           1.1  dholland #define	NFSV4OP_FAKENOPS	9
    278           1.1  dholland 
    279           1.1  dholland /*
    280           1.1  dholland  * and the Callback OPs
    281           1.1  dholland  */
    282           1.1  dholland #define	NFSV4OP_CBGETATTR	3
    283           1.1  dholland #define	NFSV4OP_CBRECALL	4
    284           1.1  dholland 
    285           1.1  dholland /*
    286  1.1.1.1.12.1     skrll  * Must be one greater than the last Callback Operation# for NFSv4.0.
    287           1.1  dholland  */
    288           1.1  dholland #define	NFSV4OP_CBNOPS		5
    289           1.1  dholland 
    290           1.1  dholland /*
    291  1.1.1.1.12.1     skrll  * Additional Callback Ops for NFSv4.1 only.
    292           1.1  dholland  */
    293           1.1  dholland #define	NFSV4OP_CBLAYOUTRECALL	5
    294           1.1  dholland #define	NFSV4OP_CBNOTIFY	6
    295           1.1  dholland #define	NFSV4OP_CBPUSHDELEG	7
    296           1.1  dholland #define	NFSV4OP_CBRECALLANY	8
    297           1.1  dholland #define	NFSV4OP_CBRECALLOBJAVAIL 9
    298           1.1  dholland #define	NFSV4OP_CBRECALLSLOT	10
    299           1.1  dholland #define	NFSV4OP_CBSEQUENCE	11
    300           1.1  dholland #define	NFSV4OP_CBWANTCANCELLED	12
    301           1.1  dholland #define	NFSV4OP_CBNOTIFYLOCK	13
    302           1.1  dholland #define	NFSV4OP_CBNOTIFYDEVID	14
    303           1.1  dholland 
    304  1.1.1.1.12.1     skrll #define	NFSV41_CBNOPS		15
    305  1.1.1.1.12.1     skrll #define	NFSV42_CBNOPS		16
    306  1.1.1.1.12.1     skrll 
    307           1.1  dholland /*
    308           1.1  dholland  * The lower numbers -> 21 are used by NFSv2 and v3. These define higher
    309           1.1  dholland  * numbers used by NFSv4.
    310           1.1  dholland  * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
    311           1.1  dholland  * one greater than the last number.
    312           1.1  dholland  */
    313           1.1  dholland #ifndef	NFS_V3NPROCS
    314           1.1  dholland #define	NFS_V3NPROCS		22
    315           1.1  dholland 
    316           1.1  dholland #define	NFSPROC_LOOKUPP		22
    317           1.1  dholland #define	NFSPROC_SETCLIENTID	23
    318           1.1  dholland #define	NFSPROC_SETCLIENTIDCFRM	24
    319           1.1  dholland #define	NFSPROC_LOCK		25
    320           1.1  dholland #define	NFSPROC_LOCKU		26
    321           1.1  dholland #define	NFSPROC_OPEN		27
    322           1.1  dholland #define	NFSPROC_CLOSE		28
    323           1.1  dholland #define	NFSPROC_OPENCONFIRM	29
    324           1.1  dholland #define	NFSPROC_LOCKT		30
    325           1.1  dholland #define	NFSPROC_OPENDOWNGRADE	31
    326           1.1  dholland #define	NFSPROC_RENEW		32
    327           1.1  dholland #define	NFSPROC_PUTROOTFH	33
    328           1.1  dholland #define	NFSPROC_RELEASELCKOWN	34
    329           1.1  dholland #define	NFSPROC_DELEGRETURN	35
    330           1.1  dholland #define	NFSPROC_RETDELEGREMOVE	36
    331           1.1  dholland #define	NFSPROC_RETDELEGRENAME1	37
    332           1.1  dholland #define	NFSPROC_RETDELEGRENAME2	38
    333           1.1  dholland #define	NFSPROC_GETACL		39
    334           1.1  dholland #define	NFSPROC_SETACL		40
    335           1.1  dholland 
    336           1.1  dholland /*
    337           1.1  dholland  * Must be defined as one higher than the last Proc# above.
    338           1.1  dholland  */
    339           1.1  dholland #define	NFSV4_NPROCS		41
    340           1.1  dholland 
    341           1.1  dholland /* Additional procedures for NFSv4.1. */
    342           1.1  dholland #define	NFSPROC_EXCHANGEID	41
    343           1.1  dholland #define	NFSPROC_CREATESESSION	42
    344           1.1  dholland #define	NFSPROC_DESTROYSESSION	43
    345           1.1  dholland #define	NFSPROC_DESTROYCLIENT	44
    346           1.1  dholland #define	NFSPROC_FREESTATEID	45
    347           1.1  dholland #define	NFSPROC_LAYOUTGET	46
    348           1.1  dholland #define	NFSPROC_GETDEVICEINFO	47
    349           1.1  dholland #define	NFSPROC_LAYOUTCOMMIT	48
    350           1.1  dholland #define	NFSPROC_LAYOUTRETURN	49
    351           1.1  dholland #define	NFSPROC_RECLAIMCOMPL	50
    352           1.1  dholland #define	NFSPROC_WRITEDS		51
    353           1.1  dholland #define	NFSPROC_READDS		52
    354           1.1  dholland #define	NFSPROC_COMMITDS	53
    355           1.1  dholland 
    356           1.1  dholland /*
    357           1.1  dholland  * Must be defined as one higher than the last NFSv4.1 Proc# above.
    358           1.1  dholland  */
    359           1.1  dholland #define	NFSV41_NPROCS		54
    360           1.1  dholland 
    361           1.1  dholland #endif	/* NFS_V3NPROCS */
    362           1.1  dholland 
    363           1.1  dholland /*
    364  1.1.1.1.12.1     skrll  * New stats structure.
    365  1.1.1.1.12.1     skrll  * The vers field will be set to NFSSTATS_V1 by the caller.
    366  1.1.1.1.12.1     skrll  */
    367  1.1.1.1.12.1     skrll #define	NFSSTATS_V1	1
    368  1.1.1.1.12.1     skrll struct nfsstatsv1 {
    369  1.1.1.1.12.1     skrll 	int		vers;	/* Set to version requested by caller. */
    370  1.1.1.1.12.1     skrll 	uint64_t	attrcache_hits;
    371  1.1.1.1.12.1     skrll 	uint64_t	attrcache_misses;
    372  1.1.1.1.12.1     skrll 	uint64_t	lookupcache_hits;
    373  1.1.1.1.12.1     skrll 	uint64_t	lookupcache_misses;
    374  1.1.1.1.12.1     skrll 	uint64_t	direofcache_hits;
    375  1.1.1.1.12.1     skrll 	uint64_t	direofcache_misses;
    376  1.1.1.1.12.1     skrll 	uint64_t	accesscache_hits;
    377  1.1.1.1.12.1     skrll 	uint64_t	accesscache_misses;
    378  1.1.1.1.12.1     skrll 	uint64_t	biocache_reads;
    379  1.1.1.1.12.1     skrll 	uint64_t	read_bios;
    380  1.1.1.1.12.1     skrll 	uint64_t	read_physios;
    381  1.1.1.1.12.1     skrll 	uint64_t	biocache_writes;
    382  1.1.1.1.12.1     skrll 	uint64_t	write_bios;
    383  1.1.1.1.12.1     skrll 	uint64_t	write_physios;
    384  1.1.1.1.12.1     skrll 	uint64_t	biocache_readlinks;
    385  1.1.1.1.12.1     skrll 	uint64_t	readlink_bios;
    386  1.1.1.1.12.1     skrll 	uint64_t	biocache_readdirs;
    387  1.1.1.1.12.1     skrll 	uint64_t	readdir_bios;
    388  1.1.1.1.12.1     skrll 	uint64_t	rpccnt[NFSV41_NPROCS + 15];
    389  1.1.1.1.12.1     skrll 	uint64_t	rpcretries;
    390  1.1.1.1.12.1     skrll 	uint64_t	srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS];
    391  1.1.1.1.12.1     skrll 	uint64_t	srvrpc_errs;
    392  1.1.1.1.12.1     skrll 	uint64_t	srv_errs;
    393  1.1.1.1.12.1     skrll 	uint64_t	rpcrequests;
    394  1.1.1.1.12.1     skrll 	uint64_t	rpctimeouts;
    395  1.1.1.1.12.1     skrll 	uint64_t	rpcunexpected;
    396  1.1.1.1.12.1     skrll 	uint64_t	rpcinvalid;
    397  1.1.1.1.12.1     skrll 	uint64_t	srvcache_inproghits;
    398  1.1.1.1.12.1     skrll 	uint64_t	srvcache_idemdonehits;
    399  1.1.1.1.12.1     skrll 	uint64_t	srvcache_nonidemdonehits;
    400  1.1.1.1.12.1     skrll 	uint64_t	srvcache_misses;
    401  1.1.1.1.12.1     skrll 	uint64_t	srvcache_tcppeak;
    402  1.1.1.1.12.1     skrll 	int		srvcache_size;	/* Updated by atomic_xx_int(). */
    403  1.1.1.1.12.1     skrll 	uint64_t	srvclients;
    404  1.1.1.1.12.1     skrll 	uint64_t	srvopenowners;
    405  1.1.1.1.12.1     skrll 	uint64_t	srvopens;
    406  1.1.1.1.12.1     skrll 	uint64_t	srvlockowners;
    407  1.1.1.1.12.1     skrll 	uint64_t	srvlocks;
    408  1.1.1.1.12.1     skrll 	uint64_t	srvdelegates;
    409  1.1.1.1.12.1     skrll 	uint64_t	cbrpccnt[NFSV42_CBNOPS];
    410  1.1.1.1.12.1     skrll 	uint64_t	clopenowners;
    411  1.1.1.1.12.1     skrll 	uint64_t	clopens;
    412  1.1.1.1.12.1     skrll 	uint64_t	cllockowners;
    413  1.1.1.1.12.1     skrll 	uint64_t	cllocks;
    414  1.1.1.1.12.1     skrll 	uint64_t	cldelegates;
    415  1.1.1.1.12.1     skrll 	uint64_t	cllocalopenowners;
    416  1.1.1.1.12.1     skrll 	uint64_t	cllocalopens;
    417  1.1.1.1.12.1     skrll 	uint64_t	cllocallockowners;
    418  1.1.1.1.12.1     skrll 	uint64_t	cllocallocks;
    419  1.1.1.1.12.1     skrll 	uint64_t	srvstartcnt;
    420  1.1.1.1.12.1     skrll 	uint64_t	srvdonecnt;
    421  1.1.1.1.12.1     skrll 	uint64_t	srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS];
    422  1.1.1.1.12.1     skrll 	uint64_t	srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS];
    423  1.1.1.1.12.1     skrll 	struct bintime	srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS];
    424  1.1.1.1.12.1     skrll 	struct bintime	busyfrom;
    425  1.1.1.1.12.1     skrll 	struct bintime	busytime;
    426  1.1.1.1.12.1     skrll };
    427  1.1.1.1.12.1     skrll 
    428  1.1.1.1.12.1     skrll /*
    429  1.1.1.1.12.1     skrll  * Old stats structure.
    430           1.1  dholland  */
    431           1.1  dholland struct ext_nfsstats {
    432           1.1  dholland 	int	attrcache_hits;
    433           1.1  dholland 	int	attrcache_misses;
    434           1.1  dholland 	int	lookupcache_hits;
    435           1.1  dholland 	int	lookupcache_misses;
    436           1.1  dholland 	int	direofcache_hits;
    437           1.1  dholland 	int	direofcache_misses;
    438           1.1  dholland 	int	accesscache_hits;
    439           1.1  dholland 	int	accesscache_misses;
    440           1.1  dholland 	int	biocache_reads;
    441           1.1  dholland 	int	read_bios;
    442           1.1  dholland 	int	read_physios;
    443           1.1  dholland 	int	biocache_writes;
    444           1.1  dholland 	int	write_bios;
    445           1.1  dholland 	int	write_physios;
    446           1.1  dholland 	int	biocache_readlinks;
    447           1.1  dholland 	int	readlink_bios;
    448           1.1  dholland 	int	biocache_readdirs;
    449           1.1  dholland 	int	readdir_bios;
    450           1.1  dholland 	int	rpccnt[NFSV4_NPROCS];
    451           1.1  dholland 	int	rpcretries;
    452           1.1  dholland 	int	srvrpccnt[NFSV4OP_NOPS + NFSV4OP_FAKENOPS];
    453           1.1  dholland 	int	srvrpc_errs;
    454           1.1  dholland 	int	srv_errs;
    455           1.1  dholland 	int	rpcrequests;
    456           1.1  dholland 	int	rpctimeouts;
    457           1.1  dholland 	int	rpcunexpected;
    458           1.1  dholland 	int	rpcinvalid;
    459           1.1  dholland 	int	srvcache_inproghits;
    460           1.1  dholland 	int	srvcache_idemdonehits;
    461           1.1  dholland 	int	srvcache_nonidemdonehits;
    462           1.1  dholland 	int	srvcache_misses;
    463           1.1  dholland 	int	srvcache_tcppeak;
    464           1.1  dholland 	int	srvcache_size;
    465           1.1  dholland 	int	srvclients;
    466           1.1  dholland 	int	srvopenowners;
    467           1.1  dholland 	int	srvopens;
    468           1.1  dholland 	int	srvlockowners;
    469           1.1  dholland 	int	srvlocks;
    470           1.1  dholland 	int	srvdelegates;
    471           1.1  dholland 	int	cbrpccnt[NFSV4OP_CBNOPS];
    472           1.1  dholland 	int	clopenowners;
    473           1.1  dholland 	int	clopens;
    474           1.1  dholland 	int	cllockowners;
    475           1.1  dholland 	int	cllocks;
    476           1.1  dholland 	int	cldelegates;
    477           1.1  dholland 	int	cllocalopenowners;
    478           1.1  dholland 	int	cllocalopens;
    479           1.1  dholland 	int	cllocallockowners;
    480           1.1  dholland 	int	cllocallocks;
    481           1.1  dholland };
    482           1.1  dholland 
    483           1.1  dholland #ifdef _KERNEL
    484           1.1  dholland /*
    485           1.1  dholland  * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
    486           1.1  dholland  */
    487           1.1  dholland #ifndef	NFS_NPROCS
    488           1.1  dholland #define	NFS_NPROCS		NFSV4_NPROCS
    489           1.1  dholland #endif
    490           1.1  dholland 
    491  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfskpiport.h>
    492  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsdport.h>
    493  1.1.1.1.12.1     skrll #include <fs/nfs/common/rpcv2.h>
    494  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsproto.h>
    495  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfs.h>
    496  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsclstate.h>
    497  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfs_var.h>
    498  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsm_subs.h>
    499  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsrvcache.h>
    500  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfsrvstate.h>
    501  1.1.1.1.12.1     skrll #include <fs/nfs/common/xdr_subs.h>
    502  1.1.1.1.12.1     skrll #include <fs/nfs/common/nfscl.h>
    503  1.1.1.1.12.1     skrll #include <fs/nfs/client/nfsmount.h>
    504  1.1.1.1.12.1     skrll 
    505  1.1.1.1.12.1     skrll #if 0
    506           1.1  dholland #include <nfsclient/nfsargs.h>
    507  1.1.1.1.12.1     skrll #endif
    508           1.1  dholland 
    509           1.1  dholland /*
    510           1.1  dholland  * Just to keep nfs_var.h happy.
    511           1.1  dholland  */
    512           1.1  dholland struct nfs_vattr {
    513           1.1  dholland 	int	junk;
    514           1.1  dholland };
    515           1.1  dholland 
    516           1.1  dholland struct nfsvattr {
    517           1.1  dholland 	struct vattr	na_vattr;
    518           1.1  dholland 	nfsattrbit_t	na_suppattr;
    519           1.1  dholland 	u_int32_t	na_mntonfileno;
    520           1.1  dholland 	u_int64_t	na_filesid[2];
    521           1.1  dholland };
    522           1.1  dholland 
    523           1.1  dholland #define	na_type		na_vattr.va_type
    524           1.1  dholland #define	na_mode		na_vattr.va_mode
    525           1.1  dholland #define	na_nlink	na_vattr.va_nlink
    526           1.1  dholland #define	na_uid		na_vattr.va_uid
    527           1.1  dholland #define	na_gid		na_vattr.va_gid
    528           1.1  dholland #define	na_fsid		na_vattr.va_fsid
    529           1.1  dholland #define	na_fileid	na_vattr.va_fileid
    530           1.1  dholland #define	na_size		na_vattr.va_size
    531           1.1  dholland #define	na_blocksize	na_vattr.va_blocksize
    532           1.1  dholland #define	na_atime	na_vattr.va_atime
    533           1.1  dholland #define	na_mtime	na_vattr.va_mtime
    534           1.1  dholland #define	na_ctime	na_vattr.va_ctime
    535           1.1  dholland #define	na_gen		na_vattr.va_gen
    536           1.1  dholland #define	na_flags	na_vattr.va_flags
    537           1.1  dholland #define	na_rdev		na_vattr.va_rdev
    538           1.1  dholland #define	na_bytes	na_vattr.va_bytes
    539           1.1  dholland #define	na_filerev	na_vattr.va_filerev
    540           1.1  dholland #define	na_vaflags	na_vattr.va_vaflags
    541           1.1  dholland 
    542  1.1.1.1.12.1     skrll #include <fs/nfs/client/nfsnode.h>
    543           1.1  dholland 
    544           1.1  dholland /*
    545           1.1  dholland  * This is the header structure used for the lists, etc. (It has the
    546           1.1  dholland  * above record in it.
    547           1.1  dholland  */
    548           1.1  dholland struct nfsrv_stablefirst {
    549           1.1  dholland 	LIST_HEAD(, nfsrv_stable) nsf_head;	/* Head of nfsrv_stable list */
    550           1.1  dholland 	time_t		nsf_eograce;	/* Time grace period ends */
    551           1.1  dholland 	time_t		*nsf_bootvals;	/* Previous boottime values */
    552           1.1  dholland 	struct file	*nsf_fp;	/* File table pointer */
    553           1.1  dholland 	u_char		nsf_flags;	/* NFSNSF_ flags */
    554           1.1  dholland 	struct nfsf_rec	nsf_rec;	/* and above first record */
    555           1.1  dholland };
    556           1.1  dholland #define	nsf_lease	nsf_rec.lease
    557           1.1  dholland #define	nsf_numboots	nsf_rec.numboots
    558           1.1  dholland 
    559           1.1  dholland /* NFSNSF_xxx flags */
    560           1.1  dholland #define	NFSNSF_UPDATEDONE	0x01
    561           1.1  dholland #define	NFSNSF_GRACEOVER	0x02
    562           1.1  dholland #define	NFSNSF_NEEDLOCK		0x04
    563           1.1  dholland #define	NFSNSF_EXPIREDCLIENT	0x08
    564           1.1  dholland #define	NFSNSF_NOOPENS		0x10
    565           1.1  dholland #define	NFSNSF_OK		0x20
    566           1.1  dholland 
    567           1.1  dholland /*
    568           1.1  dholland  * Maximum number of boot times allowed in record. Although there is
    569           1.1  dholland  * really no need for a fixed upper bound, this serves as a sanity check
    570           1.1  dholland  * for a corrupted file.
    571           1.1  dholland  */
    572           1.1  dholland #define	NFSNSF_MAXNUMBOOTS	10000
    573           1.1  dholland 
    574           1.1  dholland /*
    575           1.1  dholland  * This structure defines the other records in the file. The
    576           1.1  dholland  * nst_client array is actually the size of the client string name.
    577           1.1  dholland  */
    578           1.1  dholland struct nfst_rec {
    579           1.1  dholland 	u_int16_t	len;
    580           1.1  dholland 	u_char		flag;
    581           1.1  dholland 	u_char		client[1];
    582           1.1  dholland };
    583           1.1  dholland /* and the values for flag */
    584           1.1  dholland #define	NFSNST_NEWSTATE	0x1
    585           1.1  dholland #define	NFSNST_REVOKE		0x2
    586           1.1  dholland #define	NFSNST_GOTSTATE		0x4
    587           1.1  dholland 
    588           1.1  dholland /*
    589           1.1  dholland  * This structure is linked onto nfsrv_stablefirst for the duration of
    590           1.1  dholland  * reclaim.
    591           1.1  dholland  */
    592           1.1  dholland struct nfsrv_stable {
    593           1.1  dholland 	LIST_ENTRY(nfsrv_stable) nst_list;
    594           1.1  dholland 	struct nfsclient	*nst_clp;
    595           1.1  dholland 	struct nfst_rec		nst_rec;
    596           1.1  dholland };
    597           1.1  dholland #define	nst_timestamp	nst_rec.timestamp
    598           1.1  dholland #define	nst_len		nst_rec.len
    599           1.1  dholland #define	nst_flag	nst_rec.flag
    600           1.1  dholland #define	nst_client	nst_rec.client
    601           1.1  dholland 
    602           1.1  dholland /*
    603           1.1  dholland  * At some point the server will run out of kernel storage for
    604           1.1  dholland  * state structures. For FreeBSD5.2, this results in a panic
    605           1.1  dholland  * kmem_map is full. It happens at well over 1000000 opens plus
    606           1.1  dholland  * locks on a PIII-800 with 256Mbytes, so that is where I've set
    607           1.1  dholland  * the limit. If your server panics due to too many opens/locks,
    608           1.1  dholland  * decrease the size of NFSRV_V4STATELIMIT. If you find the server
    609           1.1  dholland  * returning NFS4ERR_RESOURCE a lot and have lots of memory, try
    610           1.1  dholland  * increasing it.
    611           1.1  dholland  */
    612           1.1  dholland #define	NFSRV_V4STATELIMIT	500000	/* Max # of Opens + Locks */
    613           1.1  dholland 
    614           1.1  dholland /*
    615           1.1  dholland  * The type required differs with BSDen (just the second arg).
    616           1.1  dholland  */
    617           1.1  dholland void nfsrvd_rcv(struct socket *, void *, int);
    618           1.1  dholland 
    619           1.1  dholland /*
    620           1.1  dholland  * Macros for handling socket addresses. (Hopefully this makes the code
    621           1.1  dholland  * more portable, since I've noticed some 'BSD don't have sockaddrs in
    622           1.1  dholland  * mbufs any more.)
    623           1.1  dholland  */
    624           1.1  dholland #define	NFSSOCKADDR(a, t)	((t)(a))
    625           1.1  dholland #define	NFSSOCKADDRALLOC(a) 					\
    626           1.1  dholland     do {							\
    627           1.1  dholland 	MALLOC((a), struct sockaddr *, sizeof (struct sockaddr), \
    628           1.1  dholland 	    M_SONAME, M_WAITOK); 				\
    629           1.1  dholland 	NFSBZERO((a), sizeof (struct sockaddr)); 		\
    630           1.1  dholland     } while (0)
    631           1.1  dholland #define	NFSSOCKADDRSIZE(a, s)		((a)->sa_len = (s))
    632           1.1  dholland #define	NFSSOCKADDRFREE(a) 					\
    633           1.1  dholland 	do { 							\
    634           1.1  dholland 		if (a) 						\
    635           1.1  dholland 			FREE((caddr_t)(a), M_SONAME); 		\
    636           1.1  dholland 	} while (0)
    637           1.1  dholland 
    638           1.1  dholland /*
    639           1.1  dholland  * These should be defined as a process or thread structure, as required
    640           1.1  dholland  * for signal handling, etc.
    641           1.1  dholland  */
    642           1.1  dholland #define	NFSNEWCRED(c)		(crdup(c))
    643  1.1.1.1.12.2     skrll #define	NFSPROCCRED(p)		((p)->l_ucred)
    644           1.1  dholland #define	NFSFREECRED(c)		(crfree(c))
    645           1.1  dholland #define	NFSUIOPROC(u, p)	((u)->uio_td = NULL)
    646  1.1.1.1.12.2     skrll #define	NFSPROCP(p)		((p)->l_proc)
    647           1.1  dholland 
    648           1.1  dholland /*
    649           1.1  dholland  * Define these so that cn_hash and its length is ignored.
    650           1.1  dholland  */
    651           1.1  dholland #define	NFSCNHASHZERO(c)
    652           1.1  dholland #define	NFSCNHASH(c, v)
    653  1.1.1.1.12.2     skrll 
    654  1.1.1.1.12.2     skrll #ifdef NCHNAMLEN
    655  1.1.1.1.12.2     skrll #undef NCHNAMLEN	/* defined in sys/namei.h */
    656  1.1.1.1.12.2     skrll #endif
    657           1.1  dholland #define	NCHNAMLEN	9999999
    658           1.1  dholland 
    659           1.1  dholland /*
    660           1.1  dholland  * These macros are defined to initialize and set the timer routine.
    661           1.1  dholland  */
    662           1.1  dholland #define	NFS_TIMERINIT \
    663           1.1  dholland 	newnfs_timer(NULL)
    664           1.1  dholland 
    665           1.1  dholland /*
    666           1.1  dholland  * Handle SMP stuff:
    667           1.1  dholland  */
    668  1.1.1.1.12.2     skrll #define	NFSSTATESPINLOCK	extern struct kmutex nfs_state_mutex
    669  1.1.1.1.12.2     skrll #define	NFSLOCKSTATE()		mutex_enter(&nfs_state_mutex)
    670  1.1.1.1.12.2     skrll #define	NFSUNLOCKSTATE()	mutex_exit(&nfs_state_mutex)
    671           1.1  dholland #define	NFSSTATEMUTEXPTR	(&nfs_state_mutex)
    672  1.1.1.1.12.2     skrll #define	NFSREQSPINLOCK		extern struct kmutex nfs_req_mutex
    673  1.1.1.1.12.2     skrll #define	NFSLOCKREQ()		mutex_enter(&nfs_req_mutex)
    674  1.1.1.1.12.2     skrll #define	NFSUNLOCKREQ()		mutex_exit(&nfs_req_mutex)
    675  1.1.1.1.12.2     skrll #define	NFSSOCKMUTEX		extern struct kmutex nfs_slock_mutex
    676           1.1  dholland #define	NFSSOCKMUTEXPTR		(&nfs_slock_mutex)
    677  1.1.1.1.12.2     skrll #define	NFSLOCKSOCK()		mutex_enter(&nfs_slock_mutex)
    678  1.1.1.1.12.2     skrll #define	NFSUNLOCKSOCK()		mutex_exit(&nfs_slock_mutex)
    679  1.1.1.1.12.2     skrll #define	NFSNAMEIDMUTEX		extern struct kmutex nfs_nameid_mutex
    680  1.1.1.1.12.2     skrll #define	NFSLOCKNAMEID()		mutex_enter(&nfs_nameid_mutex)
    681  1.1.1.1.12.2     skrll #define	NFSUNLOCKNAMEID()	mutex_exit(&nfs_nameid_mutex)
    682  1.1.1.1.12.2     skrll #define	NFSNAMEIDREQUIRED()	mutex_owned(&nfs_nameid_mutex)
    683  1.1.1.1.12.2     skrll #define	NFSCLSTATEMUTEX		extern struct kmutex nfs_clstate_mutex
    684           1.1  dholland #define	NFSCLSTATEMUTEXPTR	(&nfs_clstate_mutex)
    685  1.1.1.1.12.2     skrll #define	NFSLOCKCLSTATE()	mutex_enter(&nfs_clstate_mutex)
    686  1.1.1.1.12.2     skrll #define	NFSUNLOCKCLSTATE()	mutex_exit(&nfs_clstate_mutex)
    687  1.1.1.1.12.2     skrll #define	NFSDLOCKMUTEX		extern struct kmutex newnfsd_mtx
    688           1.1  dholland #define	NFSDLOCKMUTEXPTR	(&newnfsd_mtx)
    689  1.1.1.1.12.2     skrll #define	NFSD_LOCK()		mutex_enter(&newnfsd_mtx)
    690  1.1.1.1.12.2     skrll #define	NFSD_UNLOCK()		mutex_exit(&newnfsd_mtx)
    691  1.1.1.1.12.2     skrll #define	NFSD_LOCK_ASSERT()	mutex_owned(&newnfsd_mtx)
    692  1.1.1.1.12.2     skrll #define	NFSD_UNLOCK_ASSERT()	!mutex_owned(&newnfsd_mtx)
    693           1.1  dholland #define	NFSV4ROOTLOCKMUTEX	extern struct mtx nfs_v4root_mutex
    694           1.1  dholland #define	NFSV4ROOTLOCKMUTEXPTR	(&nfs_v4root_mutex)
    695  1.1.1.1.12.2     skrll #define	NFSLOCKV4ROOTMUTEX()	mutex_enter(&nfs_v4root_mutex)
    696  1.1.1.1.12.2     skrll #define	NFSUNLOCKV4ROOTMUTEX()	mutex_exit(&nfs_v4root_mutex)
    697  1.1.1.1.12.2     skrll #define	NFSLOCKNODE(n)		mutex_enter(&((n)->n_mtx))
    698  1.1.1.1.12.2     skrll #define	NFSUNLOCKNODE(n)	mutex_exit(&((n)->n_mtx))
    699  1.1.1.1.12.2     skrll #define	NFSLOCKMNT(m)		mutex_enter(&((m)->nm_mtx))
    700  1.1.1.1.12.2     skrll #define	NFSUNLOCKMNT(m)		mutex_exit(&((m)->nm_mtx))
    701  1.1.1.1.12.2     skrll #define	NFSLOCKREQUEST(r)	mutex_enter(&((r)->r_mtx))
    702  1.1.1.1.12.2     skrll #define	NFSUNLOCKREQUEST(r)	mutex_exit(&((r)->r_mtx))
    703           1.1  dholland #define	NFSPROCLISTLOCK()	sx_slock(&allproc_lock)
    704           1.1  dholland #define	NFSPROCLISTUNLOCK()	sx_sunlock(&allproc_lock)
    705  1.1.1.1.12.2     skrll #define	NFSLOCKSOCKREQ(r)	mutex_enter(&((r)->nr_mtx))
    706  1.1.1.1.12.2     skrll #define	NFSUNLOCKSOCKREQ(r)	mutex_exit(&((r)->nr_mtx))
    707  1.1.1.1.12.2     skrll #define	NFSLOCKDS(d)		mutex_enter(&((d)->nfsclds_mtx))
    708  1.1.1.1.12.2     skrll #define	NFSUNLOCKDS(d)		mutex_exit(&((d)->nfsclds_mtx))
    709  1.1.1.1.12.1     skrll #define	NFSSESSIONMUTEXPTR(s)	(&((s)->mtx))
    710  1.1.1.1.12.2     skrll #define	NFSLOCKSESSION(s)	mutex_enter(&((s)->mtx))
    711  1.1.1.1.12.2     skrll #define	NFSUNLOCKSESSION(s)	mutex_exit(&((s)->mtx))
    712           1.1  dholland 
    713           1.1  dholland /*
    714           1.1  dholland  * Use these macros to initialize/free a mutex.
    715           1.1  dholland  */
    716  1.1.1.1.12.2     skrll #define	NFSINITSOCKMUTEX(m)	mutex_init((m), MUTEX_DEFAULT, IPL_NONE)
    717  1.1.1.1.12.2     skrll #define	NFSFREEMUTEX(m)		mutex_destroy((m))
    718           1.1  dholland 
    719           1.1  dholland int nfsmsleep(void *, void *, int, const char *, struct timespec *);
    720           1.1  dholland 
    721           1.1  dholland /*
    722           1.1  dholland  * And weird vm stuff in the nfs server.
    723           1.1  dholland  */
    724           1.1  dholland #define	PDIRUNLOCK	0x0
    725           1.1  dholland #define	MAX_COMMIT_COUNT	(1024 * 1024)
    726           1.1  dholland 
    727           1.1  dholland /*
    728           1.1  dholland  * Define these to handle the type of va_rdev.
    729           1.1  dholland  */
    730           1.1  dholland #define	NFSMAKEDEV(m, n)	makedev((m), (n))
    731           1.1  dholland #define	NFSMAJOR(d)		major(d)
    732           1.1  dholland #define	NFSMINOR(d)		minor(d)
    733           1.1  dholland 
    734           1.1  dholland /*
    735           1.1  dholland  * Define this to be the macro that returns the minimum size required
    736           1.1  dholland  * for a directory entry.
    737           1.1  dholland  */
    738           1.1  dholland #define	DIRENT_SIZE(dp)		GENERIC_DIRSIZ(dp)
    739           1.1  dholland 
    740           1.1  dholland /*
    741           1.1  dholland  * The vnode tag for nfsv4root.
    742           1.1  dholland  */
    743           1.1  dholland #define	VT_NFSV4ROOT		"nfsv4root"
    744           1.1  dholland 
    745           1.1  dholland /*
    746           1.1  dholland  * Define whatever it takes to do a vn_rdwr().
    747           1.1  dholland  */
    748           1.1  dholland #define	NFSD_RDWR(r, v, b, l, o, s, i, c, a, p) \
    749           1.1  dholland 	vn_rdwr((r), (v), (b), (l), (o), (s), (i), (c), NULL, (a), (p))
    750           1.1  dholland 
    751           1.1  dholland /*
    752           1.1  dholland  * Macros for handling memory for different BSDen.
    753           1.1  dholland  * NFSBCOPY(src, dst, len) - copies len bytes, non-overlapping
    754           1.1  dholland  * NFSOVBCOPY(src, dst, len) - ditto, but data areas might overlap
    755           1.1  dholland  * NFSBCMP(cp1, cp2, len) - compare len bytes, return 0 if same
    756           1.1  dholland  * NFSBZERO(cp, len) - set len bytes to 0x0
    757           1.1  dholland  */
    758           1.1  dholland #define	NFSBCOPY(s, d, l)	bcopy((s), (d), (l))
    759           1.1  dholland #define	NFSOVBCOPY(s, d, l)	ovbcopy((s), (d), (l))
    760           1.1  dholland #define	NFSBCMP(s, d, l)	bcmp((s), (d), (l))
    761           1.1  dholland #define	NFSBZERO(s, l)		bzero((s), (l))
    762           1.1  dholland 
    763           1.1  dholland /*
    764           1.1  dholland  * Some queue.h files don't have these dfined in them.
    765           1.1  dholland  */
    766  1.1.1.1.12.2     skrll #if 0	/* NetBSD has these, and redefining them here is an error */
    767           1.1  dholland #define	LIST_END(head)		NULL
    768           1.1  dholland #define	SLIST_END(head)		NULL
    769           1.1  dholland #define	TAILQ_END(head)		NULL
    770  1.1.1.1.12.2     skrll #endif
    771           1.1  dholland 
    772           1.1  dholland /*
    773           1.1  dholland  * This must be defined to be a global variable that increments once
    774           1.1  dholland  * per second, but never stops or goes backwards, even when a "date"
    775           1.1  dholland  * command changes the TOD clock. It is used for delta times for
    776           1.1  dholland  * leases, etc.
    777           1.1  dholland  */
    778           1.1  dholland #define	NFSD_MONOSEC		time_uptime
    779           1.1  dholland 
    780           1.1  dholland /*
    781           1.1  dholland  * Declare the malloc types.
    782           1.1  dholland  */
    783           1.1  dholland MALLOC_DECLARE(M_NEWNFSRVCACHE);
    784           1.1  dholland MALLOC_DECLARE(M_NEWNFSDCLIENT);
    785           1.1  dholland MALLOC_DECLARE(M_NEWNFSDSTATE);
    786           1.1  dholland MALLOC_DECLARE(M_NEWNFSDLOCK);
    787           1.1  dholland MALLOC_DECLARE(M_NEWNFSDLOCKFILE);
    788           1.1  dholland MALLOC_DECLARE(M_NEWNFSSTRING);
    789           1.1  dholland MALLOC_DECLARE(M_NEWNFSUSERGROUP);
    790           1.1  dholland MALLOC_DECLARE(M_NEWNFSDREQ);
    791           1.1  dholland MALLOC_DECLARE(M_NEWNFSFH);
    792           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLOWNER);
    793           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLOPEN);
    794           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLDELEG);
    795           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLCLIENT);
    796           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLLOCKOWNER);
    797           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLLOCK);
    798           1.1  dholland MALLOC_DECLARE(M_NEWNFSDIROFF);
    799           1.1  dholland MALLOC_DECLARE(M_NEWNFSV4NODE);
    800           1.1  dholland MALLOC_DECLARE(M_NEWNFSDIRECTIO);
    801           1.1  dholland MALLOC_DECLARE(M_NEWNFSMNT);
    802           1.1  dholland MALLOC_DECLARE(M_NEWNFSDROLLBACK);
    803           1.1  dholland MALLOC_DECLARE(M_NEWNFSLAYOUT);
    804           1.1  dholland MALLOC_DECLARE(M_NEWNFSFLAYOUT);
    805           1.1  dholland MALLOC_DECLARE(M_NEWNFSDEVINFO);
    806           1.1  dholland MALLOC_DECLARE(M_NEWNFSSOCKREQ);
    807           1.1  dholland MALLOC_DECLARE(M_NEWNFSCLDS);
    808           1.1  dholland MALLOC_DECLARE(M_NEWNFSLAYRECALL);
    809  1.1.1.1.12.1     skrll MALLOC_DECLARE(M_NEWNFSDSESSION);
    810           1.1  dholland #define	M_NFSRVCACHE	M_NEWNFSRVCACHE
    811           1.1  dholland #define	M_NFSDCLIENT	M_NEWNFSDCLIENT
    812           1.1  dholland #define	M_NFSDSTATE	M_NEWNFSDSTATE
    813           1.1  dholland #define	M_NFSDLOCK	M_NEWNFSDLOCK
    814           1.1  dholland #define	M_NFSDLOCKFILE	M_NEWNFSDLOCKFILE
    815           1.1  dholland #define	M_NFSSTRING	M_NEWNFSSTRING
    816           1.1  dholland #define	M_NFSUSERGROUP	M_NEWNFSUSERGROUP
    817           1.1  dholland #define	M_NFSDREQ	M_NEWNFSDREQ
    818           1.1  dholland #define	M_NFSFH		M_NEWNFSFH
    819           1.1  dholland #define	M_NFSCLOWNER	M_NEWNFSCLOWNER
    820           1.1  dholland #define	M_NFSCLOPEN	M_NEWNFSCLOPEN
    821           1.1  dholland #define	M_NFSCLDELEG	M_NEWNFSCLDELEG
    822           1.1  dholland #define	M_NFSCLCLIENT	M_NEWNFSCLCLIENT
    823           1.1  dholland #define	M_NFSCLLOCKOWNER M_NEWNFSCLLOCKOWNER
    824           1.1  dholland #define	M_NFSCLLOCK	M_NEWNFSCLLOCK
    825           1.1  dholland #define	M_NFSDIROFF	M_NEWNFSDIROFF
    826           1.1  dholland #define	M_NFSV4NODE	M_NEWNFSV4NODE
    827           1.1  dholland #define	M_NFSDIRECTIO	M_NEWNFSDIRECTIO
    828           1.1  dholland #define	M_NFSDROLLBACK	M_NEWNFSDROLLBACK
    829           1.1  dholland #define	M_NFSLAYOUT	M_NEWNFSLAYOUT
    830           1.1  dholland #define	M_NFSFLAYOUT	M_NEWNFSFLAYOUT
    831           1.1  dholland #define	M_NFSDEVINFO	M_NEWNFSDEVINFO
    832           1.1  dholland #define	M_NFSSOCKREQ	M_NEWNFSSOCKREQ
    833           1.1  dholland #define	M_NFSCLDS	M_NEWNFSCLDS
    834           1.1  dholland #define	M_NFSLAYRECALL	M_NEWNFSLAYRECALL
    835  1.1.1.1.12.1     skrll #define	M_NFSDSESSION	M_NEWNFSDSESSION
    836           1.1  dholland 
    837           1.1  dholland #define	NFSINT_SIGMASK(set) 						\
    838           1.1  dholland 	(SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) ||	\
    839           1.1  dholland 	 SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) ||	\
    840           1.1  dholland 	 SIGISMEMBER(set, SIGQUIT))
    841           1.1  dholland 
    842           1.1  dholland /*
    843           1.1  dholland  * Convert a quota block count to byte count.
    844           1.1  dholland  */
    845           1.1  dholland #define	NFSQUOTABLKTOBYTE(q, b)	(q) *= (b)
    846           1.1  dholland 
    847           1.1  dholland /*
    848           1.1  dholland  * Define this as the largest file size supported. (It should probably
    849           1.1  dholland  * be available via a VFS_xxx Op, but it isn't.
    850           1.1  dholland  */
    851           1.1  dholland #define	NFSRV_MAXFILESIZE	((u_int64_t)0x800000000000)
    852           1.1  dholland 
    853           1.1  dholland /*
    854           1.1  dholland  * Set this macro to index() or strchr(), whichever is supported.
    855           1.1  dholland  */
    856           1.1  dholland #define	STRCHR(s, c)		strchr((s), (c))
    857           1.1  dholland 
    858           1.1  dholland /*
    859           1.1  dholland  * Set the n_time in the client write rpc, as required.
    860           1.1  dholland  */
    861  1.1.1.1.12.1     skrll #define	NFSWRITERPC_SETTIME(w, n, a, v4)				\
    862           1.1  dholland 	do {								\
    863           1.1  dholland 		if (w) {						\
    864  1.1.1.1.12.2     skrll 			mutex_enter(&((n)->n_mtx));			\
    865  1.1.1.1.12.1     skrll 			(n)->n_mtime = (a)->na_mtime;			\
    866           1.1  dholland 			if (v4)						\
    867  1.1.1.1.12.1     skrll 				(n)->n_change = (a)->na_filerev;	\
    868  1.1.1.1.12.2     skrll 			mutex_exit(&((n)->n_mtx));			\
    869           1.1  dholland 		}							\
    870           1.1  dholland 	} while (0)
    871           1.1  dholland 
    872           1.1  dholland /*
    873           1.1  dholland  * Fake value, just to make the client work.
    874           1.1  dholland  */
    875           1.1  dholland #define	NFS_LATTR_NOSHRINK	1
    876           1.1  dholland 
    877           1.1  dholland /*
    878           1.1  dholland  * Prototypes for functions where the arguments vary for different ports.
    879           1.1  dholland  */
    880           1.1  dholland int nfscl_loadattrcache(struct vnode **, struct nfsvattr *, void *, void *,
    881           1.1  dholland     int, int);
    882           1.1  dholland int newnfs_realign(struct mbuf **, int);
    883           1.1  dholland 
    884           1.1  dholland /*
    885           1.1  dholland  * If the port runs on an SMP box that can enforce Atomic ops with low
    886           1.1  dholland  * overheads, define these as atomic increments/decrements. If not,
    887           1.1  dholland  * don't worry about it, since these are used for stats that can be
    888           1.1  dholland  * "out by one" without disastrous consequences.
    889           1.1  dholland  */
    890           1.1  dholland #define	NFSINCRGLOBAL(a)	((a)++)
    891           1.1  dholland 
    892           1.1  dholland /*
    893           1.1  dholland  * Assorted funky stuff to make things work under Darwin8.
    894           1.1  dholland  */
    895           1.1  dholland /*
    896           1.1  dholland  * These macros checks for a field in vattr being set.
    897           1.1  dholland  */
    898           1.1  dholland #define	NFSATTRISSET(t, v, a)	((v)->a != (t)VNOVAL)
    899           1.1  dholland #define	NFSATTRISSETTIME(v, a)	((v)->a.tv_sec != VNOVAL)
    900           1.1  dholland 
    901           1.1  dholland /*
    902           1.1  dholland  * Manipulate mount flags.
    903           1.1  dholland  */
    904           1.1  dholland #define	NFSSTA_HASWRITEVERF	0x00040000  /* Has write verifier */
    905           1.1  dholland #define	NFSSTA_GOTFSINFO	0x00100000  /* Got the fsinfo */
    906           1.1  dholland #define	NFSSTA_NOLAYOUTCOMMIT	0x04000000  /* Don't do LayoutCommit */
    907           1.1  dholland #define	NFSSTA_SESSPERSIST	0x08000000  /* Has a persistent session */
    908           1.1  dholland #define	NFSSTA_TIMEO		0x10000000  /* Experiencing a timeout */
    909           1.1  dholland #define	NFSSTA_LOCKTIMEO	0x20000000  /* Experiencing a lockd timeout */
    910           1.1  dholland #define	NFSSTA_HASSETFSID	0x40000000  /* Has set the fsid */
    911           1.1  dholland #define	NFSSTA_PNFS		0x80000000  /* pNFS is enabled */
    912           1.1  dholland 
    913           1.1  dholland #define	NFSHASNFSV3(n)		((n)->nm_flag & NFSMNT_NFSV3)
    914           1.1  dholland #define	NFSHASNFSV4(n)		((n)->nm_flag & NFSMNT_NFSV4)
    915           1.1  dholland #define	NFSHASNFSV4N(n)		((n)->nm_minorvers > 0)
    916           1.1  dholland #define	NFSHASNFSV3OR4(n)	((n)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4))
    917           1.1  dholland #define	NFSHASGOTFSINFO(n)	((n)->nm_state & NFSSTA_GOTFSINFO)
    918           1.1  dholland #define	NFSHASHASSETFSID(n)	((n)->nm_state & NFSSTA_HASSETFSID)
    919           1.1  dholland #define	NFSHASSTRICT3530(n)	((n)->nm_flag & NFSMNT_STRICT3530)
    920           1.1  dholland #define	NFSHASWRITEVERF(n)	((n)->nm_state & NFSSTA_HASWRITEVERF)
    921           1.1  dholland #define	NFSHASINT(n)		((n)->nm_flag & NFSMNT_INT)
    922           1.1  dholland #define	NFSHASSOFT(n)		((n)->nm_flag & NFSMNT_SOFT)
    923           1.1  dholland #define	NFSHASINTORSOFT(n)	((n)->nm_flag & (NFSMNT_INT | NFSMNT_SOFT))
    924           1.1  dholland #define	NFSHASDUMBTIMR(n)	((n)->nm_flag & NFSMNT_DUMBTIMR)
    925           1.1  dholland #define	NFSHASNOCONN(n)		((n)->nm_flag & NFSMNT_MNTD)
    926           1.1  dholland #define	NFSHASKERB(n)		((n)->nm_flag & NFSMNT_KERB)
    927           1.1  dholland #define	NFSHASALLGSSNAME(n)	((n)->nm_flag & NFSMNT_ALLGSSNAME)
    928           1.1  dholland #define	NFSHASINTEGRITY(n)	((n)->nm_flag & NFSMNT_INTEGRITY)
    929           1.1  dholland #define	NFSHASPRIVACY(n)	((n)->nm_flag & NFSMNT_PRIVACY)
    930           1.1  dholland #define	NFSSETWRITEVERF(n)	((n)->nm_state |= NFSSTA_HASWRITEVERF)
    931           1.1  dholland #define	NFSSETHASSETFSID(n)	((n)->nm_state |= NFSSTA_HASSETFSID)
    932           1.1  dholland #define	NFSHASPNFSOPT(n)	((n)->nm_flag & NFSMNT_PNFS)
    933           1.1  dholland #define	NFSHASNOLAYOUTCOMMIT(n)	((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT)
    934           1.1  dholland #define	NFSHASSESSPERSIST(n)	((n)->nm_state & NFSSTA_SESSPERSIST)
    935           1.1  dholland #define	NFSHASPNFS(n)		((n)->nm_state & NFSSTA_PNFS)
    936           1.1  dholland 
    937           1.1  dholland /*
    938           1.1  dholland  * Gets the stats field out of the mount structure.
    939           1.1  dholland  */
    940           1.1  dholland #define	vfs_statfs(m)	(&((m)->mnt_stat))
    941           1.1  dholland 
    942           1.1  dholland /*
    943           1.1  dholland  * Set boottime.
    944           1.1  dholland  */
    945  1.1.1.1.12.1     skrll #define	NFSSETBOOTTIME(b)	(getboottime(&b))
    946           1.1  dholland 
    947           1.1  dholland /*
    948           1.1  dholland  * The size of directory blocks in the buffer cache.
    949           1.1  dholland  * MUST BE in the range of PAGE_SIZE <= NFS_DIRBLKSIZ <= MAXBSIZE!!
    950           1.1  dholland  */
    951           1.1  dholland #define	NFS_DIRBLKSIZ	(16 * DIRBLKSIZ) /* Must be a multiple of DIRBLKSIZ */
    952           1.1  dholland 
    953           1.1  dholland /*
    954           1.1  dholland  * Define these macros to access mnt_flag fields.
    955           1.1  dholland  */
    956           1.1  dholland #define	NFSMNT_RDONLY(m)	((m)->mnt_flag & MNT_RDONLY)
    957           1.1  dholland #endif	/* _KERNEL */
    958           1.1  dholland 
    959           1.1  dholland /*
    960           1.1  dholland  * Define a structure similar to ufs_args for use in exporting the V4 root.
    961           1.1  dholland  */
    962           1.1  dholland struct nfsex_args {
    963           1.1  dholland 	char	*fspec;
    964           1.1  dholland 	struct export_args	export;
    965           1.1  dholland };
    966           1.1  dholland 
    967           1.1  dholland /*
    968           1.1  dholland  * These export flags should be defined, but there are no bits left.
    969           1.1  dholland  * Maybe a separate mnt_exflag field could be added or the mnt_flag
    970           1.1  dholland  * field increased to 64 bits?
    971           1.1  dholland  */
    972           1.1  dholland #ifndef	MNT_EXSTRICTACCESS
    973           1.1  dholland #define	MNT_EXSTRICTACCESS	0x0
    974           1.1  dholland #endif
    975           1.1  dholland #ifndef MNT_EXV4ONLY
    976           1.1  dholland #define	MNT_EXV4ONLY		0x0
    977           1.1  dholland #endif
    978           1.1  dholland 
    979           1.1  dholland #ifdef _KERNEL
    980           1.1  dholland /*
    981           1.1  dholland  * Define this to invalidate the attribute cache for the nfs node.
    982           1.1  dholland  */
    983           1.1  dholland #define	NFSINVALATTRCACHE(n)	((n)->n_attrstamp = 0)
    984           1.1  dholland 
    985           1.1  dholland /* Used for FreeBSD only */
    986           1.1  dholland void nfsd_mntinit(void);
    987           1.1  dholland 
    988           1.1  dholland /*
    989           1.1  dholland  * Define these for vnode lock/unlock ops.
    990           1.1  dholland  *
    991           1.1  dholland  * These are good abstractions to macro out, so that they can be added to
    992           1.1  dholland  * later, for debugging or stats, etc.
    993           1.1  dholland  */
    994           1.1  dholland #define	NFSVOPLOCK(v, f)	vn_lock((v), (f))
    995           1.1  dholland #define	NFSVOPUNLOCK(v, f)	VOP_UNLOCK((v), (f))
    996           1.1  dholland #define	NFSVOPISLOCKED(v)	VOP_ISLOCKED((v))
    997           1.1  dholland 
    998           1.1  dholland /*
    999           1.1  dholland  * Define ncl_hash().
   1000           1.1  dholland  */
   1001           1.1  dholland #define	ncl_hash(f, l)	(fnv_32_buf((f), (l), FNV1_32_INIT))
   1002           1.1  dholland 
   1003           1.1  dholland int newnfs_iosize(struct nfsmount *);
   1004           1.1  dholland 
   1005           1.1  dholland int newnfs_vncmpf(struct vnode *, void *);
   1006           1.1  dholland 
   1007           1.1  dholland #ifndef NFS_MINDIRATTRTIMO
   1008           1.1  dholland #define	NFS_MINDIRATTRTIMO 3		/* VDIR attrib cache timeout in sec */
   1009           1.1  dholland #endif
   1010           1.1  dholland #ifndef NFS_MAXDIRATTRTIMO
   1011           1.1  dholland #define	NFS_MAXDIRATTRTIMO 60
   1012           1.1  dholland #endif
   1013           1.1  dholland 
   1014           1.1  dholland /*
   1015           1.1  dholland  * Nfs outstanding request list element
   1016           1.1  dholland  */
   1017           1.1  dholland struct nfsreq {
   1018           1.1  dholland 	TAILQ_ENTRY(nfsreq) r_chain;
   1019           1.1  dholland 	u_int32_t	r_flags;	/* flags on request, see below */
   1020           1.1  dholland 	struct nfsmount *r_nmp;		/* Client mnt ptr */
   1021  1.1.1.1.12.2     skrll 	kmutex_t	r_mtx;		/* Mutex lock for this structure */
   1022           1.1  dholland };
   1023           1.1  dholland 
   1024           1.1  dholland #ifndef NFS_MAXBSIZE
   1025  1.1.1.1.12.1     skrll #define	NFS_MAXBSIZE	MAXBCACHEBUF
   1026           1.1  dholland #endif
   1027           1.1  dholland 
   1028           1.1  dholland /*
   1029           1.1  dholland  * This macro checks to see if issuing of delegations is allowed for this
   1030           1.1  dholland  * vnode.
   1031           1.1  dholland  */
   1032           1.1  dholland #ifdef VV_DISABLEDELEG
   1033           1.1  dholland #define	NFSVNO_DELEGOK(v)						\
   1034           1.1  dholland 	((v) == NULL || ((v)->v_vflag & VV_DISABLEDELEG) == 0)
   1035           1.1  dholland #else
   1036           1.1  dholland #define	NFSVNO_DELEGOK(v)	(1)
   1037           1.1  dholland #endif
   1038           1.1  dholland 
   1039  1.1.1.1.12.1     skrll /*
   1040  1.1.1.1.12.1     skrll  * Name used by getnewvnode() to describe filesystem, "nfs".
   1041  1.1.1.1.12.1     skrll  * For performance reasons it is useful to have the same string
   1042  1.1.1.1.12.1     skrll  * used in both places that call getnewvnode().
   1043  1.1.1.1.12.1     skrll  */
   1044  1.1.1.1.12.1     skrll extern const char nfs_vnode_tag[];
   1045  1.1.1.1.12.1     skrll 
   1046           1.1  dholland #endif	/* _KERNEL */
   1047           1.1  dholland 
   1048           1.1  dholland #endif	/* _NFS_NFSPORT_H */
   1049