xref: /csrg-svn/sys/nfs/nfsmount.h (revision 48045)
138414Smckusick /*
238414Smckusick  * Copyright (c) 1989 The Regents of the University of California.
338414Smckusick  * All rights reserved.
438414Smckusick  *
538414Smckusick  * This code is derived from software contributed to Berkeley by
638414Smckusick  * Rick Macklem at The University of Guelph.
738414Smckusick  *
844515Sbostic  * %sccs.include.redist.c%
938414Smckusick  *
10*48045Smckusick  *	@(#)nfsmount.h	7.7 (Berkeley) 04/16/91
1138414Smckusick  */
1238414Smckusick 
1338414Smckusick /*
1438414Smckusick  * Mount structure.
1540122Smckusick  * One allocated on every NFS mount.
1640122Smckusick  * Holds NFS specific information for mount.
1738414Smckusick  */
1838414Smckusick struct	nfsmount {
1938414Smckusick 	int	nm_flag;		/* Flags for soft/hard... */
2040122Smckusick 	struct	mount *nm_mountp;	/* Vfs structure for this filesystem */
2138414Smckusick 	nfsv2fh_t nm_fh;		/* File handle of root dir */
2241895Smckusick 	struct	socket *nm_so;		/* Rpc socket */
2341895Smckusick 	int	nm_sotype;		/* Type of socket */
2441895Smckusick 	int	nm_soproto;		/* and protocol */
2541895Smckusick 	int	nm_soflags;		/* pr_flags for socket protocol */
2641895Smckusick 	struct	mbuf *nm_nam;		/* Addr of server */
2740122Smckusick 	short	nm_retry;		/* Max retry count */
2840122Smckusick 	short	nm_rexmit;		/* Rexmit on previous request */
2940122Smckusick 	short	nm_rtt;			/* Round trip timer ticks @ NFS_HZ */
3040122Smckusick 	short	nm_rto;			/* Current timeout */
3140122Smckusick 	short	nm_srtt;		/* Smoothed round trip time */
3240122Smckusick 	short	nm_rttvar;		/* RTT variance */
3341895Smckusick 	short	nm_currto;		/* Current rto of any nfsmount */
3441895Smckusick 	short	nm_currexmit;		/* Max rexmit count of nfsmounts */
3541895Smckusick 	short	nm_sent;		/* Request send count */
3641895Smckusick 	short	nm_window;		/* Request send window (max) */
3741895Smckusick 	short	nm_winext;		/* Window incremental value */
3841895Smckusick 	short	nm_ssthresh;		/* Slowstart threshold */
3941895Smckusick 	short	nm_salen;		/* Actual length of nm_sockaddr */
4038414Smckusick 	int	nm_rsize;		/* Max size of read rpc */
4138414Smckusick 	int	nm_wsize;		/* Max size of write rpc */
4238414Smckusick };
4338414Smckusick 
4441398Smckusick #ifdef KERNEL
4541398Smckusick /*
4641398Smckusick  * Convert mount ptr to nfsmount ptr.
4741398Smckusick  */
4841398Smckusick #define VFSTONFS(mp)	((struct nfsmount *)((mp)->mnt_data))
4941398Smckusick #endif /* KERNEL */
50*48045Smckusick 
51*48045Smckusick /*
52*48045Smckusick  * Prototypes for NFS mount operations
53*48045Smckusick  */
54*48045Smckusick int	nfs_mount __P((
55*48045Smckusick 		struct mount *mp,
56*48045Smckusick 		char *path,
57*48045Smckusick 		caddr_t data,
58*48045Smckusick 		struct nameidata *ndp,
59*48045Smckusick 		struct proc *p));
60*48045Smckusick int	nfs_start __P((
61*48045Smckusick 		struct mount *mp,
62*48045Smckusick 		int flags,
63*48045Smckusick 		struct proc *p));
64*48045Smckusick int	nfs_unmount __P((
65*48045Smckusick 		struct mount *mp,
66*48045Smckusick 		int mntflags,
67*48045Smckusick 		struct proc *p));
68*48045Smckusick int	nfs_root __P((
69*48045Smckusick 		struct mount *mp,
70*48045Smckusick 		struct vnode **vpp));
71*48045Smckusick int	nfs_quotactl __P((
72*48045Smckusick 		struct mount *mp,
73*48045Smckusick 		int cmds,
74*48045Smckusick 		int uid,	/* should be uid_t */
75*48045Smckusick 		caddr_t arg,
76*48045Smckusick 		struct proc *p));
77*48045Smckusick int	nfs_statfs __P((
78*48045Smckusick 		struct mount *mp,
79*48045Smckusick 		struct statfs *sbp,
80*48045Smckusick 		struct proc *p));
81*48045Smckusick int	nfs_sync __P((
82*48045Smckusick 		struct mount *mp,
83*48045Smckusick 		int waitfor));
84*48045Smckusick int	nfs_fhtovp __P((
85*48045Smckusick 		struct mount *mp,
86*48045Smckusick 		struct fid *fhp,
87*48045Smckusick 		struct vnode **vpp));
88*48045Smckusick int	nfs_vptofh __P((
89*48045Smckusick 		struct vnode *vp,
90*48045Smckusick 		struct fid *fhp));
91*48045Smckusick int	nfs_init __P(());
92