summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
committerwollman <wollman@FreeBSD.org>1997-08-16 19:16:27 +0000
commit4542c1cf5d7077caf33d6d9468f5e647cd9d19e5 (patch)
tree69fd093ef1e8c080592999507b664fe6315c0e10 /sys/nfsserver
parentf4edc7fc6748272644fb845fc8636a5c261247d6 (diff)
downloadFreeBSD-src-4542c1cf5d7077caf33d6d9468f5e647cd9d19e5.zip
FreeBSD-src-4542c1cf5d7077caf33d6d9468f5e647cd9d19e5.tar.gz
Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs.h133
-rw-r--r--sys/nfsserver/nfs_serv.c44
-rw-r--r--sys/nfsserver/nfs_srvcache.c9
-rw-r--r--sys/nfsserver/nfs_srvsock.c62
-rw-r--r--sys/nfsserver/nfs_srvsubs.c14
-rw-r--r--sys/nfsserver/nfs_syscalls.c57
-rw-r--r--sys/nfsserver/nfsrvstats.h133
7 files changed, 255 insertions, 197 deletions
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h
index 528a366..e1a4755 100644
--- a/sys/nfsserver/nfs.h
+++ b/sys/nfsserver/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.28 1997/06/03 17:22:45 dfr Exp $
+ * $Id: nfs.h,v 1.29 1997/07/16 09:06:27 dfr Exp $
*/
#ifndef _NFS_NFS_H_
@@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
*/
union nethostaddr {
u_long had_inetaddr;
- struct mbuf *had_nam;
+ struct sockaddr *had_nam;
};
struct nfsuid {
@@ -406,7 +406,7 @@ struct nfsuid {
struct nfsrv_rec {
STAILQ_ENTRY(nfsrv_rec) nr_link;
- struct mbuf *nr_address;
+ struct sockaddr *nr_address;
struct mbuf *nr_packet;
};
@@ -415,7 +415,7 @@ struct nfssvc_sock {
TAILQ_HEAD(, nfsuid) ns_uidlruhead;
struct file *ns_fp;
struct socket *ns_so;
- struct mbuf *ns_nam;
+ struct sockaddr *ns_nam;
struct mbuf *ns_raw;
struct mbuf *ns_rawend;
STAILQ_HEAD(, nfsrv_rec) ns_rec;
@@ -480,8 +480,8 @@ struct nfsrv_descript {
struct mbuf *nd_mrep; /* Request mbuf list */
struct mbuf *nd_md; /* Current dissect mbuf */
struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
+ struct sockaddr *nd_nam; /* and socket addr */
+ struct sockaddr *nd_nam2; /* return socket addr */
caddr_t nd_dpos; /* Current dissect pos */
u_int32_t nd_procnum; /* RPC # */
int nd_stable; /* storage type */
@@ -567,70 +567,91 @@ extern int nfs_debug;
int nfs_init __P((struct vfsconf *vfsp));
int nfs_reply __P((struct nfsreq *));
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
+int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
+ struct nfsreq *));
+int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
+ int, int, u_quad_t *, struct mbuf **, struct mbuf **,
+ caddr_t *));
+int nfs_sndlock __P((int *, struct nfsreq *));
void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
+int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
+int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
+ int));
+int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *,
+ int *));
+int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_asyncio __P((struct buf *, struct ucred *));
+int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
+int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
+int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
+void nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *,
+ struct nfs_fattr *));
+void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
+ struct vattr *, struct mbuf **, char **));
+void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
+ struct mbuf **, char **));
+int netaddr_match __P((int, union nethostaddr *, struct sockaddr *));
+int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
+ struct ucred *, struct mbuf **, struct mbuf **,
+ caddr_t *));
+int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
+ struct vattr *));
+int nfs_namei __P((struct nameidata *, fhandle_t *, int,
+ struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
+ caddr_t *, struct vnode **, struct proc *, int, int));
+void nfsm_adj __P((struct mbuf *, int, int));
+int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
+int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
+ char **, int *, char *, int *, NFSKERBKEY_T));
+int nfs_getnickauth __P((struct nfsmount *, struct ucred *, char **,
+ int *, char *, int));
+int nfs_savenickauth __P((struct nfsmount *, struct ucred *, int,
+ NFSKERBKEY_T, struct mbuf **, char **,
+ struct mbuf *));
+int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
void nfs_nhinit __P((void));
void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
+u_long nfs_hash __P((nfsfh_t *, int));
+int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *,
+ struct nfsrv_descript **));
+int nfsrv_getcache __P((struct nfsrv_descript *, struct nfssvc_sock *,
+ struct mbuf **));
+void nfsrv_updatecache __P((struct nfsrv_descript *, int, struct mbuf *));
void nfsrv_cleancache __P((void));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
+int nfs_connect __P((struct nfsmount *, struct nfsreq *));
void nfs_disconnect __P((struct nfsmount *));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
+int nfs_getattrcache __P((struct vnode *, struct vattr *));
+int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
+int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *,
+ int));
+int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
void nfsrv_init __P((int));
void nfs_clearcommit __P((struct mount *));
int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
+void nfsrvw_sort __P((gid_t *, int));
+void nfsrv_setcred __P((struct ucred *, struct ucred *));
+int nfs_writebp __P((struct buf *, int));
+int nfsrv_object_create __P((struct vnode *));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
struct proc *, struct mbuf **));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
struct proc *p));
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv3_access __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int,int));
+int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
+ struct nfssvc_sock *, struct sockaddr *, int *,
+ int, int));
int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
struct export_args *));
int nfs_ispublicfh __P((fhandle_t *));
@@ -655,7 +676,8 @@ int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
struct mbuf **mrq));
int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp, struct proc *procp,
@@ -669,11 +691,14 @@ int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 0ca0a9a..ce2ed43 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
- * $Id: nfs_serv.c,v 1.45 1997/07/16 09:06:28 dfr Exp $
+ * $Id: nfs_serv.c,v 1.46 1997/07/22 15:35:15 dfr Exp $
*/
/*
@@ -117,7 +117,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vnode *vp;
@@ -184,7 +184,7 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct nfs_fattr *fp;
@@ -230,7 +230,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, preat;
@@ -361,7 +361,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct nfs_fattr *fp;
@@ -482,7 +482,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct iovec iv[(NFS_MAXPATHLEN+MLEN-1)/MLEN];
@@ -585,7 +585,7 @@ nfsrv_read(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct iovec *iv;
@@ -750,7 +750,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct iovec *ivp;
@@ -1355,7 +1355,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct nfs_fattr *fp;
@@ -1593,7 +1593,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
@@ -1742,7 +1742,7 @@ nfsrv_remove(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct nameidata nd;
@@ -1830,7 +1830,7 @@ nfsrv_rename(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
@@ -2037,7 +2037,7 @@ nfsrv_link(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct nameidata nd;
@@ -2140,7 +2140,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
@@ -2283,7 +2283,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
@@ -2399,7 +2399,7 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
@@ -2528,7 +2528,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register char *bp, *be;
@@ -2795,7 +2795,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register char *bp, *be;
@@ -3111,7 +3111,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr bfor, aft;
@@ -3172,7 +3172,7 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register struct statfs *sf;
@@ -3250,7 +3250,7 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
@@ -3320,7 +3320,7 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep, *md = nfsd->nd_md;
- struct mbuf *nam = nfsd->nd_nam;
+ struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c
index c2623a3..6c6be6d 100644
--- a/sys/nfsserver/nfs_srvcache.c
+++ b/sys/nfsserver/nfs_srvcache.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_srvcache.c 8.3 (Berkeley) 3/30/95
- * $Id: nfs_srvcache.c,v 1.12 1997/05/10 16:12:03 dfr Exp $
+ * $Id: nfs_srvcache.c,v 1.13 1997/08/02 14:33:07 bde Exp $
*/
#ifndef NFS_NOSERVER
@@ -49,6 +49,7 @@
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/socket.h>
+#include <sys/socketvar.h> /* for dup_sockaddr */
#include <netinet/in.h>
#ifdef ISO
@@ -239,13 +240,13 @@ loop:
if (rp->rc_flag & RC_REPMBUF)
m_freem(rp->rc_reply);
if (rp->rc_flag & RC_NAM)
- MFREE(rp->rc_nam, mb);
+ FREE(rp->rc_nam, M_SONAME);
rp->rc_flag &= (RC_LOCKED | RC_WANTED);
}
TAILQ_INSERT_TAIL(&nfsrvlruhead, rp, rc_lru);
rp->rc_state = RC_INPROG;
rp->rc_xid = nd->nd_retxid;
- saddr = mtod(nd->nd_nam, struct sockaddr_in *);
+ saddr = (struct sockaddr_in *)nd->nd_nam;
switch (saddr->sin_family) {
case AF_INET:
rp->rc_flag |= RC_INETADDR;
@@ -254,7 +255,7 @@ loop:
case AF_ISO:
default:
rp->rc_flag |= RC_NAM;
- rp->rc_nam = m_copym(nd->nd_nam, 0, M_COPYALL, M_WAIT);
+ rp->rc_nam = dup_sockaddr(nd->nd_nam, 1);
break;
};
rp->rc_proc = nd->nd_procnum;
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 0ea7f69..4b41e67 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_socket.c,v 1.25 1997/05/13 17:25:44 dfr Exp $
+ * $Id: nfs_socket.c,v 1.26 1997/06/03 17:22:46 dfr Exp $
*/
/*
@@ -138,7 +138,7 @@ static int nfs_msg __P((struct proc *,char *,char *));
static int nfs_rcvlock __P((struct nfsreq *));
static void nfs_rcvunlock __P((int *flagp));
static void nfs_realign __P((struct mbuf *m, int hsiz));
-static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname,
+static int nfs_receive __P((struct nfsreq *rep, struct sockaddr **aname,
struct mbuf **mp));
static int nfs_reconnect __P((struct nfsreq *rep));
#ifndef NFS_NOSERVER
@@ -195,7 +195,7 @@ nfs_connect(nmp, rep)
struct proc *p = &proc0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
- saddr = mtod(nmp->nm_nam, struct sockaddr *);
+ saddr = nmp->nm_nam;
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
nmp->nm_soproto, p);
if (error)
@@ -207,17 +207,18 @@ nfs_connect(nmp, rep)
* Some servers require that the client port be a reserved port number.
*/
if (saddr->sa_family == AF_INET && (nmp->nm_flag & NFSMNT_RESVPORT)) {
- MGET(m, M_WAIT, MT_SONAME);
- sin = mtod(m, struct sockaddr_in *);
- sin->sin_len = m->m_len = sizeof (struct sockaddr_in);
+ struct sockaddr_in ssin;
+ bzero(&ssin, sizeof ssin);
+ sin = &ssin;
+ sin->sin_len = sizeof (struct sockaddr_in);
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = INADDR_ANY;
tport = IPPORT_RESERVED - 1;
sin->sin_port = htons(tport);
- while ((error = sobind(so, m, p)) == EADDRINUSE &&
+ while ((error = sobind(so, (struct sockaddr *)sin, p))
+ == EADDRINUSE &&
--tport > IPPORT_RESERVED / 2)
sin->sin_port = htons(tport);
- m_freem(m);
if (error)
goto bad;
}
@@ -232,6 +233,7 @@ nfs_connect(nmp, rep)
goto bad;
}
} else {
+ /* XXX should not use mbuf */
error = soconnect(so, nmp->nm_nam, p);
if (error)
goto bad;
@@ -383,11 +385,11 @@ nfs_disconnect(nmp)
int
nfs_send(so, nam, top, rep)
register struct socket *so;
- struct mbuf *nam;
+ struct sockaddr *nam;
register struct mbuf *top;
struct nfsreq *rep;
{
- struct mbuf *sendnam;
+ struct sockaddr *sendnam;
int error, soflags, flags;
if (rep) {
@@ -405,7 +407,7 @@ nfs_send(so, nam, top, rep)
} else
soflags = so->so_proto->pr_flags;
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
- sendnam = (struct mbuf *)0;
+ sendnam = (struct sockaddr *)0;
else
sendnam = nam;
if (so->so_type == SOCK_SEQPACKET)
@@ -414,10 +416,11 @@ nfs_send(so, nam, top, rep)
flags = 0;
error = so->so_proto->pr_usrreqs->pru_sosend(so, sendnam, 0, top, 0,
- flags);
+ flags, curproc /*XXX*/);
if (error) {
if (rep) {
- log(LOG_INFO, "nfs send error %d for server %s\n",error,
+ log(LOG_INFO, "nfs send error %d for server %s\n",
+ error,
rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
/*
* Deal with errors for the client side.
@@ -451,7 +454,7 @@ nfs_send(so, nam, top, rep)
static int
nfs_receive(rep, aname, mp)
register struct nfsreq *rep;
- struct mbuf **aname;
+ struct sockaddr **aname;
struct mbuf **mp;
{
register struct socket *so;
@@ -460,7 +463,7 @@ nfs_receive(rep, aname, mp)
register struct mbuf *m;
struct mbuf *control;
u_long len;
- struct mbuf **getnam;
+ struct sockaddr **getnam;
int error, sotype, rcvflg;
struct proc *p = curproc; /* XXX */
@@ -468,7 +471,7 @@ nfs_receive(rep, aname, mp)
* Set up arguments for soreceive()
*/
*mp = (struct mbuf *)0;
- *aname = (struct mbuf *)0;
+ *aname = (struct sockaddr *)0;
sotype = rep->r_nmp->nm_sotype;
/*
@@ -533,7 +536,7 @@ tryagain:
do {
rcvflg = MSG_WAITALL;
error = so->so_proto->pr_usrreqs->pru_soreceive
- (so, (struct mbuf **)0, &auio,
+ (so, (struct sockaddr **)0, &auio,
(struct mbuf **)0, (struct mbuf **)0,
&rcvflg);
if (error == EWOULDBLOCK && rep) {
@@ -568,7 +571,7 @@ tryagain:
do {
rcvflg = MSG_WAITALL;
error = so->so_proto->pr_usrreqs->pru_soreceive
- (so, (struct mbuf **)0,
+ (so, (struct sockaddr **)0,
&auio, mp, (struct mbuf **)0, &rcvflg);
} while (error == EWOULDBLOCK || error == EINTR ||
error == ERESTART);
@@ -593,7 +596,7 @@ tryagain:
do {
rcvflg = 0;
error = so->so_proto->pr_usrreqs->pru_soreceive
- (so, (struct mbuf **)0,
+ (so, (struct sockaddr **)0,
&auio, mp, &control, &rcvflg);
if (control)
m_freem(control);
@@ -628,7 +631,7 @@ errout:
if ((so = rep->r_nmp->nm_so) == NULL)
return (EACCES);
if (so->so_state & SS_ISCONNECTED)
- getnam = (struct mbuf **)0;
+ getnam = (struct sockaddr **)0;
else
getnam = aname;
auio.uio_resid = len = 1000000;
@@ -671,7 +674,8 @@ nfs_reply(myrep)
register struct nfsreq *rep;
register struct nfsmount *nmp = myrep->r_nmp;
register long t1;
- struct mbuf *mrep, *nam, *md;
+ struct mbuf *mrep, *md;
+ struct sockaddr *nam;
u_long rxid, *tl;
caddr_t dpos, cp2;
int error;
@@ -715,7 +719,7 @@ nfs_reply(myrep)
return (error);
}
if (nam)
- m_freem(nam);
+ FREE(nam, M_SONAME);
/*
* Get the xid and check that it is an rpc reply
@@ -1356,7 +1360,7 @@ nfs_timer(arg)
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
error = (*so->so_proto->pr_usrreqs->pru_send)
- (so, 0, m, (struct mbuf *)0,
+ (so, 0, m, (struct sockaddr *)0,
(struct mbuf *)0, p);
else
error = (*so->so_proto->pr_usrreqs->pru_send)
@@ -1642,7 +1646,8 @@ nfsrv_rcv(so, arg, waitflag)
{
register struct nfssvc_sock *slp = (struct nfssvc_sock *)arg;
register struct mbuf *m;
- struct mbuf *mp, *nam;
+ struct mbuf *mp;
+ struct sockaddr *nam;
struct uio auio;
int flags, error;
@@ -1717,7 +1722,7 @@ nfsrv_rcv(so, arg, waitflag)
M_NFSRVDESC, waitflag);
if (!rec) {
if (nam)
- m_freem(nam);
+ FREE(nam, M_SONAME);
m_freem(mp);
continue;
}
@@ -1864,7 +1869,7 @@ nfsrv_getstream(slp, waitflag)
m_freem(slp->ns_frag);
} else {
nfs_realign(slp->ns_frag, 10 * NFSX_UNSIGNED);
- rec->nr_address = (struct mbuf*)0;
+ rec->nr_address = (struct sockaddr *)0;
rec->nr_packet = slp->ns_frag;
STAILQ_INSERT_TAIL(&slp->ns_rec, rec, nr_link);
}
@@ -1883,7 +1888,8 @@ nfsrv_dorec(slp, nfsd, ndp)
struct nfsrv_descript **ndp;
{
struct nfsrv_rec *rec;
- register struct mbuf *m, *nam;
+ register struct mbuf *m;
+ struct sockaddr *nam;
register struct nfsrv_descript *nd;
int error;
@@ -1902,7 +1908,7 @@ nfsrv_dorec(slp, nfsd, ndp)
nd->nd_dpos = mtod(m, caddr_t);
error = nfs_getreq(nd, nfsd, TRUE);
if (error) {
- m_freem(nam);
+ FREE(nam, M_SONAME);
free((caddr_t)nd, M_NFSRVDESC);
return (error);
}
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 4c102c8..69baccb 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.39 1997/07/16 09:06:29 dfr Exp $
+ * $Id: nfs_subs.c,v 1.40 1997/07/22 15:35:57 dfr Exp $
*/
/*
@@ -1429,7 +1429,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag)
fhandle_t *fhp;
int len;
struct nfssvc_sock *slp;
- struct mbuf *nam;
+ struct sockaddr *nam;
struct mbuf **mdp;
caddr_t *dposp;
struct vnode **retdirp;
@@ -1840,7 +1840,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag, pubflag)
struct vnode **vpp;
struct ucred *cred;
struct nfssvc_sock *slp;
- struct mbuf *nam;
+ struct sockaddr *nam;
int *rdonlyp;
int kerbflag;
int pubflag;
@@ -1925,13 +1925,13 @@ int
netaddr_match(family, haddr, nam)
int family;
union nethostaddr *haddr;
- struct mbuf *nam;
+ struct sockaddr *nam;
{
register struct sockaddr_in *inetaddr;
switch (family) {
case AF_INET:
- inetaddr = mtod(nam, struct sockaddr_in *);
+ inetaddr = (struct sockaddr_in *)nam;
if (inetaddr->sin_family == AF_INET &&
inetaddr->sin_addr.s_addr == haddr->had_inetaddr)
return (1);
@@ -1941,8 +1941,8 @@ netaddr_match(family, haddr, nam)
{
register struct sockaddr_iso *isoaddr1, *isoaddr2;
- isoaddr1 = mtod(nam, struct sockaddr_iso *);
- isoaddr2 = mtod(haddr->had_nam, struct sockaddr_iso *);
+ isoaddr1 = (struct sockaddr_iso *)nam;
+ isoaddr2 = (struct sockaddr_iso *)haddr->had_nam;
if (isoaddr1->siso_family == AF_ISO &&
isoaddr1->siso_nlen > 0 &&
isoaddr1->siso_nlen == isoaddr2->siso_nlen &&
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index 0c46e28..ad93ce6 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
- * $Id: nfs_syscalls.c,v 1.25 1997/06/25 21:07:26 tegge Exp $
+ * $Id: nfs_syscalls.c,v 1.26 1997/07/16 09:06:29 dfr Exp $
*/
#include <sys/param.h>
@@ -106,7 +106,7 @@ static int notstarted = 1;
static int modify_flag = 0;
static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd,
int cacherep));
-static int nfssvc_addsock __P((struct file *, struct mbuf *,
+static int nfssvc_addsock __P((struct file *, struct sockaddr *,
struct proc *));
static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *));
@@ -184,7 +184,7 @@ nfssvc(p, uap, retval)
#ifndef NFS_NOSERVER
struct nameidata nd;
struct file *fp;
- struct mbuf *nam;
+ struct sockaddr *nam;
struct nfsd_args nfsdarg;
struct nfsd_srvargs nfsd_srvargs, *nsd = &nfsd_srvargs;
struct nfsd_cargs ncd;
@@ -243,10 +243,10 @@ nfssvc(p, uap, retval)
* Get the client address for connected sockets.
*/
if (nfsdarg.name == NULL || nfsdarg.namelen == 0)
- nam = (struct mbuf *)0;
+ nam = (struct sockaddr *)0;
else {
- error = sockargs(&nam, nfsdarg.name, nfsdarg.namelen,
- MT_SONAME);
+ error = getsockaddr(&nam, nfsdarg.name,
+ nfsdarg.namelen);
if (error)
return (error);
}
@@ -295,7 +295,7 @@ nfssvc(p, uap, retval)
TAILQ_REMOVE(&slp->ns_uidlruhead, nuidp,
nu_lru);
if (nuidp->nu_flag & NU_NAM)
- m_freem(nuidp->nu_nam);
+ FREE(nuidp->nu_nam, M_SONAME);
}
nuidp->nu_flag = 0;
nuidp->nu_cr = nsd->nsd_cr;
@@ -312,8 +312,8 @@ nfssvc(p, uap, retval)
if (nfsd->nfsd_nd->nd_nam2) {
struct sockaddr_in *saddr;
- saddr = mtod(nfsd->nfsd_nd->nd_nam2,
- struct sockaddr_in *);
+ saddr = (struct sockaddr_in *)
+ nfsd->nfsd_nd->nd_nam2;
switch (saddr->sin_family) {
case AF_INET:
nuidp->nu_flag |= NU_INETADDR;
@@ -323,9 +323,9 @@ nfssvc(p, uap, retval)
case AF_ISO:
default:
nuidp->nu_flag |= NU_NAM;
- nuidp->nu_nam = m_copym(
- nfsd->nfsd_nd->nd_nam2, 0,
- M_COPYALL, M_WAIT);
+ nuidp->nu_nam =
+ dup_sockaddr(nfsd->nfsd_nd->
+ nd_nam2, 1);
break;
};
}
@@ -356,7 +356,7 @@ nfssvc(p, uap, retval)
static int
nfssvc_addsock(fp, mynam, p)
struct file *fp;
- struct mbuf *mynam;
+ struct sockaddr *mynam;
struct proc *p;
{
register struct mbuf *m;
@@ -374,14 +374,14 @@ nfssvc_addsock(fp, mynam, p)
if (so->so_proto->pr_protocol == IPPROTO_UDP) {
tslp = nfs_udpsock;
if (tslp->ns_flag & SLP_VALID) {
- m_freem(mynam);
+ FREE(mynam, M_SONAME);
return (EPERM);
}
#ifdef ISO
} else if (so->so_proto->pr_protocol == ISOPROTO_CLTP) {
tslp = nfs_cltpsock;
if (tslp->ns_flag & SLP_VALID) {
- m_freem(mynam);
+ FREE(mynam, M_SONAME);
return (EPERM);
}
#endif /* ISO */
@@ -392,7 +392,7 @@ nfssvc_addsock(fp, mynam, p)
siz = NFS_MAXPACKET;
error = soreserve(so, siz, siz);
if (error) {
- m_freem(mynam);
+ FREE(mynam, M_SONAME);
return (error);
}
@@ -564,8 +564,9 @@ nfssvc_nfsd(nsd, argp, p)
*/
if (nfsd->nfsd_flag & NFSD_NEEDAUTH) {
nfsd->nfsd_flag &= ~NFSD_NEEDAUTH;
- nsd->nsd_haddr = mtod(nd->nd_nam,
- struct sockaddr_in *)->sin_addr.s_addr;
+ nsd->nsd_haddr =
+ ((struct sockaddr_in *)
+ nd->nd_nam)->sin_addr.s_addr;
nsd->nsd_authlen = nfsd->nfsd_authlen;
nsd->nsd_verflen = nfsd->nfsd_verflen;
if (!copyout(nfsd->nfsd_authstr,nsd->nsd_authstr,
@@ -607,10 +608,10 @@ nfssvc_nfsd(nsd, argp, p)
/* Check if source port is privileged */
u_short port;
u_long addr;
- struct mbuf *nam = nd->nd_nam;
+ struct sockaddr *nam = nd->nd_nam;
struct sockaddr_in *sin;
- sin = mtod(nam, struct sockaddr_in *);
+ sin = (struct sockaddr_in *)nam;
port = ntohs(sin->sin_port);
if (port >= IPPORT_RESERVED &&
nd->nd_procnum != NFSPROC_NULL) {
@@ -649,7 +650,7 @@ nfssvc_nfsd(nsd, argp, p)
nfsstats.srv_errs++;
nfsrv_updatecache(nd, FALSE, mreq);
if (nd->nd_nam2)
- m_freem(nd->nd_nam2);
+ FREE(nd->nd_nam2, M_SONAME);
break;
}
nfsstats.srvrpccnt[nd->nd_procnum]++;
@@ -688,7 +689,7 @@ nfssvc_nfsd(nsd, argp, p)
if (nfsrtton)
nfsd_rt(sotype, nd, cacherep);
if (nd->nd_nam2)
- MFREE(nd->nd_nam2, m);
+ FREE(nd->nd_nam2, M_SONAME);
if (nd->nd_mrep)
m_freem(nd->nd_mrep);
if (error == EPIPE)
@@ -706,7 +707,7 @@ nfssvc_nfsd(nsd, argp, p)
if (nfsrtton)
nfsd_rt(sotype, nd, cacherep);
m_freem(nd->nd_mrep);
- m_freem(nd->nd_nam2);
+ FREE(nd->nd_nam2, M_SONAME);
break;
};
if (nd) {
@@ -857,12 +858,12 @@ nfsrv_zapsock(slp)
soshutdown(so, 2);
closef(fp, (struct proc *)0);
if (slp->ns_nam)
- MFREE(slp->ns_nam, m);
+ FREE(slp->ns_nam, M_SONAME);
m_freem(slp->ns_raw);
while (rec = STAILQ_FIRST(&slp->ns_rec)) {
STAILQ_REMOVE_HEAD(&slp->ns_rec, nr_link);
if (rec->nr_address)
- m_freem(rec->nr_address);
+ FREE(rec->nr_address, M_SONAME);
m_freem(rec->nr_packet);
free(rec, M_NFSRVDESC);
}
@@ -872,7 +873,7 @@ nfsrv_zapsock(slp)
LIST_REMOVE(nuidp, nu_hash);
TAILQ_REMOVE(&slp->ns_uidlruhead, nuidp, nu_lru);
if (nuidp->nu_flag & NU_NAM)
- m_freem(nuidp->nu_nam);
+ FREE(nuidp->nu_nam, M_SONAME);
free((caddr_t)nuidp, M_NFSUID);
}
s = splsoftclock();
@@ -1182,8 +1183,8 @@ nfsd_rt(sotype, nd, cacherep)
else if (nd->nd_flag & ND_NFSV3)
rt->flag |= DRT_NFSV3;
rt->proc = nd->nd_procnum;
- if (mtod(nd->nd_nam, struct sockaddr *)->sa_family == AF_INET)
- rt->ipadr = mtod(nd->nd_nam, struct sockaddr_in *)->sin_addr.s_addr;
+ if (nd->nd_nam->sa_family == AF_INET)
+ rt->ipadr = ((struct sockaddr_in *)nd->nd_nam)->sin_addr.s_addr;
else
rt->ipadr = INADDR_ANY;
rt->resptime = ((time.tv_sec - nd->nd_starttime.tv_sec) * 1000000) +
diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h
index 528a366..e1a4755 100644
--- a/sys/nfsserver/nfsrvstats.h
+++ b/sys/nfsserver/nfsrvstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.28 1997/06/03 17:22:45 dfr Exp $
+ * $Id: nfs.h,v 1.29 1997/07/16 09:06:27 dfr Exp $
*/
#ifndef _NFS_NFS_H_
@@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
*/
union nethostaddr {
u_long had_inetaddr;
- struct mbuf *had_nam;
+ struct sockaddr *had_nam;
};
struct nfsuid {
@@ -406,7 +406,7 @@ struct nfsuid {
struct nfsrv_rec {
STAILQ_ENTRY(nfsrv_rec) nr_link;
- struct mbuf *nr_address;
+ struct sockaddr *nr_address;
struct mbuf *nr_packet;
};
@@ -415,7 +415,7 @@ struct nfssvc_sock {
TAILQ_HEAD(, nfsuid) ns_uidlruhead;
struct file *ns_fp;
struct socket *ns_so;
- struct mbuf *ns_nam;
+ struct sockaddr *ns_nam;
struct mbuf *ns_raw;
struct mbuf *ns_rawend;
STAILQ_HEAD(, nfsrv_rec) ns_rec;
@@ -480,8 +480,8 @@ struct nfsrv_descript {
struct mbuf *nd_mrep; /* Request mbuf list */
struct mbuf *nd_md; /* Current dissect mbuf */
struct mbuf *nd_mreq; /* Reply mbuf list */
- struct mbuf *nd_nam; /* and socket addr */
- struct mbuf *nd_nam2; /* return socket addr */
+ struct sockaddr *nd_nam; /* and socket addr */
+ struct sockaddr *nd_nam2; /* return socket addr */
caddr_t nd_dpos; /* Current dissect pos */
u_int32_t nd_procnum; /* RPC # */
int nd_stable; /* storage type */
@@ -567,70 +567,91 @@ extern int nfs_debug;
int nfs_init __P((struct vfsconf *vfsp));
int nfs_reply __P((struct nfsreq *));
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
-int nfs_send __P((struct socket *,struct mbuf *,struct mbuf *,struct nfsreq *));
-int nfs_rephead __P((int,struct nfsrv_descript *,struct nfssvc_sock *,int,int,u_quad_t *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_sndlock __P((int *,struct nfsreq *));
+int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
+ struct nfsreq *));
+int nfs_rephead __P((int, struct nfsrv_descript *, struct nfssvc_sock *,
+ int, int, u_quad_t *, struct mbuf **, struct mbuf **,
+ caddr_t *));
+int nfs_sndlock __P((int *, struct nfsreq *));
void nfs_sndunlock __P((int *flagp));
-int nfs_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-int nfs_vinvalbuf __P((struct vnode *,int,struct ucred *,struct proc *,int));
-int nfs_readrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_writerpc __P((struct vnode *,struct uio *,struct ucred *,int *,int *));
-int nfs_readdirrpc __P((register struct vnode *,struct uio *,struct ucred *));
-int nfs_asyncio __P((struct buf *,struct ucred *));
-int nfs_doio __P((struct buf *,struct ucred *,struct proc *));
-int nfs_readlinkrpc __P((struct vnode *,struct uio *,struct ucred *));
-int nfs_sigintr __P((struct nfsmount *,struct nfsreq *r,struct proc *));
-int nfs_readdirplusrpc __P((struct vnode *,register struct uio *,struct ucred *));
-int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *));
-void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *));
-void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **));
-void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **));
-int netaddr_match __P((int,union nethostaddr *,struct mbuf *));
-int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *));
-int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *));
-int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struct mbuf *,struct mbuf **,caddr_t *,struct vnode **,struct proc *,int,int));
-void nfsm_adj __P((struct mbuf *,int,int));
-int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *));
+int nfs_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
+int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
+ int));
+int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int *,
+ int *));
+int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_asyncio __P((struct buf *, struct ucred *));
+int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
+int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
+int nfs_readdirplusrpc __P((struct vnode *, struct uio *, struct ucred *));
+int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
+void nfsm_srvfattr __P((struct nfsrv_descript *, struct vattr *,
+ struct nfs_fattr *));
+void nfsm_srvwcc __P((struct nfsrv_descript *, int, struct vattr *, int,
+ struct vattr *, struct mbuf **, char **));
+void nfsm_srvpostopattr __P((struct nfsrv_descript *, int, struct vattr *,
+ struct mbuf **, char **));
+int netaddr_match __P((int, union nethostaddr *, struct sockaddr *));
+int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
+ struct ucred *, struct mbuf **, struct mbuf **,
+ caddr_t *));
+int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
+ struct vattr *));
+int nfs_namei __P((struct nameidata *, fhandle_t *, int,
+ struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
+ caddr_t *, struct vnode **, struct proc *, int, int));
+void nfsm_adj __P((struct mbuf *, int, int));
+int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
void nfsrv_initcache __P((void));
-int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T));
-int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int));
-int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *));
-int nfs_adv __P((struct mbuf **,caddr_t *,int,int));
+int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
+ char **, int *, char *, int *, NFSKERBKEY_T));
+int nfs_getnickauth __P((struct nfsmount *, struct ucred *, char **,
+ int *, char *, int));
+int nfs_savenickauth __P((struct nfsmount *, struct ucred *, int,
+ NFSKERBKEY_T, struct mbuf **, char **,
+ struct mbuf *));
+int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
void nfs_nhinit __P((void));
void nfs_timer __P((void*));
-u_long nfs_hash __P((nfsfh_t *,int));
-int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **));
-int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **));
-void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *));
+u_long nfs_hash __P((nfsfh_t *, int));
+int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *,
+ struct nfsrv_descript **));
+int nfsrv_getcache __P((struct nfsrv_descript *, struct nfssvc_sock *,
+ struct mbuf **));
+void nfsrv_updatecache __P((struct nfsrv_descript *, int, struct mbuf *));
void nfsrv_cleancache __P((void));
-int nfs_connect __P((struct nfsmount *,struct nfsreq *));
+int nfs_connect __P((struct nfsmount *, struct nfsreq *));
void nfs_disconnect __P((struct nfsmount *));
-int nfs_getattrcache __P((struct vnode *,struct vattr *));
-int nfsm_strtmbuf __P((struct mbuf **,char **,char *,long));
-int nfs_bioread __P((struct vnode *,struct uio *,int,struct ucred *, int getpages));
-int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *));
+int nfs_getattrcache __P((struct vnode *, struct vattr *));
+int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
+int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *,
+ int));
+int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
void nfsrv_init __P((int));
void nfs_clearcommit __P((struct mount *));
int nfsrv_errmap __P((struct nfsrv_descript *, int));
-void nfsrvw_sort __P((gid_t [],int));
-void nfsrv_setcred __P((struct ucred *,struct ucred *));
-int nfs_writebp __P((struct buf *,int));
-int nfsrv_object_create __P(( struct vnode * ));
+void nfsrvw_sort __P((gid_t *, int));
+void nfsrv_setcred __P((struct ucred *, struct ucred *));
+int nfs_writebp __P((struct buf *, int));
+int nfsrv_object_create __P((struct vnode *));
void nfsrv_wakenfsd __P((struct nfssvc_sock *slp));
int nfsrv_writegather __P((struct nfsrv_descript **, struct nfssvc_sock *,
struct proc *, struct mbuf **));
int nfs_fsinfo __P((struct nfsmount *, struct vnode *, struct ucred *,
struct proc *p));
-int nfsrv3_access __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv3_access __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,
- struct ucred *,struct nfssvc_sock *,struct mbuf *,
- int *,int,int));
+int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
+ struct nfssvc_sock *, struct sockaddr *, int *,
+ int, int));
int nfsrv_setpublicfs __P((struct mount *, struct netexport *,
struct export_args *));
int nfs_ispublicfh __P((fhandle_t *));
@@ -655,7 +676,8 @@ int nfsrv_pathconf __P((struct nfsrv_descript *nfsd,
struct mbuf **mrq));
int nfsrv_read __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_readdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_readdir __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_readdirplus __P((struct nfsrv_descript *nfsd,
struct nfssvc_sock *slp, struct proc *procp,
@@ -669,11 +691,14 @@ int nfsrv_rename __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_rmdir __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_setattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_setattr __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_statfs __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_statfs __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
-int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
+int nfsrv_symlink __P((struct nfsrv_descript *nfsd,
+ struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct proc *procp, struct mbuf **mrq));
OpenPOWER on IntegriCloud