Home | History | Annotate | Line # | Download | only in nfs
nfsmount.h revision 1.13
      1  1.13       cgd /*	$NetBSD: nfsmount.h,v 1.13 1996/12/22 10:10:36 cgd Exp $	*/
      2   1.5       cgd 
      3   1.1   mycroft /*
      4   1.4   mycroft  * Copyright (c) 1989, 1993
      5   1.4   mycroft  *	The Regents of the University of California.  All rights reserved.
      6   1.1   mycroft  *
      7   1.1   mycroft  * This code is derived from software contributed to Berkeley by
      8   1.1   mycroft  * Rick Macklem at The University of Guelph.
      9   1.1   mycroft  *
     10   1.1   mycroft  * Redistribution and use in source and binary forms, with or without
     11   1.1   mycroft  * modification, are permitted provided that the following conditions
     12   1.1   mycroft  * are met:
     13   1.1   mycroft  * 1. Redistributions of source code must retain the above copyright
     14   1.1   mycroft  *    notice, this list of conditions and the following disclaimer.
     15   1.1   mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1   mycroft  *    notice, this list of conditions and the following disclaimer in the
     17   1.1   mycroft  *    documentation and/or other materials provided with the distribution.
     18   1.1   mycroft  * 3. All advertising materials mentioning features or use of this software
     19   1.1   mycroft  *    must display the following acknowledgement:
     20   1.1   mycroft  *	This product includes software developed by the University of
     21   1.1   mycroft  *	California, Berkeley and its contributors.
     22   1.1   mycroft  * 4. Neither the name of the University nor the names of its contributors
     23   1.1   mycroft  *    may be used to endorse or promote products derived from this software
     24   1.1   mycroft  *    without specific prior written permission.
     25   1.1   mycroft  *
     26   1.1   mycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27   1.1   mycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28   1.1   mycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29   1.1   mycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30   1.1   mycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31   1.1   mycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32   1.1   mycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33   1.1   mycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34   1.1   mycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35   1.1   mycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36   1.1   mycroft  * SUCH DAMAGE.
     37   1.1   mycroft  *
     38  1.10      fvdl  *	@(#)nfsmount.h	8.3 (Berkeley) 3/30/95
     39   1.1   mycroft  */
     40   1.1   mycroft 
     41  1.10      fvdl 
     42  1.10      fvdl #ifndef _NFS_NFSMOUNT_H_
     43  1.10      fvdl #define _NFS_NFSMOUNT_H_
     44  1.10      fvdl 
     45   1.1   mycroft /*
     46   1.1   mycroft  * Mount structure.
     47   1.1   mycroft  * One allocated on every NFS mount.
     48   1.1   mycroft  * Holds NFS specific information for mount.
     49   1.1   mycroft  */
     50   1.1   mycroft struct	nfsmount {
     51   1.1   mycroft 	int	nm_flag;		/* Flags for soft/hard... */
     52   1.1   mycroft 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
     53   1.4   mycroft 	int	nm_numgrps;		/* Max. size of groupslist */
     54  1.10      fvdl 	u_char	nm_fh[NFSX_V3FHMAX];	/* File handle of root dir */
     55  1.10      fvdl 	int	nm_fhsize;		/* Size of root file handle */
     56   1.1   mycroft 	struct	socket *nm_so;		/* Rpc socket */
     57   1.1   mycroft 	int	nm_sotype;		/* Type of socket */
     58   1.1   mycroft 	int	nm_soproto;		/* and protocol */
     59   1.1   mycroft 	int	nm_soflags;		/* pr_flags for socket protocol */
     60   1.1   mycroft 	struct	mbuf *nm_nam;		/* Addr of server */
     61   1.4   mycroft 	int	nm_timeo;		/* Init timer for NFSMNT_DUMBTIMR */
     62   1.4   mycroft 	int	nm_retry;		/* Max retries */
     63   1.4   mycroft 	int	nm_srtt[4];		/* Timers for rpcs */
     64   1.4   mycroft 	int	nm_sdrtt[4];
     65   1.4   mycroft 	int	nm_sent;		/* Request send count */
     66   1.4   mycroft 	int	nm_cwnd;		/* Request send window */
     67   1.4   mycroft 	int	nm_timeouts;		/* Request timeouts */
     68   1.4   mycroft 	int	nm_deadthresh;		/* Threshold of timeouts-->dead server*/
     69   1.1   mycroft 	int	nm_rsize;		/* Max size of read rpc */
     70   1.1   mycroft 	int	nm_wsize;		/* Max size of write rpc */
     71  1.10      fvdl 	int	nm_readdirsize;		/* Size of a readdir rpc */
     72   1.4   mycroft 	int	nm_readahead;		/* Num. of blocks to readahead */
     73   1.4   mycroft 	int	nm_leaseterm;		/* Term (sec) for NQNFS lease */
     74   1.6   mycroft 	CIRCLEQ_HEAD(, nfsnode) nm_timerhead; /* Head of lease timer queue */
     75   1.4   mycroft 	struct vnode *nm_inprog;	/* Vnode in prog by nqnfs_clientd() */
     76   1.4   mycroft 	uid_t	nm_authuid;		/* Uid for authenticator */
     77   1.4   mycroft 	int	nm_authtype;		/* Authenticator type */
     78   1.4   mycroft 	int	nm_authlen;		/* and length */
     79   1.4   mycroft 	char	*nm_authstr;		/* Authenticator string */
     80  1.10      fvdl 	char	*nm_verfstr;		/* and the verifier */
     81  1.10      fvdl 	int	nm_verflen;
     82  1.10      fvdl 	u_char	nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
     83  1.10      fvdl 	NFSKERBKEY_T nm_key;		/* and the session key */
     84  1.10      fvdl 	int	nm_numuids;		/* Number of nfsuid mappings */
     85  1.10      fvdl 	TAILQ_HEAD(, nfsuid) nm_uidlruhead; /* Lists of nfsuid mappings */
     86  1.10      fvdl 	LIST_HEAD(, nfsuid) nm_uidhashtbl[NFS_MUIDHASHSIZ];
     87  1.11   thorpej 	TAILQ_HEAD(, buf) nm_bufq;      /* async io buffer queue */
     88  1.11   thorpej 	short	nm_bufqlen;		/* number of buffers in queue */
     89  1.11   thorpej 	short	nm_bufqwant;		/* process wants to add to the queue */
     90  1.11   thorpej 	int	nm_bufqiods;		/* number of iods processing queue */
     91   1.1   mycroft };
     92   1.1   mycroft 
     93   1.8       jtc #ifdef _KERNEL
     94   1.1   mycroft /*
     95   1.1   mycroft  * Convert mount ptr to nfsmount ptr.
     96   1.1   mycroft  */
     97   1.1   mycroft #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
     98  1.10      fvdl #endif /* _KERNEL */
     99   1.1   mycroft 
    100   1.1   mycroft /*
    101   1.1   mycroft  * Prototypes for NFS mount operations
    102   1.1   mycroft  */
    103  1.13       cgd int	nfs_mount __P((struct mount *mp, const char *path, void *data,
    104  1.10      fvdl 		struct nameidata *ndp, struct proc *p));
    105  1.10      fvdl int	mountnfs __P((struct nfs_args *argp, struct mount *mp,
    106  1.13       cgd 		struct mbuf *nam, const char *pth, const char *hst,
    107  1.13       cgd 		struct vnode **vpp));
    108  1.10      fvdl int	nfs_mountroot __P((void));
    109  1.10      fvdl void	nfs_decode_args __P((struct nfsmount *, struct nfs_args *));
    110  1.10      fvdl int	nfs_start __P((struct mount *mp, int flags, struct proc *p));
    111  1.10      fvdl int	nfs_unmount __P((struct mount *mp, int mntflags, struct proc *p));
    112  1.10      fvdl int	nfs_root __P((struct mount *mp, struct vnode **vpp));
    113  1.10      fvdl int	nfs_quotactl __P((struct mount *mp, int cmds, uid_t uid, caddr_t arg,
    114  1.10      fvdl 		struct proc *p));
    115  1.10      fvdl int	nfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
    116  1.10      fvdl int	nfs_sync __P((struct mount *mp, int waitfor, struct ucred *cred,
    117  1.10      fvdl 		struct proc *p));
    118  1.10      fvdl int	nfs_vget __P((struct mount *, ino_t, struct vnode **));
    119  1.10      fvdl int	nfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct mbuf *nam,
    120  1.10      fvdl 		struct vnode **vpp, int *exflagsp, struct ucred **credanonp));
    121  1.10      fvdl int	nfs_vptofh __P((struct vnode *vp, struct fid *fhp));
    122  1.10      fvdl int	nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
    123  1.10      fvdl 			struct proc *));
    124  1.12   thorpej void	nfs_vfs_init __P((void));
    125  1.12   thorpej 
    126  1.12   thorpej /*
    127  1.12   thorpej  * Prototypes for miscellaneous exported NFS functions.
    128  1.12   thorpej  */
    129  1.10      fvdl void	nfs_init __P((void));
    130   1.9  christos 
    131  1.10      fvdl #endif
    132