summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-21 14:42:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-21 14:42:33 +0000
commit094850540557d7f50e6c053d237a3c69c52bb824 (patch)
tree2c6d685633ad4f04e655cd6e24c2d91910a128d2 /sys
parentb3d4450990731f9632e4ce31ac0d6a907638c76b (diff)
from cgd; handle 64-bit pointers and longs
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/krpc.h16
-rw-r--r--sys/nfs/krpc_subr.c26
-rw-r--r--sys/nfs/nfs.h12
-rw-r--r--sys/nfs/nfs_boot.c6
-rw-r--r--sys/nfs/nfs_node.c6
-rw-r--r--sys/nfs/nfs_nqlease.c42
-rw-r--r--sys/nfs/nfs_serv.c144
-rw-r--r--sys/nfs/nfs_socket.c100
-rw-r--r--sys/nfs/nfs_subs.c58
-rw-r--r--sys/nfs/nfs_syscalls.c10
-rw-r--r--sys/nfs/nfs_vfsops.c16
-rw-r--r--sys/nfs/nfs_vnops.c134
-rw-r--r--sys/nfs/nfsm_subs.h16
-rw-r--r--sys/nfs/nfsrtt.h4
-rw-r--r--sys/nfs/nfsrvcache.h10
-rw-r--r--sys/nfs/nfsv2.h86
-rw-r--r--sys/nfs/nqnfs.h16
-rw-r--r--sys/nfs/rpcv2.h8
-rw-r--r--sys/nfs/xdr_subs.h32
19 files changed, 372 insertions, 370 deletions
diff --git a/sys/nfs/krpc.h b/sys/nfs/krpc.h
index 32ed3b8e302..dbd251b825d 100644
--- a/sys/nfs/krpc.h
+++ b/sys/nfs/krpc.h
@@ -1,18 +1,18 @@
-/* $NetBSD: krpc.h,v 1.3 1995/04/24 21:54:56 gwr Exp $ */
+/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */
#include <sys/cdefs.h>
-int krpc_call __P((struct sockaddr_in *sin, \
- u_int prog, u_int vers, u_int func, \
+int krpc_call __P((struct sockaddr_in *sin,
+ u_int prog, u_int vers, u_int func,
struct mbuf **data, struct mbuf **from));
-int krpc_portmap __P((struct sockaddr_in *sin, \
+int krpc_portmap __P((struct sockaddr_in *sin,
u_int prog, u_int vers, u_int16_t *portp));
-struct mbuf * xdr_string_encode __P((char *str, int len));
-struct mbuf * xdr_string_decode __P((struct mbuf *m, char *str, int *len_p));
-struct mbuf * xdr_inaddr_encode __P((struct in_addr *ia));
-struct mbuf * xdr_inaddr_decode __P((struct mbuf *m, struct in_addr *ia));
+struct mbuf *xdr_string_encode __P((char *str, int len));
+struct mbuf *xdr_string_decode __P((struct mbuf *m, char *str, int *len_p));
+struct mbuf *xdr_inaddr_encode __P((struct in_addr *ia));
+struct mbuf *xdr_inaddr_decode __P((struct mbuf *m, struct in_addr *ia));
/*
diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c
index a59b5fa0c9a..b321ee44a46 100644
--- a/sys/nfs/krpc_subr.c
+++ b/sys/nfs/krpc_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ */
+/* $NetBSD: krpc_subr.c,v 1.11 1995/12/19 23:07:19 cgd Exp $ */
/*
* Copyright (c) 1995 Gordon Ross, Adam Glass
@@ -96,11 +96,11 @@ struct rpc_call {
};
struct rpc_reply {
- u_int32_t rp_xid; /* request transaction id */
- int32_t rp_direction; /* call direction (1) */
- int32_t rp_astatus; /* accept status (0: accepted) */
+ u_int32_t rp_xid; /* request transaction id */
+ int32_t rp_direction; /* call direction (1) */
+ int32_t rp_astatus; /* accept status (0: accepted) */
union {
- u_int32_t rpu_errno;
+ u_int32_t rpu_errno;
struct {
struct auth_info rok_auth;
u_int32_t rok_status;
@@ -129,13 +129,13 @@ int
krpc_portmap(sin, prog, vers, portp)
struct sockaddr_in *sin; /* server address */
u_int prog, vers; /* host order */
- u_int16_t *portp; /* network order */
+ u_int16_t *portp; /* network order */
{
struct sdata {
- u_int32_t prog; /* call program */
- u_int32_t vers; /* call version */
- u_int32_t proto; /* call protocol */
- u_int32_t port; /* call port (unused) */
+ u_int32_t prog; /* call program */
+ u_int32_t vers; /* call version */
+ u_int32_t proto; /* call protocol */
+ u_int32_t port; /* call port (unused) */
} *sdata;
struct rdata {
u_int16_t pad;
@@ -200,7 +200,7 @@ krpc_call(sa, prog, vers, func, data, from_p)
struct uio auio;
int error, rcvflg, timo, secs, len;
static u_int32_t xid = ~0xFF;
- u_int tport;
+ u_int16_t tport;
/*
* Validate address family.
@@ -237,13 +237,13 @@ krpc_call(sa, prog, vers, func, data, from_p)
* Enable broadcast if necessary.
*/
if (from_p) {
- int *on;
+ int32_t *on;
m = m_get(M_WAIT, MT_SOOPTS);
if (m == NULL) {
error = ENOBUFS;
goto out;
}
- on = mtod(m, int *);
+ on = mtod(m, int32_t *);
m->m_len = sizeof(*on);
*on = 1;
if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m)))
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h
index f8f65bb0d09..101f3047037 100644
--- a/sys/nfs/nfs.h
+++ b/sys/nfs/nfs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs.h,v 1.8 1995/03/26 20:37:29 jtc Exp $ */
+/* $NetBSD: nfs.h,v 1.9 1995/12/19 23:07:21 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -86,7 +86,7 @@ struct nfsd_args {
struct nfsd_srvargs {
struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
uid_t nsd_uid; /* Effective uid mapped to cred */
- u_long nsd_haddr; /* Ip address of client */
+ u_int32_t nsd_haddr; /* Ip address of client */
struct ucred nsd_cr; /* Cred. uid maps to */
int nsd_authlen; /* Length of auth string (ret) */
char *nsd_authstr; /* Auth string (ret) */
@@ -180,7 +180,7 @@ struct nfsreq {
caddr_t r_dpos;
struct nfsmount *r_nmp;
struct vnode *r_vp;
- u_long r_xid;
+ u_int32_t r_xid;
int r_flags; /* flags on request, see below */
int r_retry; /* max retransmission count */
int r_rexmit; /* current retrans count */
@@ -221,7 +221,7 @@ struct nfsstats nfsstats;
* Network address hash list element
*/
union nethostaddr {
- u_long had_inetaddr;
+ u_int32_t had_inetaddr;
struct mbuf *had_nam;
};
@@ -246,7 +246,7 @@ struct nfssvc_sock {
u_long ns_uidhash;
int ns_flag;
- u_long ns_sref;
+ u_int32_t ns_sref;
struct file *ns_fp;
struct socket *ns_so;
int ns_solock;
@@ -285,7 +285,7 @@ struct nfsd {
struct mbuf *nd_md;
caddr_t nd_dpos; /* Position in list */
int nd_procnum; /* RPC procedure number */
- u_long nd_retxid; /* RPC xid */
+ u_int32_t nd_retxid; /* RPC xid */
int nd_repstat; /* Reply status value */
struct ucred nd_cr; /* Credentials for req. */
int nd_nqlflag; /* Leasing flag */
diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c
index 06514ce9d22..6e961f18114 100644
--- a/sys/nfs/nfs_boot.c
+++ b/sys/nfs/nfs_boot.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_boot.c,v 1.19 1995/06/12 00:48:31 mycroft Exp $ */
+/* $NetBSD: nfs_boot.c,v 1.20 1995/12/19 23:07:24 cgd Exp $ */
/*
* Copyright (c) 1995 Adam Glass, Gordon Ross
@@ -490,8 +490,8 @@ md_mount(mdsin, path, fhp)
{
/* The RPC structures */
struct rdata {
- u_int32_t errno;
- u_char fh[NFS_FHSIZE];
+ u_int32_t errno;
+ u_int8_t fh[NFS_FHSIZE];
} *rdata;
struct mbuf *m;
int error;
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index 8007dfd9e84..70642f153ca 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_node.c,v 1.13 1994/08/18 22:47:46 mycroft Exp $ */
+/* $NetBSD: nfs_node.c,v 1.14 1995/12/19 23:07:27 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -69,10 +69,6 @@ u_long nfsnodehash;
nfs_nhinit()
{
-#ifndef lint
- if ((sizeof(struct nfsnode) - 1) & sizeof(struct nfsnode))
- printf("nfs_nhinit: bad size %d\n", sizeof(struct nfsnode));
-#endif /* not lint */
nfsnodehashtbl = hashinit(desiredvnodes, M_NFSNODE, &nfsnodehash);
}
diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c
index 29437a9e987..66106f6cfa2 100644
--- a/sys/nfs/nfs_nqlease.c
+++ b/sys/nfs/nfs_nqlease.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_nqlease.c,v 1.10 1995/06/18 14:48:01 cgd Exp $ */
+/* $NetBSD: nfs_nqlease.c,v 1.11 1995/12/19 23:07:29 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -76,7 +76,7 @@
#include <nfs/nfsmount.h>
time_t nqnfsstarttime = (time_t)0;
-u_long nqnfs_prog, nqnfs_vers;
+u_int32_t nqnfs_prog, nqnfs_vers;
int nqsrv_clockskew = NQ_CLOCKSKEW;
int nqsrv_writeslack = NQ_WRITESLACK;
int nqsrv_maxlease = NQ_MAXLEASE;
@@ -148,7 +148,7 @@ extern int nfsd_waiting;
*/
nqsrv_getlease(vp, duration, flags, nd, nam, cachablep, frev, cred)
struct vnode *vp;
- u_long *duration;
+ u_int *duration;
int flags;
struct nfsd *nd;
struct mbuf *nam;
@@ -190,7 +190,7 @@ nqsrv_getlease(vp, duration, flags, nd, nam, cachablep, frev, cred)
if (fh.fh_fsid.val[0] == lp->lc_fsid.val[0] &&
fh.fh_fsid.val[1] == lp->lc_fsid.val[1] &&
!bcmp(fh.fh_fid.fid_data, lp->lc_fiddata,
- fh.fh_fid.fid_len - sizeof (long))) {
+ fh.fh_fid.fid_len - sizeof (int32_t))) {
/* Found it */
lp->lc_vp = vp;
vp->v_lease = lp;
@@ -288,7 +288,7 @@ doreply:
lp->lc_vp = vp;
lp->lc_fsid = fh.fh_fsid;
bcopy(fh.fh_fid.fid_data, lp->lc_fiddata,
- fh.fh_fid.fid_len - sizeof (long));
+ fh.fh_fid.fid_len - sizeof (int32_t));
LIST_INSERT_HEAD(lpp, lp, lc_hash);
vp->v_lease = lp;
s = splsoftclock();
@@ -446,7 +446,7 @@ nqsrv_send_eviction(vp, lp, slp, nam, cred)
struct sockaddr_in *saddr;
fhandle_t *fhp;
caddr_t bpos, cp;
- u_long xid;
+ u_int32_t xid;
int len = 1, ok = 1, i = 0;
int sotype, *solockp;
@@ -502,7 +502,7 @@ nqsrv_send_eviction(vp, lp, slp, nam, cred)
*/
if (sotype == SOCK_STREAM) {
M_PREPEND(m, NFSX_UNSIGNED, M_WAIT);
- *mtod(m, u_long *) = htonl(0x80000000 |
+ *mtod(m, u_int32_t *) = htonl(0x80000000 |
(m->m_pkthdr.len - NFSX_UNSIGNED));
}
if (((lph->lph_flag & (LC_UDP | LC_CLTP)) == 0 &&
@@ -680,8 +680,8 @@ nqnfsrv_getlease(nfsd, mrep, md, dpos, cred, nam, mrq)
struct vnode *vp;
nfsv2fh_t nfh;
fhandle_t *fhp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
u_quad_t frev;
caddr_t bpos;
int error = 0;
@@ -691,7 +691,7 @@ nqnfsrv_getlease(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
- nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);
flags = fxdr_unsigned(int, *tl++);
nfsd->nd_duration = fxdr_unsigned(int, *tl);
if (error = nfsrv_fhtovp(fhp,
@@ -706,7 +706,7 @@ nqnfsrv_getlease(nfsd, mrep, md, dpos, cred, nam, mrq)
error = VOP_GETATTR(vp, &va, cred, nfsd->nd_procp);
vput(vp);
nfsm_reply(NFSX_NQFATTR + 4*NFSX_UNSIGNED);
- nfsm_build(tl, u_long *, 4*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 4*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(cache);
*tl++ = txdr_unsigned(nfsd->nd_duration);
txdr_hyper(&frev, tl);
@@ -731,8 +731,8 @@ nqnfsrv_vacated(nfsd, mrep, md, dpos, cred, nam, mrq)
struct nqlease *tlp = (struct nqlease *)0;
nfsv2fh_t nfh;
fhandle_t *fhp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
struct nqm *lphnext;
int error = 0, i, len, ok, gotit = 0;
char *cp2;
@@ -798,9 +798,9 @@ nqnfs_getlease(vp, rwflag, cred, p)
struct ucred *cred;
struct proc *p;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
register struct nfsnode *np;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
caddr_t bpos, dpos, cp2;
@@ -814,13 +814,13 @@ nqnfs_getlease(vp, rwflag, cred, p)
mb = mreq = nfsm_reqh(vp, NQNFSPROC_GETLEASE, NFSX_FH+2*NFSX_UNSIGNED,
&bpos);
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(rwflag);
*tl = txdr_unsigned(nmp->nm_leaseterm);
reqtime = time.tv_sec;
nfsm_request(vp, NQNFSPROC_GETLEASE, p, cred);
np = VTONFS(vp);
- nfsm_dissect(tl, u_long *, 4*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 4*NFSX_UNSIGNED);
cachable = fxdr_unsigned(int, *tl++);
reqtime += fxdr_unsigned(int, *tl++);
if (reqtime > time.tv_sec) {
@@ -844,7 +844,7 @@ nqnfs_vacated(vp, cred)
register struct mbuf *m;
register int i;
caddr_t bpos;
- u_long xid;
+ u_int32_t xid;
int error = 0;
struct mbuf *mreq, *mb, *mb2, *mheadend;
struct nfsmount *nmp;
@@ -865,7 +865,7 @@ nqnfs_vacated(vp, cred)
mreq, i, &mheadend, &xid);
if (nmp->nm_sotype == SOCK_STREAM) {
M_PREPEND(m, NFSX_UNSIGNED, M_WAIT);
- *mtod(m, u_long *) = htonl(0x80000000 | (m->m_pkthdr.len -
+ *mtod(m, u_int32_t *) = htonl(0x80000000 | (m->m_pkthdr.len -
NFSX_UNSIGNED));
}
myrep.r_flags = 0;
@@ -887,8 +887,8 @@ nqnfs_callback(nmp, mrep, md, dpos)
caddr_t dpos;
{
register struct vnode *vp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
nfsv2fh_t nfh;
fhandle_t *fhp;
struct nfsnode *np;
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 44daa8a30b7..c7b6b15d728 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_serv.c,v 1.18 1995/05/23 06:22:47 mycroft Exp $ */
+/* $NetBSD: nfs_serv.c,v 1.19 1995/12/19 23:07:32 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -82,8 +82,8 @@
/* Global vars */
extern u_long nfs_procids[NFS_NPROCS];
-extern u_long nfs_xdrneg1;
-extern u_long nfs_false, nfs_true;
+extern u_int32_t nfs_xdrneg1;
+extern u_int32_t nfs_false, nfs_true;
nfstype nfs_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
NFCHR, NFNON };
@@ -100,8 +100,8 @@ nqnfsrv_access(nfsd, mrep, md, dpos, cred, nam, mrq)
struct vnode *vp;
nfsv2fh_t nfh;
fhandle_t *fhp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, mode = 0;
char *cp2;
@@ -110,7 +110,7 @@ nqnfsrv_access(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
- nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
if (error = nfsrv_fhtovp(fhp, TRUE, &vp, cred, nfsd->nd_slp, nam, &rdonly))
nfsm_reply(0);
if (*tl++ == nfs_true)
@@ -140,8 +140,8 @@ nfsrv_getattr(nfsd, mrep, md, dpos, cred, nam, mrq)
struct vnode *vp;
nfsv2fh_t nfh;
fhandle_t *fhp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache;
char *cp2;
@@ -177,8 +177,8 @@ nfsrv_setattr(nfsd, mrep, md, dpos, cred, nam, mrq)
struct vnode *vp;
nfsv2fh_t nfh;
fhandle_t *fhp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache;
char *cp2;
@@ -213,7 +213,7 @@ nfsrv_setattr(nfsd, mrep, md, dpos, cred, nam, mrq)
fxdr_nfstime(&sp->sa_nfsatime, &va.va_atime);
#else
va.va_atime.ts_sec =
- fxdr_unsigned(long, sp->sa_nfsatime.nfs_sec);
+ fxdr_unsigned(int32_t, sp->sa_nfsatime.nfs_sec);
va.va_atime.ts_nsec = 0;
#endif
}
@@ -223,7 +223,7 @@ nfsrv_setattr(nfsd, mrep, md, dpos, cred, nam, mrq)
fxdr_hyper(&sp->sa_nqsize, &va.va_size);
fxdr_nqtime(&sp->sa_nqatime, &va.va_atime);
fxdr_nqtime(&sp->sa_nqmtime, &va.va_mtime);
- va.va_flags = fxdr_unsigned(u_long, sp->sa_nqflags);
+ va.va_flags = fxdr_unsigned(u_int32_t, sp->sa_nqflags);
}
/*
@@ -254,7 +254,7 @@ out:
nfsm_build(fp, struct nfsv2_fattr *, NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL));
nfsm_srvfillattr;
if (nfsd->nd_nqlflag != NQL_NOVAL) {
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
txdr_hyper(&frev2, tl);
}
nfsm_srvdone;
@@ -276,8 +276,8 @@ nfsrv_lookup(nfsd, mrep, md, dpos, cred, nam, mrq)
nfsv2fh_t nfh;
fhandle_t *fhp;
register caddr_t cp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, cache, duration2, cache2, len;
char *cp2;
@@ -288,7 +288,7 @@ nfsrv_lookup(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
duration2 = 0;
if (nfsd->nd_nqlflag != NQL_NOVAL) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
duration2 = fxdr_unsigned(int, *tl);
}
nfsm_srvmtofh(fhp);
@@ -317,13 +317,13 @@ nfsrv_lookup(nfsd, mrep, md, dpos, cred, nam, mrq)
nfsm_reply(NFSX_FH + NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL) + 5*NFSX_UNSIGNED);
if (nfsd->nd_nqlflag != NQL_NOVAL) {
if (duration2) {
- nfsm_build(tl, u_long *, 5*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 5*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NQL_READ);
*tl++ = txdr_unsigned(cache2);
*tl++ = txdr_unsigned(duration2);
txdr_hyper(&frev2, tl);
} else {
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@@ -346,8 +346,8 @@ nfsrv_readlink(nfsd, mrep, md, dpos, cred, nam, mrq)
struct iovec iv[(NFS_MAXPATHLEN+MLEN-1)/MLEN];
register struct iovec *ivp = iv;
register struct mbuf *mp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, i, tlen, len;
char *cp2;
@@ -409,7 +409,7 @@ out:
tlen = nfsm_rndup(len);
nfsm_adj(mp3, NFS_MAXPATHLEN-tlen, tlen-len);
}
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(len);
mb->m_next = mp3;
nfsm_srvdone;
@@ -429,8 +429,8 @@ nfsrv_read(nfsd, mrep, md, dpos, cred, nam, mrq)
struct iovec *iv2;
register struct mbuf *m;
register struct nfsv2_fattr *fp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, i, cnt, len, left, siz, tlen;
char *cp2;
@@ -447,10 +447,10 @@ nfsrv_read(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (nfsd->nd_nqlflag == NQL_NOVAL) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
- off = (off_t)fxdr_unsigned(u_long, *tl);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
+ off = (off_t)fxdr_unsigned(u_int32_t, *tl);
} else {
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
fxdr_hyper(tl, &off);
}
nfsm_srvstrsiz(cnt, NFS_MAXDATA);
@@ -477,7 +477,7 @@ nfsrv_read(nfsd, mrep, md, dpos, cred, nam, mrq)
cnt = nfsm_rndup(va.va_size - off);
nfsm_reply(NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL)+NFSX_UNSIGNED+nfsm_rndup(cnt));
nfsm_build(fp, struct nfsv2_fattr *, NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL));
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
len = left = cnt;
if (cnt > 0) {
/*
@@ -549,8 +549,8 @@ nfsrv_write(nfsd, mrep, md, dpos, cred, nam, mrq)
register struct nfsv2_fattr *fp;
struct iovec iv[NFS_MAXIOVEC];
struct vattr va;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, siz, len, xfer;
int ioflags = IO_SYNC | IO_NODELOCKED;
@@ -565,17 +565,17 @@ nfsrv_write(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
- nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
if (nfsd->nd_nqlflag == NQL_NOVAL) {
- off = (off_t)fxdr_unsigned(u_long, *++tl);
+ off = (off_t)fxdr_unsigned(u_int32_t, *++tl);
tl += 2;
} else {
fxdr_hyper(tl, &off);
tl += 2;
- if (fxdr_unsigned(u_long, *tl++))
+ if (fxdr_unsigned(u_int32_t, *tl++))
ioflags |= IO_APPEND;
}
- len = fxdr_unsigned(long, *tl);
+ len = fxdr_unsigned(int32_t, *tl);
if (len > NFS_MAXDATA || len <= 0) {
error = EBADRPC;
nfsm_reply(0);
@@ -655,7 +655,7 @@ nfsrv_write(nfsd, mrep, md, dpos, cred, nam, mrq)
nfsm_build(fp, struct nfsv2_fattr *, NFSX_FATTR(nfsd->nd_nqlflag != NQL_NOVAL));
nfsm_srvfillattr;
if (nfsd->nd_nqlflag != NQL_NOVAL) {
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
txdr_hyper(&va.va_filerev, tl);
}
nfsm_srvdone;
@@ -675,10 +675,10 @@ nfsrv_create(nfsd, mrep, md, dpos, cred, nam, mrq)
register struct nfsv2_fattr *fp;
struct vattr va;
register struct nfsv2_sattr *sp;
- register u_long *tl;
+ register u_int32_t *tl;
struct nameidata nd;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdev, cache, len, tsize;
char *cp2;
@@ -706,14 +706,14 @@ nfsrv_create(nfsd, mrep, md, dpos, cred, nam, mrq)
* should I set the mode too ??
*/
if (nd.ni_vp == NULL) {
- va.va_type = IFTOVT(fxdr_unsigned(u_long, sp->sa_mode));
+ va.va_type = IFTOVT(fxdr_unsigned(u_int32_t, sp->sa_mode));
if (va.va_type == VNON)
va.va_type = VREG;
va.va_mode = nfstov_mode(sp->sa_mode);
if (nfsd->nd_nqlflag == NQL_NOVAL)
- rdev = fxdr_unsigned(long, sp->sa_nfssize);
+ rdev = fxdr_unsigned(int32_t, sp->sa_nfssize);
else
- rdev = fxdr_unsigned(long, sp->sa_nqrdev);
+ rdev = fxdr_unsigned(int32_t, sp->sa_nqrdev);
if (va.va_type == VREG || va.va_type == VSOCK) {
vrele(nd.ni_startdir);
nqsrv_getl(nd.ni_dvp, NQL_WRITE);
@@ -775,7 +775,7 @@ nfsrv_create(nfsd, mrep, md, dpos, cred, nam, mrq)
vput(nd.ni_dvp);
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
if (nfsd->nd_nqlflag == NQL_NOVAL) {
- tsize = fxdr_unsigned(long, sp->sa_nfssize);
+ tsize = fxdr_unsigned(int32_t, sp->sa_nfssize);
if (tsize != -1)
va.va_size = (u_quad_t)tsize;
else
@@ -837,8 +837,8 @@ nfsrv_remove(nfsd, mrep, md, dpos, cred, nam, mrq)
struct mbuf *nam, **mrq;
{
struct nameidata nd;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, cache, len;
char *cp2;
@@ -897,8 +897,8 @@ nfsrv_rename(nfsd, mrep, md, dpos, cred, nam, mrq)
struct ucred *cred;
struct mbuf *nam, **mrq;
{
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, cache, len, len2;
char *cp2;
@@ -1030,8 +1030,8 @@ nfsrv_link(nfsd, mrep, md, dpos, cred, nam, mrq)
struct mbuf *nam, **mrq;
{
struct nameidata nd;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, len;
char *cp2;
@@ -1096,8 +1096,8 @@ nfsrv_symlink(nfsd, mrep, md, dpos, cred, nam, mrq)
{
struct vattr va;
struct nameidata nd;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
struct nfsv2_sattr *sp;
caddr_t bpos;
struct uio io;
@@ -1144,7 +1144,7 @@ nfsrv_symlink(nfsd, mrep, md, dpos, cred, nam, mrq)
goto out;
}
VATTR_NULL(&va);
- va.va_mode = fxdr_unsigned(u_short, sp->sa_mode);
+ va.va_mode = fxdr_unsigned(u_int16_t, sp->sa_mode);
nqsrv_getl(nd.ni_dvp, NQL_WRITE);
error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &va, pathcp);
out:
@@ -1179,8 +1179,8 @@ nfsrv_mkdir(nfsd, mrep, md, dpos, cred, nam, mrq)
register struct nfsv2_fattr *fp;
struct nameidata nd;
register caddr_t cp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, cache, len;
char *cp2;
@@ -1199,7 +1199,7 @@ nfsrv_mkdir(nfsd, mrep, md, dpos, cred, nam, mrq)
if (error = nfs_namei(&nd, fhp, len, nfsd->nd_slp, nam, &md, &dpos,
nfsd->nd_procp))
nfsm_reply(0);
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
VATTR_NULL(&va);
va.va_type = VDIR;
va.va_mode = nfstov_mode(*tl++);
@@ -1252,8 +1252,8 @@ nfsrv_rmdir(nfsd, mrep, md, dpos, cred, nam, mrq)
struct ucred *cred;
struct mbuf *nam, **mrq;
{
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, cache, len;
char *cp2;
@@ -1337,11 +1337,11 @@ out:
* "entry" structures, but are in the rpc.
*/
struct flrep {
- u_long fl_cachable;
- u_long fl_duration;
- u_long fl_frev[2];
+ u_int32_t fl_cachable;
+ u_int32_t fl_duration;
+ u_int32_t fl_frev[2];
nfsv2fh_t fl_nfh;
- u_long fl_fattr[NFSX_NQFATTR / sizeof (u_long)];
+ u_int32_t fl_fattr[NFSX_NQFATTR / sizeof (u_int32_t)];
};
nfsrv_readdir(nfsd, mrep, md, dpos, cred, nam, mrq)
@@ -1355,8 +1355,8 @@ nfsrv_readdir(nfsd, mrep, md, dpos, cred, nam, mrq)
register struct mbuf *mp;
register struct dirent *dp;
register caddr_t cp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
struct mbuf *mb, *mb2, *mreq, *mp2;
char *cpos, *cend, *cp2, *rbuf;
@@ -1373,8 +1373,8 @@ nfsrv_readdir(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
- nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
- off = fxdr_unsigned(u_long, *tl++);
+ nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);
+ off = fxdr_unsigned(u_int32_t, *tl++);
cnt = fxdr_unsigned(int, *tl);
siz = ((cnt+NFS_DIRBLKSIZ-1) & ~(NFS_DIRBLKSIZ-1));
if (cnt > NFS_MAXREADDIR)
@@ -1421,7 +1421,7 @@ again:
if (siz == 0) {
vrele(vp);
nfsm_reply(2*NFSX_UNSIGNED);
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = nfs_false;
*tl = nfs_true;
FREE((caddr_t)cookiebuf, M_TEMP);
@@ -1494,7 +1494,7 @@ again:
if (xfer > 0)
cp += tsiz;
}
- /* And null pad to a long boundary */
+ /* And null pad to a int32_t boundary */
for (i = 0; i < rem; i++)
*bp++ = '\0';
nfsm_clget;
@@ -1538,8 +1538,8 @@ nqnfsrv_readdirlook(nfsd, mrep, md, dpos, cred, nam, mrq)
register struct mbuf *mp;
register struct dirent *dp;
register caddr_t cp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
struct mbuf *mb, *mb2, *mreq, *mp2;
char *cpos, *cend, *cp2, *rbuf;
@@ -1559,8 +1559,8 @@ nqnfsrv_readdirlook(nfsd, mrep, md, dpos, cred, nam, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
- nfsm_dissect(tl, u_long *, 3*NFSX_UNSIGNED);
- off = fxdr_unsigned(u_long, *tl++);
+ nfsm_dissect(tl, u_int32_t *, 3*NFSX_UNSIGNED);
+ off = fxdr_unsigned(u_int32_t, *tl++);
cnt = fxdr_unsigned(int, *tl++);
duration2 = fxdr_unsigned(int, *tl);
siz = ((cnt+NFS_DIRBLKSIZ-1) & ~(NFS_DIRBLKSIZ-1));
@@ -1608,7 +1608,7 @@ again:
if (siz == 0) {
vrele(vp);
nfsm_reply(2 * NFSX_UNSIGNED);
- nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
*tl = nfs_true;
FREE((caddr_t)cookiebuf, M_TEMP);
@@ -1729,7 +1729,7 @@ again:
if (xfer > 0)
cp += tsiz;
}
- /* And null pad to a long boundary */
+ /* And null pad to a int32_t boundary */
for (i = 0; i < rem; i++)
*bp++ = '\0';
nfsm_clget;
@@ -1775,8 +1775,8 @@ nfsrv_statfs(nfsd, mrep, md, dpos, cred, nam, mrq)
{
register struct statfs *sf;
register struct nfsv2_statfs *sfp;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, isnq;
char *cp2;
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 6479d493d44..909da6378d3 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_socket.c,v 1.21 1995/08/13 00:00:01 mycroft Exp $ */
+/* $NetBSD: nfs_socket.c,v 1.22 1995/12/19 23:07:38 cgd Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@@ -93,10 +93,10 @@
/*
* External data, mostly RPC constants in XDR form
*/
-extern u_long rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers, rpc_auth_unix,
- rpc_msgaccepted, rpc_call, rpc_autherr, rpc_rejectedcred,
+extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers,
+ rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr, rpc_rejectedcred,
rpc_auth_kerb;
-extern u_long nfs_prog, nfs_vers, nqnfs_prog, nqnfs_vers;
+extern u_int32_t nfs_prog, nfs_vers, nqnfs_prog, nqnfs_vers;
extern time_t nqnfsstarttime;
extern int nonidempotent[NFS_NPROCS];
@@ -173,7 +173,7 @@ nfs_connect(nmp, rep)
struct sockaddr *saddr;
struct sockaddr_in *sin;
struct mbuf *m;
- u_short tport;
+ u_int16_t tport;
nmp->nm_so = (struct socket *)0;
saddr = mtod(nmp->nm_nam, struct sockaddr *);
@@ -258,20 +258,20 @@ nfs_connect(nmp, rep)
panic("nfscon sotype");
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int *) = 1;
- m->m_len = sizeof(int);
+ *mtod(m, int32_t *) = 1;
+ m->m_len = sizeof(int32_t);
sosetopt(so, SOL_SOCKET, SO_KEEPALIVE, m);
}
if (so->so_proto->pr_protocol == IPPROTO_TCP) {
MGET(m, M_WAIT, MT_SOOPTS);
- *mtod(m, int *) = 1;
- m->m_len = sizeof(int);
+ *mtod(m, int32_t *) = 1;
+ m->m_len = sizeof(int32_t);
sosetopt(so, IPPROTO_TCP, TCP_NODELAY, m);
}
- sndreserve = (nmp->nm_wsize + NFS_MAXPKTHDR + sizeof (u_long))
- * 2;
- rcvreserve = (nmp->nm_rsize + NFS_MAXPKTHDR + sizeof (u_long))
- * 2;
+ sndreserve = (nmp->nm_wsize + NFS_MAXPKTHDR +
+ sizeof (u_int32_t)) * 2;
+ rcvreserve = (nmp->nm_rsize + NFS_MAXPKTHDR +
+ sizeof (u_int32_t)) * 2;
}
if (error = soreserve(so, sndreserve, rcvreserve))
goto bad;
@@ -435,7 +435,7 @@ nfs_receive(rep, aname, mp)
struct iovec aio;
register struct mbuf *m;
struct mbuf *control;
- u_long len;
+ u_int32_t len;
struct mbuf **getnam;
int error, sotype, rcvflg;
struct proc *p = curproc; /* XXX */
@@ -494,13 +494,13 @@ tryagain:
nfs_sndunlock(&rep->r_nmp->nm_flag);
if (sotype == SOCK_STREAM) {
aio.iov_base = (caddr_t) &len;
- aio.iov_len = sizeof(u_long);
+ aio.iov_len = sizeof(u_int32_t);
auio.uio_iov = &aio;
auio.uio_iovcnt = 1;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_offset = 0;
- auio.uio_resid = sizeof(u_long);
+ auio.uio_resid = sizeof(u_int32_t);
auio.uio_procp = p;
do {
rcvflg = MSG_WAITALL;
@@ -514,8 +514,8 @@ tryagain:
if (!error && auio.uio_resid > 0) {
log(LOG_INFO,
"short receive (%d/%d) from nfs server %s\n",
- sizeof(u_long) - auio.uio_resid,
- sizeof(u_long),
+ sizeof(u_int32_t) - auio.uio_resid,
+ sizeof(u_int32_t),
rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
error = EPIPE;
}
@@ -636,9 +636,9 @@ nfs_reply(myrep)
{
register struct nfsreq *rep;
register struct nfsmount *nmp = myrep->r_nmp;
- register long t1;
+ register int32_t t1;
struct mbuf *mrep, *nam, *md;
- u_long rxid, *tl;
+ u_int32_t rxid, *tl;
caddr_t dpos, cp2;
int error;
@@ -685,7 +685,7 @@ nfs_reply(myrep)
*/
md = mrep;
dpos = mtod(md, caddr_t);
- nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);
rxid = *tl++;
if (*tl != rpc_reply) {
if (nmp->nm_flag & NFSMNT_NQNFS) {
@@ -808,7 +808,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
{
register struct mbuf *m, *mrep;
register struct nfsreq *rep;
- register u_long *tl;
+ register u_int32_t *tl;
register int i;
struct nfsmount *nmp;
struct mbuf *md, *mheadend;
@@ -818,7 +818,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
caddr_t dpos, cp2;
int t1, nqlflag, cachable, s, error = 0, mrest_len, auth_len, auth_type;
int trylater_delay = NQ_TRYLATERDEL, trylater_cnt = 0, failed_auth = 0;
- u_long xid;
+ u_int32_t xid;
u_quad_t frev;
char *auth_str;
@@ -870,7 +870,7 @@ kerbauth:
*/
if (nmp->nm_sotype == SOCK_STREAM) {
M_PREPEND(m, NFSX_UNSIGNED, M_WAIT);
- *mtod(m, u_long *) = htonl(0x80000000 |
+ *mtod(m, u_int32_t *) = htonl(0x80000000 |
(m->m_pkthdr.len - NFSX_UNSIGNED));
}
rep->r_mreq = m;
@@ -967,7 +967,7 @@ tryagain:
/*
* break down the rpc header and check if ok
*/
- nfsm_dissect(tl, u_long *, 3*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 3*NFSX_UNSIGNED);
if (*tl++ == rpc_msgdenied) {
if (*tl == rpc_mismatch)
error = EOPNOTSUPP;
@@ -993,13 +993,13 @@ tryagain:
* for nfs_reqhead(), but for now just dump it
*/
if (*++tl != 0) {
- i = nfsm_rndup(fxdr_unsigned(long, *tl));
+ i = nfsm_rndup(fxdr_unsigned(int32_t, *tl));
nfsm_adv(i);
}
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
/* 0 == ok */
if (*tl == 0) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
if (*tl != 0) {
error = fxdr_unsigned(int, *tl);
m_freem(mrep);
@@ -1031,11 +1031,11 @@ tryagain:
* For nqnfs, get any lease in reply
*/
if (nmp->nm_flag & NFSMNT_NQNFS) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
if (*tl) {
np = VTONFS(vp);
nqlflag = fxdr_unsigned(int, *tl);
- nfsm_dissect(tl, u_long *, 4*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 4*NFSX_UNSIGNED);
cachable = fxdr_unsigned(int, *tl++);
reqtime += fxdr_unsigned(int, *tl++);
if (reqtime > time.tv_sec) {
@@ -1075,7 +1075,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
struct mbuf **mbp;
caddr_t *bposp;
{
- register u_long *tl;
+ register u_int32_t *tl;
register struct mbuf *mreq;
caddr_t bpos;
struct mbuf *mb, *mb2;
@@ -1091,7 +1091,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
MCLGET(mreq, M_WAIT);
} else
mreq->m_data += max_hdr;
- tl = mtod(mreq, u_long *);
+ tl = mtod(mreq, u_int32_t *);
mreq->m_len = 6*NFSX_UNSIGNED;
bpos = ((caddr_t)tl)+mreq->m_len;
*tl++ = txdr_unsigned(nd->nd_retxid);
@@ -1118,7 +1118,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
break;
case EPROGMISMATCH:
*tl = txdr_unsigned(RPC_PROGMISMATCH);
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(2);
*tl = txdr_unsigned(2); /* someday 3 */
break;
@@ -1128,7 +1128,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
default:
*tl = 0;
if (err != VNOVAL) {
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap[err - 1]);
else
@@ -1143,7 +1143,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
*/
if (nd->nd_nqlflag != NQL_NOVAL && err == 0) {
if (nd->nd_nqlflag) {
- nfsm_build(tl, u_long *, 5*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 5*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nd->nd_nqlflag);
*tl++ = txdr_unsigned(cache);
*tl++ = txdr_unsigned(nd->nd_duration);
@@ -1151,7 +1151,7 @@ nfs_rephead(siz, nd, err, cache, frev, mrq, mbp, bposp)
} else {
if (nd->nd_nqlflag != 0)
panic("nqreph");
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@@ -1415,10 +1415,10 @@ nfs_realign(m, hsiz)
* This never happens for UDP, rarely happens for TCP
* but frequently happens for iso transport.
*/
- if ((m->m_len & 0x3) || (mtod(m, int) & 0x3)) {
+ if ((m->m_len & 0x3) || (mtod(m, long) & 0x3)) {
olen = m->m_len;
fcp = mtod(m, caddr_t);
- if ((int)fcp & 0x3) {
+ if ((long)fcp & 0x3) {
m->m_flags &= ~M_PKTHDR;
if (m->m_flags & M_EXT)
m->m_data = m->m_ext.ext_buf +
@@ -1496,12 +1496,12 @@ nfs_getreq(nd, has_header)
int has_header;
{
register int len, i;
- register u_long *tl;
- register long t1;
+ register u_int32_t *tl;
+ register int32_t t1;
struct uio uio;
struct iovec iov;
caddr_t dpos, cp2;
- u_long nfsvers, auth_type;
+ u_int32_t nfsvers, auth_type;
int error = 0, nqnfs = 0;
struct mbuf *mrep, *md;
@@ -1509,14 +1509,14 @@ nfs_getreq(nd, has_header)
md = nd->nd_md;
dpos = nd->nd_dpos;
if (has_header) {
- nfsm_dissect(tl, u_long *, 10*NFSX_UNSIGNED);
- nd->nd_retxid = fxdr_unsigned(u_long, *tl++);
+ nfsm_dissect(tl, u_int32_t *, 10*NFSX_UNSIGNED);
+ nd->nd_retxid = fxdr_unsigned(u_int32_t , *tl++);
if (*tl++ != rpc_call) {
m_freem(mrep);
return (EBADRPC);
}
} else {
- nfsm_dissect(tl, u_long *, 8*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 8*NFSX_UNSIGNED);
}
nd->nd_repstat = 0;
if (*tl++ != rpc_vers) {
@@ -1541,7 +1541,7 @@ nfs_getreq(nd, has_header)
nd->nd_procnum = NFSPROC_NOOP;
return (0);
}
- nd->nd_procnum = fxdr_unsigned(u_long, *tl++);
+ nd->nd_procnum = fxdr_unsigned(u_int32_t , *tl++);
if (nd->nd_procnum == NFSPROC_NULL)
return (0);
if (nd->nd_procnum >= NFS_NPROCS ||
@@ -1568,7 +1568,7 @@ nfs_getreq(nd, has_header)
return (EBADRPC);
}
nfsm_adv(nfsm_rndup(len));
- nfsm_dissect(tl, u_long *, 3*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 3*NFSX_UNSIGNED);
nd->nd_cr.cr_uid = fxdr_unsigned(uid_t, *tl++);
nd->nd_cr.cr_gid = fxdr_unsigned(gid_t, *tl++);
len = fxdr_unsigned(int, *tl);
@@ -1576,7 +1576,7 @@ nfs_getreq(nd, has_header)
m_freem(mrep);
return (EBADRPC);
}
- nfsm_dissect(tl, u_long *, (len + 2)*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, (len + 2)*NFSX_UNSIGNED);
for (i = 0; i < len; i++)
if (i < NGROUPS)
nd->nd_cr.cr_groups[i] = fxdr_unsigned(gid_t, *tl++);
@@ -1598,7 +1598,7 @@ nfs_getreq(nd, has_header)
iov.iov_base = (caddr_t)nd->nd_authstr;
iov.iov_len = RPCAUTH_MAXSIZ;
nfsm_mtouio(&uio, uio.uio_resid);
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
nd->nd_flag |= NFSD_NEEDAUTH;
}
@@ -1621,10 +1621,10 @@ nfs_getreq(nd, has_header)
* For nqnfs, get piggybacked lease request.
*/
if (nqnfs && nd->nd_procnum != NQNFSPROC_EVICTED) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nd->nd_nqlflag = fxdr_unsigned(int, *tl);
if (nd->nd_nqlflag) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int, *tl);
} else
nd->nd_duration = NQ_MINLEASE;
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index fcb99792838..ad2ec190bb3 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_subs.c,v 1.21 1995/09/08 13:52:23 ws Exp $ */
+/* $NetBSD: nfs_subs.c,v 1.22 1995/12/19 23:07:43 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -79,20 +79,20 @@
* This is kinda hokey, but may save a little time doing byte swaps
*/
u_long nfs_procids[NFS_NPROCS];
-u_long nfs_xdrneg1;
-u_long rpc_call, rpc_vers, rpc_reply, rpc_msgdenied, rpc_autherr,
+u_int32_t nfs_xdrneg1;
+u_int32_t rpc_call, rpc_vers, rpc_reply, rpc_msgdenied, rpc_autherr,
rpc_mismatch, rpc_auth_unix, rpc_msgaccepted, rpc_rejectedcred,
rpc_auth_kerb;
-u_long nfs_vers, nfs_prog, nfs_true, nfs_false;
+u_int32_t nfs_vers, nfs_prog, nfs_true, nfs_false;
/* And other global data */
-static u_long nfs_xid = 0;
+static u_int32_t nfs_xid = 0;
enum vtype ntov_type[7] = { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON };
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
extern int nqnfs_piggy[NFS_NPROCS];
extern struct nfsrtt nfsrtt;
extern time_t nqnfsstarttime;
-extern u_long nqnfs_prog, nqnfs_vers;
+extern u_int32_t nqnfs_prog, nqnfs_vers;
extern int nqsrv_clockskew;
extern int nqsrv_writeslack;
extern int nqsrv_maxlease;
@@ -113,7 +113,7 @@ nfsm_reqh(vp, procid, hsiz, bposp)
caddr_t *bposp;
{
register struct mbuf *mb;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t bpos;
struct mbuf *mb2;
struct nfsmount *nmp;
@@ -133,11 +133,11 @@ nfsm_reqh(vp, procid, hsiz, bposp)
if (nmp->nm_flag & NFSMNT_NQNFS) {
nqflag = NQNFS_NEEDLEASE(vp, procid);
if (nqflag) {
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nqflag);
*tl = txdr_unsigned(nmp->nm_leaseterm);
} else {
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@@ -165,10 +165,10 @@ nfsm_rpchead(cr, nqnfs, procid, auth_type, auth_len, auth_str, mrest,
struct mbuf *mrest;
int mrest_len;
struct mbuf **mbp;
- u_long *xidp;
+ u_int32_t *xidp;
{
register struct mbuf *mb;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t bpos;
register int i;
struct mbuf *mreq, *mb2;
@@ -192,7 +192,7 @@ nfsm_rpchead(cr, nqnfs, procid, auth_type, auth_len, auth_str, mrest,
/*
* First the RPC header.
*/
- nfsm_build(tl, u_long *, 8*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 8*NFSX_UNSIGNED);
if (++nfs_xid == 0)
nfs_xid++;
*tl++ = *xidp = txdr_unsigned(nfs_xid);
@@ -214,7 +214,7 @@ nfsm_rpchead(cr, nqnfs, procid, auth_type, auth_len, auth_str, mrest,
*tl = txdr_unsigned(authsiz);
switch (auth_type) {
case RPCAUTH_UNIX:
- nfsm_build(tl, u_long *, auth_len);
+ nfsm_build(tl, u_int32_t *, auth_len);
*tl++ = 0; /* stamp ?? */
*tl++ = 0; /* NULL hostname */
*tl++ = txdr_unsigned(cr->cr_uid);
@@ -225,7 +225,7 @@ nfsm_rpchead(cr, nqnfs, procid, auth_type, auth_len, auth_str, mrest,
*tl++ = txdr_unsigned(cr->cr_groups[i]);
break;
case RPCAUTH_NQNFS:
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(cr->cr_uid);
*tl = txdr_unsigned(auth_len);
siz = auth_len;
@@ -253,7 +253,7 @@ nfsm_rpchead(cr, nqnfs, procid, auth_type, auth_len, auth_str, mrest,
}
break;
};
- nfsm_build(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2*NFSX_UNSIGNED);
*tl++ = txdr_unsigned(RPCAUTH_NULL);
*tl = 0;
mb->m_next = mrest;
@@ -523,14 +523,14 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
{
register struct mbuf *m1, *m2;
long left, xfer, len, tlen;
- u_long *tl;
+ u_int32_t *tl;
int putsize;
putsize = 1;
m2 = *mb;
left = M_TRAILINGSPACE(m2);
if (left > 0) {
- tl = ((u_long *)(*bpos));
+ tl = ((u_int32_t *)(*bpos));
*tl++ = txdr_unsigned(siz);
putsize = 0;
left -= NFSX_UNSIGNED;
@@ -551,7 +551,7 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
m1->m_len = NFSMSIZ(m1);
m2->m_next = m1;
m2 = m1;
- tl = mtod(m1, u_long *);
+ tl = mtod(m1, u_int32_t *);
tlen = 0;
if (putsize) {
*tl++ = txdr_unsigned(siz);
@@ -662,7 +662,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
extern int (**spec_nfsv2nodeop_p)();
register struct nfsnode *np;
register struct nfsnodehashhead *nhpp;
- register long t1;
+ register int32_t t1;
caddr_t dpos, cp2;
int error = 0, isnq;
struct mbuf *md;
@@ -684,10 +684,10 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
if (vtyp == VNON || vtyp == VREG)
vtyp = IFTOVT(vmode);
if (isnq) {
- rdev = fxdr_unsigned(long, fp->fa_nqrdev);
+ rdev = fxdr_unsigned(int32_t, fp->fa_nqrdev);
fxdr_nqtime(&fp->fa_nqmtime, &mtime);
} else {
- rdev = fxdr_unsigned(long, fp->fa_nfsrdev);
+ rdev = fxdr_unsigned(int32_t, fp->fa_nfsrdev);
fxdr_nfstime(&fp->fa_nfsmtime, &mtime);
}
/*
@@ -745,19 +745,19 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
if (isnq) {
fxdr_hyper(&fp->fa_nqsize, &vap->va_size);
- vap->va_blocksize = fxdr_unsigned(long, fp->fa_nqblocksize);
+ vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa_nqblocksize);
fxdr_hyper(&fp->fa_nqbytes, &vap->va_bytes);
- vap->va_fileid = fxdr_unsigned(long, fp->fa_nqfileid);
+ vap->va_fileid = fxdr_unsigned(int32_t, fp->fa_nqfileid);
fxdr_nqtime(&fp->fa_nqatime, &vap->va_atime);
- vap->va_flags = fxdr_unsigned(u_long, fp->fa_nqflags);
+ vap->va_flags = fxdr_unsigned(u_int32_t, fp->fa_nqflags);
fxdr_nqtime(&fp->fa_nqctime, &vap->va_ctime);
- vap->va_gen = fxdr_unsigned(u_long, fp->fa_nqgen);
+ vap->va_gen = fxdr_unsigned(u_int32_t, fp->fa_nqgen);
fxdr_hyper(&fp->fa_nqfilerev, &vap->va_filerev);
} else {
- vap->va_size = fxdr_unsigned(u_long, fp->fa_nfssize);
- vap->va_blocksize = fxdr_unsigned(long, fp->fa_nfsblocksize);
- vap->va_bytes = fxdr_unsigned(long, fp->fa_nfsblocks) * NFS_FABLKSIZE;
- vap->va_fileid = fxdr_unsigned(long, fp->fa_nfsfileid);
+ vap->va_size = fxdr_unsigned(u_int32_t, fp->fa_nfssize);
+ vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa_nfsblocksize);
+ vap->va_bytes = fxdr_unsigned(int32_t, fp->fa_nfsblocks) * NFS_FABLKSIZE;
+ vap->va_fileid = fxdr_unsigned(int32_t, fp->fa_nfsfileid);
fxdr_nfstime(&fp->fa_nfsatime, &vap->va_atime);
vap->va_flags = 0;
fxdr_nfstime(&fp->fa_nfsctime, &vap->va_ctime);
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 213062d8030..1de179e8b1d 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_syscalls.c,v 1.16 1995/10/07 06:28:57 mycroft Exp $ */
+/* $NetBSD: nfs_syscalls.c,v 1.17 1995/12/19 23:07:46 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -74,8 +74,8 @@
#include <nfs/nfsrtt.h>
/* Global defs. */
-extern u_long nfs_prog, nfs_vers;
-extern int (*nfsrv_procs[NFS_NPROCS])();
+extern u_int32_t nfs_prog, nfs_vers;
+extern int32_t (*nfsrv_procs[NFS_NPROCS])();
extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
extern int nfs_numasync;
extern time_t nqnfsstarttime;
@@ -325,7 +325,7 @@ nfssvc_addsock(fp, mynam)
#endif /* ISO */
}
if (so->so_type == SOCK_STREAM)
- siz = NFS_MAXPACKET + sizeof (u_long);
+ siz = NFS_MAXPACKET + sizeof (u_int32_t);
else
siz = NFS_MAXPACKET;
if (error = soreserve(so, siz, siz)) {
@@ -588,7 +588,7 @@ nfssvc_nfsd(nsd, argp, p)
*/
if (sotype == SOCK_STREAM) {
M_PREPEND(m, NFSX_UNSIGNED, M_WAIT);
- *mtod(m, u_long *) = htonl(0x80000000 | siz);
+ *mtod(m, u_int32_t *) = htonl(0x80000000 | siz);
}
if (solockp)
(void) nfs_sndlock(solockp, (struct nfsreq *)0);
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 86cbd0b27c6..db33639afe6 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_vfsops.c,v 1.38 1995/08/13 00:00:08 mycroft Exp $ */
+/* $NetBSD: nfs_vfsops.c,v 1.39 1995/12/19 23:07:49 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -106,7 +106,7 @@ nfs_statfs(mp, sbp, p)
register struct vnode *vp;
register struct nfsv2_statfs *sfp;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
int error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -133,13 +133,13 @@ nfs_statfs(mp, sbp, p)
#endif
sbp->f_flags = nmp->nm_flag;
sbp->f_iosize = NFS_MAXDGRAMDATA;
- sbp->f_bsize = fxdr_unsigned(long, sfp->sf_bsize);
- sbp->f_blocks = fxdr_unsigned(long, sfp->sf_blocks);
- sbp->f_bfree = fxdr_unsigned(long, sfp->sf_bfree);
- sbp->f_bavail = fxdr_unsigned(long, sfp->sf_bavail);
+ sbp->f_bsize = fxdr_unsigned(int32_t, sfp->sf_bsize);
+ sbp->f_blocks = fxdr_unsigned(int32_t, sfp->sf_blocks);
+ sbp->f_bfree = fxdr_unsigned(int32_t, sfp->sf_bfree);
+ sbp->f_bavail = fxdr_unsigned(int32_t, sfp->sf_bavail);
if (isnq) {
- sbp->f_files = fxdr_unsigned(long, sfp->sf_files);
- sbp->f_ffree = fxdr_unsigned(long, sfp->sf_ffree);
+ sbp->f_files = fxdr_unsigned(int32_t, sfp->sf_files);
+ sbp->f_ffree = fxdr_unsigned(int32_t, sfp->sf_ffree);
} else {
sbp->f_files = 0;
sbp->f_ffree = 0;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 0f6edb0e89a..362a40d3a4b 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_vnops.c,v 1.51.2.1 1995/10/17 15:36:26 ghudson Exp $ */
+/* $NetBSD: nfs_vnops.c,v 1.53 1995/12/19 23:07:54 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -238,8 +238,8 @@ void nqnfs_clientlease();
/*
* Global variables
*/
-extern u_long nfs_procids[NFS_NPROCS];
-extern u_long nfs_prog, nfs_vers, nfs_true, nfs_false;
+extern u_int32_t nfs_procids[NFS_NPROCS];
+extern u_int32_t nfs_prog, nfs_vers, nfs_true, nfs_false;
struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
int nfs_numasync = 0;
#define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1))
@@ -279,7 +279,7 @@ nfs_access(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
caddr_t bpos, dpos;
int error = 0;
@@ -297,7 +297,7 @@ nfs_access(ap)
nfsstats.rpccnt[NQNFSPROC_ACCESS]++;
nfsm_reqhead(vp, NQNFSPROC_ACCESS, NFSX_FH + 3 * NFSX_UNSIGNED);
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
*tl++ = nfs_true;
else
@@ -477,9 +477,9 @@ nfs_setattr(ap)
{
register struct nfsv2_sattr *sp;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
- u_long *tl;
+ u_int32_t *tl;
int error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
register struct vnode *vp = ap->a_vp;
@@ -554,7 +554,7 @@ nfs_setattr(ap)
nfsm_loadattr(vp, (struct vattr *)0);
if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NQNFS) &&
NQNFS_CKCACHABLE(vp, NQL_WRITE)) {
- nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);
fxdr_hyper(tl, &frev);
if (frev > np->n_brev)
np->n_brev = frev;
@@ -586,9 +586,9 @@ nfs_lookup(ap)
register struct vnode **vpp = ap->a_vpp;
register int flags = cnp->cn_flags;
register struct vnode *vdp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1, t2;
+ register int32_t t1, t2;
struct nfsmount *nmp;
caddr_t bpos, dpos, cp2;
time_t reqtime;
@@ -667,7 +667,7 @@ nfs_lookup(ap)
* being looked up.
*/
if (nmp->nm_flag & NFSMNT_NQNFS) {
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if ((nmp->nm_flag & NFSMNT_NQLOOKLEASE) &&
((cnp->cn_flags & MAKEENTRY) &&
(cnp->cn_nameiop != DELETE || !(flags & ISLASTCN))))
@@ -689,10 +689,10 @@ nfsmout:
return (error);
}
if (nmp->nm_flag & NFSMNT_NQNFS) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
if (*tl) {
nqlflag = fxdr_unsigned(int, *tl);
- nfsm_dissect(tl, u_long *, 4*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 4*NFSX_UNSIGNED);
cachable = fxdr_unsigned(int, *tl++);
reqtime += fxdr_unsigned(int, *tl++);
fxdr_hyper(tl, &frev);
@@ -805,9 +805,9 @@ nfs_readlinkrpc(vp, uiop, cred)
struct uio *uiop;
struct ucred *cred;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -833,9 +833,9 @@ nfs_readrpc(vp, uiop, cred)
struct uio *uiop;
struct ucred *cred;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -852,7 +852,7 @@ nfs_readrpc(vp, uiop, cred)
len = (tsiz > nmp->nm_rsize) ? nmp->nm_rsize : tsiz;
nfsm_reqhead(vp, NFSPROC_READ, NFSX_FH+NFSX_UNSIGNED*3);
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, NFSX_UNSIGNED*3);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED*3);
if (nmp->nm_flag & NFSMNT_NQNFS) {
txdr_hyper(&uiop->uio_offset, tl);
*(tl + 2) = txdr_unsigned(len);
@@ -885,9 +885,9 @@ nfs_writerpc(vp, uiop, cred, ioflags)
struct ucred *cred;
int ioflags;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -907,7 +907,7 @@ nfs_writerpc(vp, uiop, cred, ioflags)
nfsm_reqhead(vp, NFSPROC_WRITE,
NFSX_FH+NFSX_UNSIGNED*4+nfsm_rndup(len));
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, NFSX_UNSIGNED * 4);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED * 4);
if (nmp->nm_flag & NFSMNT_NQNFS) {
txdr_hyper(&uiop->uio_offset, tl);
tl += 2;
@@ -930,7 +930,7 @@ nfs_writerpc(vp, uiop, cred, ioflags)
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.ts_sec;
else if ((nmp->nm_flag & NFSMNT_NQNFS) &&
NQNFS_CKCACHABLE(vp, NQL_WRITE)) {
- nfsm_dissect(tl, u_long *, 2*NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2*NFSX_UNSIGNED);
fxdr_hyper(tl, &frev);
if (frev > np->n_brev)
np->n_brev = frev;
@@ -963,16 +963,16 @@ nfs_mknod(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1, t2;
+ register int32_t t1, t2;
struct vnode *newvp;
struct vattr vattr;
char *cp2;
caddr_t bpos, dpos;
int error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
- u_long rdev;
+ u_int32_t rdev;
if (vap->va_type == VCHR || vap->va_type == VBLK)
rdev = txdr_unsigned(vap->va_rdev);
@@ -1041,9 +1041,9 @@ nfs_create(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1, t2;
+ register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1113,9 +1113,9 @@ nfs_remove(ap)
register struct vnode *dvp = ap->a_dvp;
register struct componentname *cnp = ap->a_cnp;
register struct nfsnode *np = VTONFS(vp);
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1184,9 +1184,9 @@ int
nfs_removeit(sp)
register struct sillyrename *sp;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1223,9 +1223,9 @@ nfs_rename(ap)
register struct vnode *tdvp = ap->a_tdvp;
register struct componentname *tcnp = ap->a_tcnp;
register struct componentname *fcnp = ap->a_fcnp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1283,9 +1283,9 @@ nfs_renameit(sdvp, scnp, sp)
struct componentname *scnp;
register struct sillyrename *sp;
{
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1320,9 +1320,9 @@ nfs_link(ap)
register struct vnode *vp = ap->a_vp;
register struct vnode *tdvp = ap->a_tdvp;
register struct componentname *cnp = ap->a_cnp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1382,9 +1382,9 @@ nfs_symlink(ap)
register struct vattr *vap = ap->a_vap;
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int slen, error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1444,9 +1444,9 @@ nfs_mkdir(ap)
register struct componentname *cnp = ap->a_cnp;
register struct vnode **vpp = ap->a_vpp;
register struct nfsv2_sattr *sp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1, t2;
+ register int32_t t1, t2;
register int len;
caddr_t bpos, dpos, cp2;
int error = 0, firsttry = 1, isnq;
@@ -1528,9 +1528,9 @@ nfs_rmdir(ap)
register struct vnode *vp = ap->a_vp;
register struct vnode *dvp = ap->a_dvp;
register struct componentname *cnp = ap->a_cnp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t2;
+ register int32_t t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1656,9 +1656,9 @@ nfs_readdirrpc(vp, uiop, cred)
{
register long len;
register struct dirent *dp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
long tlen, lastlen;
caddr_t bpos, dpos, cp2;
int error = 0;
@@ -1687,14 +1687,14 @@ nfs_readdirrpc(vp, uiop, cred)
nfsm_reqhead(vp, NFSPROC_READDIR,
NFSX_FH + 2 * NFSX_UNSIGNED);
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
off = (u_long)uiop->uio_offset;
*tl++ = txdr_unsigned(off);
*tl = txdr_unsigned(((uiop->uio_resid > nmp->nm_rsize) ?
nmp->nm_rsize : uiop->uio_resid) & ~(NFS_DIRBLKSIZ-1));
nfsm_request(vp, NFSPROC_READDIR, uiop->uio_procp, cred);
siz = 0;
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = fxdr_unsigned(int, *tl);
/* Save the position so that we can do nfsm_mtouio() later */
@@ -1708,9 +1708,9 @@ nfs_readdirrpc(vp, uiop, cred)
while (more_dirs && siz < uiop->uio_resid) {
savoff = off; /* Hold onto offset and dp */
savdp = dp;
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
dp = (struct dirent *)tl;
- dp->d_fileno = fxdr_unsigned(u_long, *tl++);
+ dp->d_fileno = fxdr_unsigned(u_int32_t, *tl++);
len = fxdr_unsigned(int, *tl);
if (len <= 0 || len > NFS_MAXNAMLEN) {
error = EBADRPC;
@@ -1730,8 +1730,8 @@ nfs_readdirrpc(vp, uiop, cred)
nfsm_adv(tlen - len);
len = tlen;
}
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
- off = fxdr_unsigned(u_long, *tl);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ off = fxdr_unsigned(u_int32_t, *tl);
*tl++ = 0; /* Ensures null termination of name */
more_dirs = fxdr_unsigned(int, *tl);
*tl = off; /* Store offset for cookie retrieval */
@@ -1742,7 +1742,7 @@ nfs_readdirrpc(vp, uiop, cred)
* If at end of rpc data, get the eof boolean
*/
if (!more_dirs) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = (fxdr_unsigned(int, *tl) == 0);
/*
@@ -1805,9 +1805,9 @@ nfs_readdirlookrpc(vp, uiop, cred)
{
register int len;
register struct dirent *dp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1;
+ register int32_t t1;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct nameidata nami, *ndp = &nami;
@@ -1838,7 +1838,7 @@ nfs_readdirlookrpc(vp, uiop, cred)
nfsm_reqhead(vp, NQNFSPROC_READDIRLOOK,
NFSX_FH + 3 * NFSX_UNSIGNED);
nfsm_fhtom(vp);
- nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
off = (u_long)uiop->uio_offset;
*tl++ = txdr_unsigned(off);
*tl++ = txdr_unsigned(((uiop->uio_resid > nmp->nm_rsize) ?
@@ -1849,14 +1849,14 @@ nfs_readdirlookrpc(vp, uiop, cred)
*tl = 0;
reqtime = time.tv_sec;
nfsm_request(vp, NQNFSPROC_READDIRLOOK, uiop->uio_procp, cred);
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = fxdr_unsigned(int, *tl);
/* loop thru the dir entries, doctoring them to 4bsd form */
bigenough = 1;
while (more_dirs && bigenough) {
doit = 1;
- nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
if (nmp->nm_flag & NFSMNT_NQLOOKLEASE) {
cachable = fxdr_unsigned(int, *tl++);
ltime = reqtime + fxdr_unsigned(int, *tl++);
@@ -1875,8 +1875,8 @@ nfs_readdirlookrpc(vp, uiop, cred)
if (error = nfs_loadattrcache(&newvp, &md, &dpos,
(struct vattr *)0))
doit = 0;
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
- fileno = fxdr_unsigned(u_long, *tl++);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ fileno = fxdr_unsigned(u_int32_t, *tl++);
len = fxdr_unsigned(int, *tl);
if (len <= 0 || len > NFS_MAXNAMLEN) {
error = EBADRPC;
@@ -1923,11 +1923,11 @@ nfs_readdirlookrpc(vp, uiop, cred)
vrele(newvp);
newvp = NULLVP;
}
- nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (bigenough)
- endoff = off = fxdr_unsigned(u_long, *tl++);
+ endoff = off = fxdr_unsigned(u_int32_t, *tl++);
else
- endoff = fxdr_unsigned(u_long, *tl++);
+ endoff = fxdr_unsigned(u_int32_t, *tl++);
more_dirs = fxdr_unsigned(int, *tl);
*tl = endoff; /* Store offset for cookies. */
}
@@ -1935,7 +1935,7 @@ nfs_readdirlookrpc(vp, uiop, cred)
* If at end of rpc data, get the eof boolean
*/
if (!more_dirs) {
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = (fxdr_unsigned(int, *tl) == 0);
/*
@@ -2046,9 +2046,9 @@ nfs_lookitup(sp, fhp, procp)
struct proc *procp;
{
register struct vnode *vp = sp->s_dvp;
- register u_long *tl;
+ register u_int32_t *tl;
register caddr_t cp;
- register long t1, t2;
+ register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, isnq;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -2059,7 +2059,7 @@ nfs_lookitup(sp, fhp, procp)
len = sp->s_namlen;
nfsm_reqhead(vp, NFSPROC_LOOKUP, NFSX_FH+NFSX_UNSIGNED+nfsm_rndup(len));
if (isnq) {
- nfsm_build(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
nfsm_fhtom(vp);
@@ -2067,7 +2067,7 @@ nfs_lookitup(sp, fhp, procp)
nfsm_request(vp, NFSPROC_LOOKUP, procp, sp->s_cred);
if (fhp != NULL) {
if (isnq)
- nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
+ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nfsm_dissect(cp, caddr_t, NFSX_FH);
bcopy(cp, (caddr_t)fhp, NFSX_FH);
}
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 44fac3fd5c7..c2ff58a2de5 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsm_subs.h,v 1.6 1995/05/23 06:25:30 mycroft Exp $ */
+/* $NetBSD: nfsm_subs.h,v 1.7 1995/12/19 23:08:00 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -128,16 +128,16 @@ extern struct mbuf *nfsm_reqh();
(v) = tvp; }
#define nfsm_strsiz(s,m) \
- { nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
- if (((s) = fxdr_unsigned(long,*tl)) > (m)) { \
+ { nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
+ if (((s) = fxdr_unsigned(int32_t,*tl)) > (m)) { \
m_freem(mrep); \
error = EBADRPC; \
goto nfsmout; \
} }
#define nfsm_srvstrsiz(s,m) \
- { nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
- if (((s) = fxdr_unsigned(long,*tl)) > (m) || (s) <= 0) { \
+ { nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
+ if (((s) = fxdr_unsigned(int32_t,*tl)) > (m) || (s) <= 0) { \
error = EBADRPC; \
nfsm_reply(0); \
} }
@@ -176,7 +176,7 @@ extern struct mbuf *nfsm_reqh();
} \
t2 = nfsm_rndup(s)+NFSX_UNSIGNED; \
if (t2 <= M_TRAILINGSPACE(mb)) { \
- nfsm_build(tl,u_long *,t2); \
+ nfsm_build(tl,u_int32_t *,t2); \
*tl++ = txdr_unsigned(s); \
*(tl+((t2>>2)-2)) = 0; \
bcopy((caddr_t)(a), (caddr_t)tl, (s)); \
@@ -214,7 +214,7 @@ extern struct mbuf *nfsm_reqh();
}
#define nfsm_srvmtofh(f) \
- nfsm_dissect(tl, u_long *, NFSX_FH); \
+ nfsm_dissect(tl, u_int32_t *, NFSX_FH); \
bcopy((caddr_t)tl, (caddr_t)f, NFSX_FH)
#define nfsm_clget \
@@ -229,7 +229,7 @@ extern struct mbuf *nfsm_reqh();
bp = mtod(mp, caddr_t); \
be = bp+mp->m_len; \
} \
- tl = (u_long *)bp
+ tl = (u_int32_t *)bp
#define nfsm_srvfillattr \
fp->fa_type = vtonfs_type(va.va_type); \
diff --git a/sys/nfs/nfsrtt.h b/sys/nfs/nfsrtt.h
index d455f85128a..a8bfc8b8b90 100644
--- a/sys/nfs/nfsrtt.h
+++ b/sys/nfs/nfsrtt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsrtt.h,v 1.2 1994/06/29 06:42:37 cgd Exp $ */
+/* $NetBSD: nfsrtt.h,v 1.3 1995/12/19 23:08:05 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -91,7 +91,7 @@ struct nfsdrt {
struct drt {
int flag; /* Bits as defined above */
int proc; /* NFS procedure number */
- u_long ipadr; /* IP address of client */
+ u_int32_t ipadr; /* IP address of client */
int resptime; /* Response time (usec) */
struct timeval tstamp; /* Timestamp of log entry */
} drt[NFSRTTLOGSIZ];
diff --git a/sys/nfs/nfsrvcache.h b/sys/nfs/nfsrvcache.h
index d6a1417b00c..90b249db28e 100644
--- a/sys/nfs/nfsrvcache.h
+++ b/sys/nfs/nfsrvcache.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsrvcache.h,v 1.8 1994/12/13 17:17:07 mycroft Exp $ */
+/* $NetBSD: nfsrvcache.h,v 1.9 1995/12/19 23:08:11 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -47,15 +47,15 @@
struct nfsrvcache {
TAILQ_ENTRY(nfsrvcache) rc_lru; /* LRU chain */
LIST_ENTRY(nfsrvcache) rc_hash; /* Hash chain */
- u_long rc_xid; /* rpc id number */
+ u_int32_t rc_xid; /* rpc id number */
union {
struct mbuf *ru_repmb; /* Reply mbuf list OR */
int ru_repstat; /* Reply status */
} rc_un;
union nethostaddr rc_haddr; /* Host address */
- short rc_proc; /* rpc proc number */
- u_char rc_state; /* Current state of request */
- u_char rc_flag; /* Flag bits */
+ u_int16_t rc_proc; /* rpc proc number */
+ u_char rc_state; /* Current state of request */
+ u_char rc_flag; /* Flag bits */
};
#define rc_reply rc_un.ru_repmb
diff --git a/sys/nfs/nfsv2.h b/sys/nfs/nfsv2.h
index 2b699cb72bf..a9e8eb9e276 100644
--- a/sys/nfs/nfsv2.h
+++ b/sys/nfs/nfsv2.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nfsv2.h,v 1.9 1994/06/29 06:42:40 cgd Exp $ */
+/* $NetBSD: nfsv2.h,v 1.10 1995/12/19 23:08:15 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -128,22 +128,22 @@ extern int vttoif_tab[];
#define vtonfs_mode(t,m) \
txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
MAKEIMODE((t), (m)))
-#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
-#define vtonfs_type(a) txdr_unsigned(nfs_type[((long)(a))])
-#define nfstov_type(a) ntov_type[fxdr_unsigned(u_long,(a))&0x7]
+#define nfstov_mode(a) (fxdr_unsigned(u_int16_t, (a))&07777)
+#define vtonfs_type(a) txdr_unsigned(nfs_type[((int32_t)(a))])
+#define nfstov_type(a) ntov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
/* File types */
typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5 } nfstype;
/* Structs for common parts of the rpc's */
struct nfsv2_time {
- u_long nfs_sec;
- u_long nfs_usec;
+ u_int32_t nfs_sec;
+ u_int32_t nfs_usec;
};
struct nqnfs_time {
- u_long nq_sec;
- u_long nq_nsec;
+ u_int32_t nq_sec;
+ u_int32_t nq_nsec;
};
/*
@@ -151,46 +151,46 @@ struct nqnfs_time {
* NFS version 2 and the NQNFS protocol. Note that the union is only
* used to that one pointer can refer to both variants. These structures
* go out on the wire and must be densely packed, so no quad data types
- * are used. (all fields are longs or u_longs or structures of same)
+ * are used. (all fields are int32_ts or u_int32_ts or structures of same)
* NB: You can't do sizeof(struct nfsv2_fattr), you must use the
* NFSX_FATTR(isnq) macro.
*/
struct nfsv2_fattr {
- u_long fa_type;
- u_long fa_mode;
- u_long fa_nlink;
- u_long fa_uid;
- u_long fa_gid;
+ u_int32_t fa_type;
+ u_int32_t fa_mode;
+ u_int32_t fa_nlink;
+ u_int32_t fa_uid;
+ u_int32_t fa_gid;
union {
struct {
- u_long nfsfa_size;
- u_long nfsfa_blocksize;
- u_long nfsfa_rdev;
- u_long nfsfa_blocks;
- u_long nfsfa_fsid;
- u_long nfsfa_fileid;
+ u_int32_t nfsfa_size;
+ u_int32_t nfsfa_blocksize;
+ u_int32_t nfsfa_rdev;
+ u_int32_t nfsfa_blocks;
+ u_int32_t nfsfa_fsid;
+ u_int32_t nfsfa_fileid;
struct nfsv2_time nfsfa_atime;
struct nfsv2_time nfsfa_mtime;
struct nfsv2_time nfsfa_ctime;
} fa_nfsv2;
struct {
struct {
- u_long nqfa_qsize[2];
+ u_int32_t nqfa_qsize[2];
} nqfa_size;
- u_long nqfa_blocksize;
- u_long nqfa_rdev;
+ u_int32_t nqfa_blocksize;
+ u_int32_t nqfa_rdev;
struct {
- u_long nqfa_qbytes[2];
+ u_int32_t nqfa_qbytes[2];
} nqfa_bytes;
- u_long nqfa_fsid;
- u_long nqfa_fileid;
+ u_int32_t nqfa_fsid;
+ u_int32_t nqfa_fileid;
struct nqnfs_time nqfa_atime;
struct nqnfs_time nqfa_mtime;
struct nqnfs_time nqfa_ctime;
- u_long nqfa_flags;
- u_long nqfa_gen;
+ u_int32_t nqfa_flags;
+ u_int32_t nqfa_gen;
struct {
- u_long nqfa_qfilerev[2];
+ u_int32_t nqfa_qfilerev[2];
} nqfa_filerev;
} fa_nqnfs;
} fa_un;
@@ -220,23 +220,23 @@ struct nfsv2_fattr {
#define fa_nqfilerev fa_un.fa_nqnfs.nqfa_filerev
struct nfsv2_sattr {
- u_long sa_mode;
- u_long sa_uid;
- u_long sa_gid;
+ u_int32_t sa_mode;
+ u_int32_t sa_uid;
+ u_int32_t sa_gid;
union {
struct {
- u_long nfssa_size;
+ u_int32_t nfssa_size;
struct nfsv2_time nfssa_atime;
struct nfsv2_time nfssa_mtime;
} sa_nfsv2;
struct {
struct {
- u_long nqsa_qsize[2];
+ u_int32_t nqsa_qsize[2];
} nqsa_size;
struct nqnfs_time nqsa_atime;
struct nqnfs_time nqsa_mtime;
- u_long nqsa_flags;
- u_long nqsa_rdev;
+ u_int32_t nqsa_flags;
+ u_int32_t nqsa_rdev;
} sa_nqnfs;
} sa_un;
};
@@ -252,11 +252,11 @@ struct nfsv2_sattr {
#define sa_nqrdev sa_un.sa_nqnfs.nqsa_rdev
struct nfsv2_statfs {
- u_long sf_tsize;
- u_long sf_bsize;
- u_long sf_blocks;
- u_long sf_bfree;
- u_long sf_bavail;
- u_long sf_files; /* Nqnfs only */
- u_long sf_ffree; /* ditto */
+ u_int32_t sf_tsize;
+ u_int32_t sf_bsize;
+ u_int32_t sf_blocks;
+ u_int32_t sf_bfree;
+ u_int32_t sf_bavail;
+ u_int32_t sf_files; /* Nqnfs only */
+ u_int32_t sf_ffree; /* ditto */
};
diff --git a/sys/nfs/nqnfs.h b/sys/nfs/nqnfs.h
index f5f07347afc..728f8d1ab65 100644
--- a/sys/nfs/nqnfs.h
+++ b/sys/nfs/nqnfs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nqnfs.h,v 1.4 1994/12/13 17:17:08 mycroft Exp $ */
+/* $NetBSD: nqnfs.h,v 1.5 1995/12/19 23:08:21 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -82,18 +82,18 @@
struct nqhost {
union {
struct {
- u_short udp_flag;
- u_short udp_port;
+ u_int16_t udp_flag;
+ u_int16_t udp_port;
union nethostaddr udp_haddr;
} un_udp;
struct {
- u_short connless_flag;
- u_short connless_spare;
+ u_int16_t connless_flag;
+ u_int16_t connless_spare;
union nethostaddr connless_haddr;
} un_connless;
struct {
- u_short conn_flag;
- u_short conn_spare;
+ u_int16_t conn_flag;
+ u_int16_t conn_spare;
struct nfssvc_sock *conn_slp;
} un_conn;
} lph_un;
@@ -190,7 +190,7 @@ CIRCLEQ_HEAD(, nqlease) nqtimerhead;
* List head for the file handle hash table.
*/
#define NQFHHASH(f) \
- (&nqfhhashtbl[(*((u_long *)(f))) & nqfhhash])
+ (&nqfhhashtbl[(*((u_int32_t *)(f))) & nqfhhash])
LIST_HEAD(nqfhhashhead, nqlease) *nqfhhashtbl;
u_long nqfhhash;
diff --git a/sys/nfs/rpcv2.h b/sys/nfs/rpcv2.h
index 7b2827fd6d1..2137fbfe1d8 100644
--- a/sys/nfs/rpcv2.h
+++ b/sys/nfs/rpcv2.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rpcv2.h,v 1.6 1994/06/29 06:42:43 cgd Exp $ */
+/* $NetBSD: rpcv2.h,v 1.7 1995/12/19 23:08:26 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -88,3 +88,9 @@
#define RPCMNT_NAMELEN 255
#define RPCMNT_PATHLEN 1024
#define RPCPROG_NFS 100003
+
+/* Structs for common parts of the rpc's */
+struct rpcv2_time {
+ u_int32_t rpc_sec;
+ u_int32_t rpc_usec;
+};
diff --git a/sys/nfs/xdr_subs.h b/sys/nfs/xdr_subs.h
index a0dfcc4146e..cf3cfe9769f 100644
--- a/sys/nfs/xdr_subs.h
+++ b/sys/nfs/xdr_subs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: xdr_subs.h,v 1.8 1995/01/13 16:15:02 mycroft Exp $ */
+/* $NetBSD: xdr_subs.h,v 1.9 1995/12/19 23:08:30 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -49,35 +49,35 @@
* but we cannot count on their alignment anyway.
*/
-#define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
-#define txdr_unsigned(v) (htonl((long)(v)))
+#define fxdr_unsigned(t, v) ((t)ntohl((int32_t)(v)))
+#define txdr_unsigned(v) (htonl((int32_t)(v)))
#define fxdr_nfstime(f, t) { \
- (t)->ts_sec = ntohl(((struct nfsv2_time *)(f))->nfs_sec); \
- if (((struct nfsv2_time *)(f))->nfs_usec != 0xffffffff) \
- (t)->ts_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfs_usec); \
+ (t)->ts_sec = ntohl((f)->nfs_sec); \
+ if ((f)->nfs_usec != 0xffffffff) \
+ (t)->ts_nsec = 1000 * ntohl((f)->nfs_usec); \
else \
(t)->ts_nsec = 0; \
}
#define txdr_nfstime(f, t) { \
- ((struct nfsv2_time *)(t))->nfs_sec = htonl((f)->ts_sec); \
- ((struct nfsv2_time *)(t))->nfs_usec = htonl((f)->ts_nsec) / 1000; \
+ (t)->nfs_sec = htonl((f)->ts_sec); \
+ (t)->nfs_usec = htonl((f)->ts_nsec) / 1000; \
}
#define fxdr_nqtime(f, t) { \
- (t)->ts_sec = ntohl(((struct nqnfs_time *)(f))->nq_sec); \
- (t)->ts_nsec = ntohl(((struct nqnfs_time *)(f))->nq_nsec); \
+ (t)->ts_sec = ntohl((f)->nq_sec); \
+ (t)->ts_nsec = ntohl((f)->nq_nsec); \
}
#define txdr_nqtime(f, t) { \
- ((struct nqnfs_time *)(t))->nq_sec = htonl((f)->ts_sec); \
- ((struct nqnfs_time *)(t))->nq_nsec = htonl((f)->ts_nsec); \
+ (t)->nq_sec = htonl((f)->ts_sec); \
+ (t)->nq_nsec = htonl((f)->ts_nsec); \
}
#define fxdr_hyper(f, t) { \
- ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \
- ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \
+ ((int32_t *)(t))[_QUAD_HIGHWORD] = ntohl(((int32_t *)(f))[0]); \
+ ((int32_t *)(t))[_QUAD_LOWWORD] = ntohl(((int32_t *)(f))[1]); \
}
#define txdr_hyper(f, t) { \
- ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \
- ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \
+ ((int32_t *)(t))[0] = htonl(((int32_t *)(f))[_QUAD_HIGHWORD]); \
+ ((int32_t *)(t))[1] = htonl(((int32_t *)(f))[_QUAD_LOWWORD]); \
}