1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-10 09:42:26 +00:00

For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;

int -> int32_t; u_short -> u_int16_t.  Also, use mode_t instead of u_short
for storing modes (mode_t is a u_int16_t).

Obtained from: NetBSD
This commit is contained in:
Peter Wemm 1998-05-31 20:09:01 +00:00
parent 75c6892c16
commit 4152886f7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36541
35 changed files with 1177 additions and 1153 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
* $Id: nfs_subs.c,v 1.59 1998/05/31 18:11:03 peter Exp $
* $Id: nfs_subs.c,v 1.60 1998/05/31 19:16:08 peter Exp $
*/
/*
@ -83,14 +83,14 @@
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
*/
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_auth_kerb;
u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false;
u_int32_t nfs_prog, nqnfs_prog, nfs_true, nfs_false;
/* And other global data */
static u_long nfs_xid = 0;
static u_int32_t nfs_xid = 0;
static enum vtype nv2tov_type[8]= {
VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON
};
@ -580,7 +580,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;
@ -600,11 +600,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;
}
}
@ -634,15 +634,15 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
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;
int siz, grpsiz, authsiz;
static u_long base;
static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@ -660,7 +660,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* First the RPC header.
*/
nfsm_build(tl, u_long *, 8 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
/* Get a pretty random xid to start with */
if (!nfs_xid)
@ -696,7 +696,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
*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);
@ -736,7 +736,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* And the verifier...
*/
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (verf_str) {
*tl++ = txdr_unsigned(RPCAUTH_KERB4);
*tl = txdr_unsigned(verf_len);
@ -1038,14 +1038,14 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
{
register struct mbuf *m1 = NULL, *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;
@ -1066,7 +1066,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);
@ -1207,7 +1207,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
register struct vattr *vap;
register struct nfs_fattr *fp;
register struct nfsnode *np;
register long t1;
register int32_t t1;
caddr_t cp2;
int error = 0, rdev;
struct mbuf *md;
@ -1252,7 +1252,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
if (vtyp == VNON || (vtyp == VREG && (vmode & S_IFMT) != 0))
vtyp = IFTOVT(vmode);
rdev = fxdr_unsigned(long, fp->fa2_rdev);
rdev = fxdr_unsigned(int32_t, fp->fa2_rdev);
fxdr_nfsv2time(&fp->fa2_mtime, &mtime);
/*
@ -1313,7 +1313,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
fxdr_hyper(&fp->fa3_size, &vap->va_size);
vap->va_blocksize = NFS_FABLKSIZE;
fxdr_hyper(&fp->fa3_used, &vap->va_bytes);
vap->va_fileid = fxdr_unsigned(int, fp->fa3_fileid.nfsuquad[1]);
vap->va_fileid = fxdr_unsigned(int32_t,
fp->fa3_fileid.nfsuquad[1]);
fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime);
fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime);
vap->va_flags = 0;
@ -1322,15 +1323,17 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink);
vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid);
vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid);
vap->va_size = fxdr_unsigned(u_long, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(long, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(long, fp->fa2_blocks) * NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(int32_t, fp->fa2_blocks)
* NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t,
fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}
if (vap->va_size != np->n_size) {
@ -1763,13 +1766,13 @@ nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
if (before_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, 7 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&(before_vap->va_size), tl);
tl += 2;
@ -1792,14 +1795,14 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
register struct nfs_fattr *fp;
if (after_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
* $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
* $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@ -59,7 +59,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
int auth_type, int auth_len, char *auth_str,
int verf_len, char *verf_str,
struct mbuf *mrest, int mrest_len,
struct mbuf **mbp, u_long *xidp));
struct mbuf **mbp, u_int32_t *xidp));
#define M_HASCL(m) ((m)->m_flags & M_EXT)
#define NFSMINOFF(m) \
@ -117,7 +117,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
{ if (v3) { \
t2 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED; \
if (t2 <= M_TRAILINGSPACE(mb)) { \
nfsm_build(tl, u_long *, t2); \
nfsm_build(tl, u_int32_t *, t2); \
*tl++ = txdr_unsigned(VTONFS(v)->n_fhsize); \
*(tl + ((t2>>2) - 2)) = 0; \
bcopy((caddr_t)VTONFS(v)->n_fhp,(caddr_t)tl, \
@ -136,7 +136,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FH); \
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
} else { \
@ -145,7 +145,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} }
#define nfsm_srvpostop_fh(f) \
{ nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
{ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = nfs_true; \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
@ -154,7 +154,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_mtofh(d, v, v3, f) \
{ struct nfsnode *ttnp; nfsfh_t *ttfhp; int ttfhsize; \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(f) = fxdr_unsigned(int, *tl); \
} else \
(f) = 1; \
@ -169,7 +169,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(v) = NFSTOV(ttnp); \
} \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (f) \
(f) = fxdr_unsigned(int, *tl); \
else if (fxdr_unsigned(int, *tl)) \
@ -181,7 +181,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_getfh(f, s, v3) \
{ if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int, *tl)) <= 0 || \
(s) > NFSX_V3FHMAX) { \
m_freem(mrep); \
@ -203,8 +203,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_postop_attr(v, f) \
{ struct vnode *ttvp = (v); \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
if ((f) = fxdr_unsigned(int, *tl)) { \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((f) = fxdr_unsigned(int, *tl)) != 0) { \
if ((t1 = nfs_loadattrcache(&ttvp, &md, &dpos, \
(struct vattr *)0)) != 0) { \
error = t1; \
@ -221,12 +221,12 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_wcc_data(v, f) \
{ int ttattrf, ttretf = 0; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED); \
if (f) \
ttretf = (VTONFS(v)->n_mtime == \
fxdr_unsigned(u_long, *(tl + 2))); \
fxdr_unsigned(u_int32_t, *(tl + 2))); \
} \
nfsm_postop_attr((v), ttattrf); \
if (f) { \
@ -248,23 +248,23 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
}
#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); \
} }
#define nfsm_srvnamesiz(s) \
{ nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(long,*tl)) > NFS_MAXNAMLEN) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int32_t,*tl)) > NFS_MAXNAMLEN) \
error = NFSERR_NAMETOL; \
if ((s) <= 0) \
error = EBADRPC; \
@ -312,7 +312,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
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((const char *)(a), (caddr_t)tl, (s)); \
@ -369,7 +369,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvmtofh(f) \
{ int fhlen = NFSX_V3FH; \
if (nfsd->nd_flag & ND_NFSV3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
fhlen = fxdr_unsigned(int, *tl); \
if (fhlen == 0) { \
bzero((caddr_t)(f), NFSX_V3FH); \
@ -379,7 +379,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
} \
if (fhlen != 0) { \
nfsm_dissect(tl, u_long *, NFSX_V3FH); \
nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
if ((nfsd->nd_flag & ND_NFSV3) == 0) \
nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
@ -398,7 +398,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
bp = mtod(mp, caddr_t); \
be = bp+mp->m_len; \
} \
tl = (u_long *)bp
tl = (u_int32_t *)bp
#define nfsm_srvfillattr(a, f) \
nfsm_srvfattr(nfsd, (a), (f))
@ -410,40 +410,40 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
nfsm_srvpostopattr(nfsd, (r), (a), &mb, &bpos)
#define nfsm_srvsattr(a) \
{ nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
{ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_mode = nfstov_mode(*tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_uid = fxdr_unsigned(uid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_gid = fxdr_unsigned(gid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_hyper(tl, &(a)->va_size); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
getnanotime(&(a)->va_atime); \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95
* $Id: nfs_nqlease.c,v 1.35 1998/05/24 14:41:51 peter Exp $
* $Id: nfs_nqlease.c,v 1.36 1998/05/31 17:27:46 peter Exp $
*/
@ -91,7 +91,7 @@ extern void nqnfs_lease_updatetime __P((int deltat));
static int nqnfs_vacated __P((struct vnode *vp, struct ucred *cred));
static void nqsrv_addhost __P((struct nqhost *lph, struct nfssvc_sock *slp,
struct sockaddr *nam));
static void nqsrv_instimeq __P((struct nqlease *lp, u_long duration));
static void nqsrv_instimeq __P((struct nqlease *lp, u_int32_t duration));
static void nqsrv_locklease __P((struct nqlease *lp));
static void nqsrv_send_eviction __P((struct vnode *vp, struct nqlease *lp,
struct nfssvc_sock *slp,
@ -169,7 +169,7 @@ extern int nfs_mount_type;
int
nqsrv_getlease(vp, duration, flags, slp, procp, nam, cachablep, frev, cred)
struct vnode *vp;
u_long *duration;
u_int32_t *duration;
int flags;
struct nfssvc_sock *slp;
struct proc *procp;
@ -179,8 +179,8 @@ nqsrv_getlease(vp, duration, flags, slp, procp, nam, cachablep, frev, cred)
struct ucred *cred;
{
register struct nqlease *lp;
register struct nqfhhashhead *lpp = 0;
register struct nqhost *lph = 0;
register struct nqfhhashhead *lpp = NULL;
register struct nqhost *lph = NULL;
struct nqlease *tlp;
struct nqm **lphp;
struct vattr vattr;
@ -214,7 +214,7 @@ nqsrv_getlease(vp, duration, flags, slp, procp, 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;
@ -312,7 +312,7 @@ nqsrv_getlease(vp, duration, flags, slp, procp, nam, cachablep, frev, cred)
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));
if(!lpp)
panic("nfs_nqlease.c: Phoney lpp");
LIST_INSERT_HEAD(lpp, lp, lc_hash);
@ -340,7 +340,7 @@ nqnfs_lease_check(vp, p, cred, flag)
struct ucred *cred;
int flag;
{
u_long duration = 0;
u_int32_t duration = 0;
int cache;
u_quad_t frev;
@ -357,7 +357,7 @@ nqnfs_vop_lease_check(ap)
int a_flag;
} */ *ap;
{
u_long duration = 0;
u_int32_t duration = 0;
int cache;
u_quad_t frev;
@ -403,7 +403,7 @@ nqsrv_addhost(lph, slp, nam)
static void
nqsrv_instimeq(lp, duration)
register struct nqlease *lp;
u_long duration;
u_int32_t duration;
{
register struct nqlease *tlp;
time_t newexpiry;
@ -499,7 +499,7 @@ nqsrv_send_eviction(vp, lp, slp, nam, cred)
nfsfh_t nfh;
fhandle_t *fhp;
caddr_t bpos, cp;
u_long xid, *tl;
u_int32_t xid, *tl;
int len = 1, ok = 1, i = 0;
int sotype, *solockp;
@ -556,7 +556,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 &&
@ -739,8 +739,8 @@ nqnfsrv_getlease(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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;
@ -750,7 +750,7 @@ nqnfsrv_getlease(nfsd, slp, procp, 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);
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly,
@ -767,7 +767,7 @@ nqnfsrv_getlease(nfsd, slp, procp, mrq)
error = VOP_GETATTR(vp, vap, cred, procp);
vput(vp);
nfsm_reply(NFSX_V3FATTR + 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);
@ -795,8 +795,8 @@ nqnfsrv_vacated(nfsd, slp, procp, mrq)
struct nqlease *tlp = (struct nqlease *)0;
nfsfh_t nfh;
fhandle_t *fhp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct nqm *lphnext;
struct mbuf *mreq, *mb;
int error = 0, i, len, ok, gotit = 0, cache = 0;
@ -865,9 +865,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, t2;
register int32_t t1, t2;
register struct nfsnode *np;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
caddr_t bpos, dpos, cp2;
@ -881,13 +881,13 @@ nqnfs_getlease(vp, rwflag, cred, p)
mb = mreq = nfsm_reqh(vp, NQNFSPROC_GETLEASE, NFSX_V3FH+2*NFSX_UNSIGNED,
&bpos);
nfsm_fhtom(vp, 1);
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_second;
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_second) {
@ -911,10 +911,10 @@ nqnfs_vacated(vp, cred)
register caddr_t cp;
register struct mbuf *m;
register int i;
register u_long *tl;
register long t2;
register u_int32_t *tl;
register int32_t t2;
caddr_t bpos;
u_long xid;
u_int32_t xid;
int error = 0;
struct mbuf *mreq, *mb, *mb2, *mheadend;
struct nfsmount *nmp;
@ -935,7 +935,7 @@ nqnfs_vacated(vp, cred)
0, (char *)NULL, 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;
@ -962,8 +962,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;
nfsfh_t nfh;
fhandle_t *fhp;
struct nfsnode *np;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95
* $Id: nfs_serv.c,v 1.66 1998/05/31 19:10:52 peter Exp $
* $Id: nfs_serv.c,v 1.67 1998/05/31 19:43:34 peter Exp $
*/
/*
@ -91,8 +91,8 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
NFCHR, NFNON };
/* Global vars */
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;
extern enum vtype nv3tov_type[8];
extern struct nfsstats nfsstats;
@ -124,8 +124,8 @@ nfsrv3_access(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, getret;
char *cp2;
@ -139,7 +139,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
#endif
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly,
(nfsd->nd_flag & ND_KERBAUTH), TRUE);
if (error) {
@ -147,7 +147,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(1, (struct vattr *)0);
return (0);
}
nfsmode = fxdr_unsigned(u_long, *tl);
nfsmode = fxdr_unsigned(u_int32_t, *tl);
if ((nfsmode & NFSV3ACCESS_READ) &&
nfsrv_access(vp, VREAD, cred, rdonly, procp, 0))
nfsmode &= ~NFSV3ACCESS_READ;
@ -170,7 +170,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
vput(vp);
nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, vap);
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(nfsmode);
nfsm_srvdone;
}
@ -195,8 +195,8 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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;
@ -243,8 +243,8 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, preat_ret = 1, postat_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), gcheck = 0;
@ -258,10 +258,10 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
VATTR_NULL(vap);
if (v3) {
nfsm_srvsattr(vap);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
gcheck = fxdr_unsigned(int, *tl);
if (gcheck) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
fxdr_nfsv3time(tl, &guard);
}
} else {
@ -286,7 +286,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
fxdr_nfsv2time(&sp->sa_atime, &vap->va_atime);
#else
vap->va_atime.tv_sec =
fxdr_unsigned(long, sp->sa_atime.nfsv2_sec);
fxdr_unsigned(int32_t, sp->sa_atime.nfsv2_sec);
vap->va_atime.tv_nsec = 0;
#endif
}
@ -374,8 +374,8 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
nfsfh_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, len, dirattr_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), pubflag;
@ -492,8 +492,8 @@ nfsrv_readlink(nfsd, slp, procp, 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, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -573,7 +573,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
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;
@ -597,8 +597,8 @@ nfsrv_read(nfsd, slp, procp, mrq)
struct iovec *iv2;
register struct mbuf *m;
register struct nfs_fattr *fp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
register int i;
caddr_t bpos;
int error = 0, rdonly, cache, cnt, len, left, siz, tlen, getret;
@ -617,11 +617,11 @@ nfsrv_read(nfsd, slp, procp, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
fxdr_hyper(tl, &off);
} else {
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);
}
nfsm_srvstrsiz(reqlen, NFS_SRVMAXDATA(nfsd));
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam,
@ -659,14 +659,14 @@ nfsrv_read(nfsd, slp, procp, mrq)
cnt = reqlen;
nfsm_reply(NFSX_POSTOPORFATTR(v3) + 3 * NFSX_UNSIGNED+nfsm_rndup(cnt));
if (v3) {
nfsm_build(tl, u_long *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V3FATTR / sizeof (u_long));
tl += (NFSX_V3FATTR / sizeof (u_int32_t));
} else {
nfsm_build(tl, u_long *, NFSX_V2FATTR + NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_V2FATTR + NFSX_UNSIGNED);
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V2FATTR / sizeof (u_long));
tl += (NFSX_V2FATTR / sizeof (u_int32_t));
}
len = left = cnt;
if (cnt > 0) {
@ -766,8 +766,8 @@ nfsrv_write(nfsd, slp, procp, mrq)
struct iovec *iv;
struct vattr va, forat;
register struct vattr *vap = &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, len, forat_ret = 1;
int ioflags, aftat_ret = 1, retlen, zeroing, adjust;
@ -789,18 +789,18 @@ nfsrv_write(nfsd, slp, procp, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &off);
tl += 3;
stable = fxdr_unsigned(int, *tl++);
} else {
nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
off = (off_t)fxdr_unsigned(u_long, *++tl);
nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
off = (off_t)fxdr_unsigned(u_int32_t, *++tl);
tl += 2;
if (nfs_async)
stable = NFSV3WRITE_UNSTABLE;
}
retlen = len = fxdr_unsigned(long, *tl);
retlen = len = fxdr_unsigned(int32_t, *tl);
cnt = i = 0;
/*
@ -912,7 +912,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(forat_ret, &forat, aftat_ret, vap);
if (error)
return (0);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(retlen);
/*
* If nfs_async is set, then pretend the write was FILESYNC.
@ -958,8 +958,8 @@ nfsrv_writegather(ndp, slp, procp, mrq)
struct nfsrvw_delayhash *wpp;
struct ucred *cred;
struct vattr va, forat;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
caddr_t bpos, dpos;
int error = 0, rdonly, cache, len, forat_ret = 1;
int ioflags, aftat_ret = 1, s, adjust, v3, zeroing;
@ -994,18 +994,18 @@ nfsrv_writegather(ndp, slp, procp, mrq)
*/
nfsm_srvmtofh(&nfsd->nd_fh);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &nfsd->nd_off);
tl += 3;
nfsd->nd_stable = fxdr_unsigned(int, *tl++);
} else {
nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsd->nd_off = (off_t)fxdr_unsigned(u_long, *++tl);
nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
nfsd->nd_off = (off_t)fxdr_unsigned(u_int32_t, *++tl);
tl += 2;
if (nfs_async)
nfsd->nd_stable = NFSV3WRITE_UNSTABLE;
}
len = fxdr_unsigned(long, *tl);
len = fxdr_unsigned(int32_t, *tl);
nfsd->nd_len = len;
nfsd->nd_eoff = nfsd->nd_off + len;
@ -1198,7 +1198,7 @@ nfsrv_writegather(ndp, slp, procp, mrq)
NFSX_WRITEVERF(v3), v3);
if (v3) {
nfsm_srvwcc_data(forat_ret, &forat, aftat_ret, &va);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nfsd->nd_len);
*tl++ = txdr_unsigned(swp->nd_stable);
/*
@ -1328,10 +1328,10 @@ nfsrv_create(nfsd, slp, procp, mrq)
struct vattr va, dirfor, diraft;
register struct vattr *vap = &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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
@ -1373,7 +1373,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
}
VATTR_NULL(vap);
if (v3) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
how = fxdr_unsigned(int, *tl);
switch (how) {
case NFSV3CREATE_GUARDED:
@ -1395,13 +1395,13 @@ nfsrv_create(nfsd, slp, procp, mrq)
vap->va_type = VREG;
} else {
nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
vap->va_type = IFTOVT(fxdr_unsigned(u_long, sp->sa_mode));
vap->va_type = IFTOVT(fxdr_unsigned(u_int32_t, sp->sa_mode));
if (vap->va_type == VNON)
vap->va_type = VREG;
vap->va_mode = nfstov_mode(sp->sa_mode);
switch (vap->va_type) {
case VREG:
tsize = fxdr_unsigned(long, sp->sa_size);
tsize = fxdr_unsigned(int32_t, sp->sa_size);
if (tsize != -1)
vap->va_size = (u_quad_t)tsize;
break;
@ -1569,12 +1569,12 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
register struct vattr *vap = &va;
register u_long *tl;
register u_int32_t *tl;
struct nameidata nd;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
u_long major, minor;
u_int32_t major, minor;
enum vtype vtyp;
char *cp2;
struct mbuf *mb, *mb2, *mreq;
@ -1601,7 +1601,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
vrele(dirp);
return (0);
}
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
vtyp = nfsv3tov_type(*tl);
if (vtyp != VCHR && vtyp != VBLK && vtyp != VSOCK && vtyp != VFIFO) {
vrele(nd.ni_startdir);
@ -1614,9 +1614,9 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
VATTR_NULL(vap);
nfsm_srvsattr(vap);
if (vtyp == VCHR || vtyp == VBLK) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
major = fxdr_unsigned(u_long, *tl++);
minor = fxdr_unsigned(u_long, *tl);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
major = fxdr_unsigned(u_int32_t, *tl++);
minor = fxdr_unsigned(u_int32_t, *tl);
vap->va_rdev = makedev(major, minor);
}
@ -1720,8 +1720,8 @@ nfsrv_remove(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -1805,8 +1805,8 @@ nfsrv_rename(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, fdirfor_ret = 1, fdiraft_ret = 1;
int tdirfor_ret = 1, tdiraft_ret = 1;
@ -2012,8 +2012,8 @@ nfsrv_link(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, dirfor_ret = 1, diraft_ret = 1;
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2115,8 +2115,8 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
struct vattr va, dirfor, diraft;
struct nameidata nd;
register struct vattr *vap = &va;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct nfsv2_sattr *sp;
char *bpos, *pathcp = (char *)0, *cp2;
struct uio io;
@ -2166,7 +2166,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
nfsm_mtouio(&io, len2);
if (!v3) {
nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
vap->va_mode = fxdr_unsigned(u_short, sp->sa_mode);
vap->va_mode = fxdr_unsigned(u_int16_t, sp->sa_mode);
}
*(pathcp + len2) = '\0';
if (nd.ni_vp) {
@ -2261,8 +2261,8 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
register struct nfs_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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2301,7 +2301,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
if (v3) {
nfsm_srvsattr(vap);
} else {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
vap->va_mode = nfstov_mode(*tl++);
}
vap->va_type = VDIR;
@ -2373,8 +2373,8 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2485,11 +2485,11 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
*/
struct flrep {
nfsuint64 fl_off;
u_long fl_postopok;
u_long fl_fattr[NFSX_V3FATTR / sizeof (u_long)];
u_long fl_fhok;
u_long fl_fhsize;
u_long fl_nfh[NFSX_V3FH / sizeof (u_long)];
u_int32_t fl_postopok;
u_int32_t fl_fattr[NFSX_V3FATTR / sizeof (u_int32_t)];
u_int32_t fl_fhok;
u_int32_t fl_fhsize;
u_int32_t fl_nfh[NFSX_V3FH / sizeof (u_int32_t)];
};
int
@ -2507,8 +2507,8 @@ nfsrv_readdir(nfsd, slp, procp, 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;
@ -2522,18 +2522,18 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
int siz, cnt, fullsiz, eofflag, rdonly, cache, ncookies;
int v3 = (nfsd->nd_flag & ND_NFSV3);
u_quad_t frev, off, toff, verf;
u_long *cookies = NULL, *cookiep;
u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &toff);
tl += 2;
fxdr_hyper(tl, &verf);
tl += 2;
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
toff = fxdr_unsigned(u_quad_t, *tl++);
}
off = toff;
@ -2621,11 +2621,11 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
2 * NFSX_UNSIGNED);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
tl += 2;
} else
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)rbuf, M_TEMP);
@ -2667,7 +2667,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_COOKIEVERF(v3) + siz);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
}
mp = mp2 = mb;
@ -2720,7 +2720,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
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;
@ -2774,8 +2774,8 @@ nfsrv_readdirplus(nfsd, slp, procp, 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;
@ -2790,11 +2790,11 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1;
int siz, cnt, fullsiz, eofflag, rdonly, cache, dirlen, ncookies;
u_quad_t frev, off, toff, verf;
u_long *cookies = NULL, *cookiep;
u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
fxdr_hyper(tl, &toff);
tl += 2;
fxdr_hyper(tl, &verf);
@ -2881,7 +2881,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF +
2 * NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
tl += 2;
*tl++ = nfs_false;
@ -2939,7 +2939,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED;
nfsm_reply(cnt);
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
mp = mp2 = mb;
bp = bpos;
@ -3024,7 +3024,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
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';
@ -3090,8 +3090,8 @@ nfsrv_commit(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, for_ret = 1, aft_ret = 1, cnt, cache;
char *cp2;
@ -3103,7 +3103,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
#endif
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
/*
* XXX At this time VOP_FSYNC() does not accept offset and byte
@ -3130,7 +3130,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
nfsm_build(tl, u_long *, NFSX_V3WRITEVERF);
nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
*tl++ = txdr_unsigned(boottime.tv_sec);
*tl = txdr_unsigned(boottime.tv_usec);
} else
@ -3154,8 +3154,8 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
register struct statfs *sf;
register struct nfs_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, getret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -3231,9 +3231,9 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register u_int32_t *tl;
register struct nfsv3_fsinfo *sip;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1, pref;
char *cp2;
@ -3307,9 +3307,9 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register u_int32_t *tl;
register struct nfsv3_pathconf *pc;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1, linkmax, namemax;
int chownres, notrunc;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_socket.c,v 1.38 1998/05/31 18:08:09 peter Exp $
* $Id: nfs_socket.c,v 1.39 1998/05/31 19:49:30 peter Exp $
*/
/*
@ -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,
extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers,
rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr,
rpc_auth_kerb;
extern u_long nfs_prog, nqnfs_prog;
extern u_int32_t nfs_prog, nqnfs_prog;
extern time_t nqnfsstarttime;
extern struct nfsstats nfsstats;
extern int nfsv3_procid[NFS_NPROCS];
@ -191,7 +191,7 @@ nfs_connect(nmp, rep)
struct sockaddr *saddr;
struct sockaddr_in *sin;
struct mbuf *m;
u_short tport;
u_int16_t tport;
struct proc *p = &proc0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
@ -283,20 +283,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, p);
}
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, p);
}
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;
}
error = soreserve(so, sndreserve, rcvreserve);
if (error)
@ -371,11 +371,11 @@ nfs_disconnect(nmp)
}
}
void
void
nfs_safedisconnect(nmp)
struct nfsmount *nmp;
{
struct nfsreq dummyreq;
struct nfsreq dummyreq;
bzero(&dummyreq, sizeof(dummyreq));
dummyreq.r_nmp = nmp;
@ -476,7 +476,7 @@ nfs_receive(rep, aname, mp)
struct iovec aio;
register struct mbuf *m;
struct mbuf *control;
u_long len;
u_int32_t len;
struct sockaddr **getnam;
int error, sotype, rcvflg;
struct proc *p = curproc; /* XXX */
@ -543,13 +543,13 @@ nfs_receive(rep, aname, mp)
nfs_sndunlock(&rep->r_nmp->nm_flag, &rep->r_nmp->nm_state);
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;
@ -572,8 +572,8 @@ nfs_receive(rep, aname, mp)
if (auio.uio_resid != sizeof (u_int32_t))
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;
}
@ -703,10 +703,10 @@ nfs_reply(myrep)
{
register struct nfsreq *rep;
register struct nfsmount *nmp = myrep->r_nmp;
register long t1;
register int32_t t1;
struct mbuf *mrep, *md;
struct sockaddr *nam;
u_long rxid, *tl;
u_int32_t rxid, *tl;
caddr_t dpos, cp2;
int error;
@ -756,7 +756,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) {
#ifndef NFS_NOSERVER
@ -885,7 +885,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;
@ -896,7 +896,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
int t1, nqlflag, cachable, s, error = 0, mrest_len, auth_len, auth_type;
int trylater_delay = NQ_TRYLATERDEL, trylater_cnt = 0, failed_auth = 0;
int verf_len, verf_type;
u_long xid;
u_int32_t xid;
u_quad_t frev;
char *auth_str, *verf_str;
NFSKERBKEY_T key; /* save session key */
@ -953,7 +953,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
*/
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;
@ -1050,7 +1050,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
/*
* 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;
@ -1075,17 +1075,17 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* Grab any Kerberos verifier, otherwise just throw it away.
*/
verf_type = fxdr_unsigned(int, *tl++);
i = fxdr_unsigned(int, *tl);
i = fxdr_unsigned(int32_t, *tl);
if ((nmp->nm_flag & NFSMNT_KERB) && verf_type == RPCAUTH_KERB4) {
error = nfs_savenickauth(nmp, cred, i, key, &md, &dpos, mrep);
if (error)
goto nfsmout;
} else if (i > 0)
nfsm_adv(nfsm_rndup(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);
if ((nmp->nm_flag & NFSMNT_NFSV3) &&
@ -1124,11 +1124,11 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* 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_second) {
@ -1170,7 +1170,7 @@ nfs_rephead(siz, nd, slp, 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;
@ -1186,7 +1186,7 @@ nfs_rephead(siz, nd, slp, 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);
@ -1238,7 +1238,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*tl++ = rpc_auth_kerb;
*tl++ = txdr_unsigned(3 * NFSX_UNSIGNED);
*tl = ktvout.tv_sec;
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = ktvout.tv_usec;
*tl++ = txdr_unsigned(nuidp->nu_cr.cr_uid);
} else {
@ -1255,7 +1255,7 @@ nfs_rephead(siz, nd, slp, 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);
if (nd->nd_flag & ND_NQNFS) {
*tl++ = txdr_unsigned(3);
*tl = txdr_unsigned(3);
@ -1273,7 +1273,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
default:
*tl = 0;
if (err != NFSERR_RETVOID) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap(nd, err));
else
@ -1288,13 +1288,13 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*/
if ((nd->nd_flag & ND_NQNFS) && err == 0) {
if (nd->nd_flag & ND_LEASE) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nd->nd_flag & ND_LEASE);
*tl++ = txdr_unsigned(cache);
*tl++ = txdr_unsigned(nd->nd_duration);
txdr_hyper(frev, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@ -1679,12 +1679,12 @@ nfs_getreq(nd, nfsd, 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, cp;
u_long nfsvers, auth_type;
u_int32_t nfsvers, auth_type;
uid_t nickuid;
int error = 0, nqnfs = 0, ticklen;
struct mbuf *mrep, *md;
@ -1698,14 +1698,14 @@ nfs_getreq(nd, nfsd, 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;
nd->nd_flag = 0;
if (*tl++ != rpc_vers) {
@ -1723,7 +1723,7 @@ nfs_getreq(nd, nfsd, has_header)
}
}
tl++;
nfsvers = fxdr_unsigned(u_long, *tl++);
nfsvers = fxdr_unsigned(u_int32_t, *tl++);
if (((nfsvers < NFS_VER2 || nfsvers > NFS_VER3) && !nqnfs) ||
(nfsvers != NQNFS_VER3 && nqnfs)) {
nd->nd_repstat = EPROGMISMATCH;
@ -1734,7 +1734,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_flag = (ND_NFSV3 | ND_NQNFS);
else if (nfsvers == NFS_VER3)
nd->nd_flag = ND_NFSV3;
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 ||
@ -1764,7 +1764,7 @@ nfs_getreq(nd, nfsd, 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);
bzero((caddr_t)&nd->nd_cr, sizeof (struct ucred));
nd->nd_cr.cr_ref = 1;
nd->nd_cr.cr_uid = fxdr_unsigned(uid_t, *tl++);
@ -1774,7 +1774,7 @@ nfs_getreq(nd, nfsd, 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 = 1; i <= len; i++)
if (i < NGROUPS)
nd->nd_cr.cr_groups[i] = fxdr_unsigned(gid_t, *tl++);
@ -1794,7 +1794,7 @@ nfs_getreq(nd, nfsd, has_header)
switch (fxdr_unsigned(int, *tl++)) {
case RPCAKN_FULLNAME:
ticklen = fxdr_unsigned(int, *tl);
*((u_long *)nfsd->nfsd_authstr) = *tl;
*((u_int32_t *)nfsd->nfsd_authstr) = *tl;
uio.uio_resid = nfsm_rndup(ticklen) + NFSX_UNSIGNED;
nfsd->nfsd_authlen = uio.uio_resid + NFSX_UNSIGNED;
if (uio.uio_resid > (len - 2 * NFSX_UNSIGNED)) {
@ -1808,7 +1808,7 @@ nfs_getreq(nd, nfsd, has_header)
iov.iov_base = (caddr_t)&nfsd->nfsd_authstr[4];
iov.iov_len = RPCAUTH_MAXSIZ - 4;
nfsm_mtouio(&uio, uio.uio_resid);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 4 * NFSX_UNSIGNED) {
printf("Bad kerb verifier\n");
@ -1817,7 +1817,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nfsm_dissect(cp, caddr_t, 4 * NFSX_UNSIGNED);
tl = (u_long *)cp;
tl = (u_int32_t *)cp;
if (fxdr_unsigned(int, *tl) != RPCAKN_FULLNAME) {
printf("Not fullname kerb verifier\n");
nd->nd_repstat = (NFSERR_AUTHERR|AUTH_BADVERF);
@ -1838,7 +1838,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nickuid = fxdr_unsigned(uid_t, *tl);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 3 * NFSX_UNSIGNED) {
printf("Kerb nick verifier bad\n");
@ -1846,7 +1846,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_procnum = NFSPROC_NOOP;
return (0);
}
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
tvin.tv_sec = *tl++;
tvin.tv_usec = *tl;
@ -1898,11 +1898,11 @@ nfs_getreq(nd, nfsd, 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_flag |= fxdr_unsigned(int, *tl);
if (nd->nd_flag & ND_LEASE) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int, *tl);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int32_t, *tl);
} else
nd->nd_duration = NQ_MINLEASE;
} else
@ -2066,7 +2066,7 @@ nfsrv_getstream(slp, waitflag)
register char *cp1, *cp2;
register int len;
struct mbuf *om, *m2, *recm = NULL;
u_long recmark;
u_int32_t recmark;
if (slp->ns_flag & SLP_GETSTREAM)
panic("nfs getstream");

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
* $Id: nfs_subs.c,v 1.59 1998/05/31 18:11:03 peter Exp $
* $Id: nfs_subs.c,v 1.60 1998/05/31 19:16:08 peter Exp $
*/
/*
@ -83,14 +83,14 @@
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
*/
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_auth_kerb;
u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false;
u_int32_t nfs_prog, nqnfs_prog, nfs_true, nfs_false;
/* And other global data */
static u_long nfs_xid = 0;
static u_int32_t nfs_xid = 0;
static enum vtype nv2tov_type[8]= {
VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON
};
@ -580,7 +580,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;
@ -600,11 +600,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;
}
}
@ -634,15 +634,15 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
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;
int siz, grpsiz, authsiz;
static u_long base;
static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@ -660,7 +660,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* First the RPC header.
*/
nfsm_build(tl, u_long *, 8 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
/* Get a pretty random xid to start with */
if (!nfs_xid)
@ -696,7 +696,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
*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);
@ -736,7 +736,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* And the verifier...
*/
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (verf_str) {
*tl++ = txdr_unsigned(RPCAUTH_KERB4);
*tl = txdr_unsigned(verf_len);
@ -1038,14 +1038,14 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
{
register struct mbuf *m1 = NULL, *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;
@ -1066,7 +1066,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);
@ -1207,7 +1207,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
register struct vattr *vap;
register struct nfs_fattr *fp;
register struct nfsnode *np;
register long t1;
register int32_t t1;
caddr_t cp2;
int error = 0, rdev;
struct mbuf *md;
@ -1252,7 +1252,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
if (vtyp == VNON || (vtyp == VREG && (vmode & S_IFMT) != 0))
vtyp = IFTOVT(vmode);
rdev = fxdr_unsigned(long, fp->fa2_rdev);
rdev = fxdr_unsigned(int32_t, fp->fa2_rdev);
fxdr_nfsv2time(&fp->fa2_mtime, &mtime);
/*
@ -1313,7 +1313,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
fxdr_hyper(&fp->fa3_size, &vap->va_size);
vap->va_blocksize = NFS_FABLKSIZE;
fxdr_hyper(&fp->fa3_used, &vap->va_bytes);
vap->va_fileid = fxdr_unsigned(int, fp->fa3_fileid.nfsuquad[1]);
vap->va_fileid = fxdr_unsigned(int32_t,
fp->fa3_fileid.nfsuquad[1]);
fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime);
fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime);
vap->va_flags = 0;
@ -1322,15 +1323,17 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink);
vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid);
vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid);
vap->va_size = fxdr_unsigned(u_long, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(long, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(long, fp->fa2_blocks) * NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(int32_t, fp->fa2_blocks)
* NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t,
fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}
if (vap->va_size != np->n_size) {
@ -1763,13 +1766,13 @@ nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
if (before_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, 7 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&(before_vap->va_size), tl);
tl += 2;
@ -1792,14 +1795,14 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
register struct nfs_fattr *fp;
if (after_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_syscalls.c,v 1.39 1998/05/31 17:27:53 peter Exp $
* $Id: nfs_syscalls.c,v 1.40 1998/05/31 18:46:06 peter Exp $
*/
#include <sys/param.h>
@ -75,7 +75,7 @@
static MALLOC_DEFINE(M_NFSSVC, "NFS srvsock", "Nfs server structure");
/* Global defs. */
extern int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
extern int32_t (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
struct proc *procp,
struct mbuf **mreqp));
@ -401,15 +401,15 @@ nfssvc_addsock(fp, mynam, p)
*/
if (so->so_type == SOCK_STREAM) {
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, p);
}
if (so->so_proto->pr_domain->dom_family == AF_INET &&
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, p);
}
so->so_rcv.sb_flags &= ~SB_NOINTR;
@ -677,7 +677,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, solockp,
@ -1064,7 +1064,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
int verf_len;
{
register struct nfsuid *nuidp;
register u_long *nickp, *verfp;
register u_int32_t *nickp, *verfp;
struct timeval ktvin, ktvout;
#ifdef DIAGNOSTIC
@ -1085,7 +1085,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru);
TAILQ_INSERT_TAIL(&nmp->nm_uidlruhead, nuidp, nu_lru);
nickp = (u_long *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
nickp = (u_int32_t *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
*nickp++ = txdr_unsigned(RPCAKN_NICKNAME);
*nickp = txdr_unsigned(nuidp->nu_nickname);
*auth_str = (char *)nickp;
@ -1094,7 +1094,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
/*
* Now we must encrypt the verifier and package it up.
*/
verfp = (u_long *)verf_str;
verfp = (u_int32_t *)verf_str;
*verfp++ = txdr_unsigned(RPCAKN_NICKNAME);
if (time_second > nuidp->nu_timestamp.tv_sec ||
(time_second == nuidp->nu_timestamp.tv_sec &&
@ -1133,19 +1133,19 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
struct mbuf *mrep;
{
register struct nfsuid *nuidp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct mbuf *md = *mdp;
struct timeval ktvin, ktvout;
u_long nick;
u_int32_t nick;
char *dpos = *dposp, *cp2;
int deltasec, error = 0;
if (len == (3 * NFSX_UNSIGNED)) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
ktvin.tv_sec = *tl++;
ktvin.tv_usec = *tl++;
nick = fxdr_unsigned(u_long, *tl);
nick = fxdr_unsigned(u_int32_t, *tl);
/*
* Decrypt the timestamp in ecb mode.

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
* $Id: nfs_vfsops.c,v 1.67 1998/05/31 19:20:44 peter Exp $
* $Id: nfs_vfsops.c,v 1.68 1998/05/31 19:49:31 peter Exp $
*/
#include <sys/param.h>
@ -253,8 +253,8 @@ nfs_statfs(mp, sbp, p)
register struct vnode *vp;
register struct nfs_statfs *sfp;
register caddr_t cp;
register u_long *tl;
register long t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct nfsmount *nmp = VFSTONFS(mp);
int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
@ -297,15 +297,15 @@ nfs_statfs(mp, sbp, p)
sbp->f_bfree = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
fxdr_hyper(&sfp->sf_abytes, &tquad);
sbp->f_bavail = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
sbp->f_files = (fxdr_unsigned(long, sfp->sf_tfiles.nfsuquad[1])
& 0x7fffffff);
sbp->f_ffree = (fxdr_unsigned(long, sfp->sf_ffiles.nfsuquad[1])
& 0x7fffffff);
sbp->f_files = (fxdr_unsigned(int32_t,
sfp->sf_tfiles.nfsuquad[1]) & 0x7fffffff);
sbp->f_ffree = (fxdr_unsigned(int32_t,
sfp->sf_ffiles.nfsuquad[1]) & 0x7fffffff);
} else {
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);
sbp->f_files = 0;
sbp->f_ffree = 0;
}
@ -331,8 +331,8 @@ nfs_fsinfo(nmp, vp, cred, p)
{
register struct nfsv3_fsinfo *fsp;
register caddr_t cp;
register long t1, t2;
register u_long *tl, pref, max;
register int32_t t1, t2;
register u_int32_t *tl, pref, max;
caddr_t bpos, dpos, cp2;
int error = 0, retattr;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -345,27 +345,27 @@ nfs_fsinfo(nmp, vp, cred, p)
nfsm_postop_attr(vp, retattr);
if (!error) {
nfsm_dissect(fsp, struct nfsv3_fsinfo *, NFSX_V3FSINFO);
pref = fxdr_unsigned(u_long, fsp->fs_wtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_wtpref);
if (pref < nmp->nm_wsize && pref >= NFS_FABLKSIZE)
nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_wtmax);
max = fxdr_unsigned(u_int32_t, fsp->fs_wtmax);
if (max < nmp->nm_wsize) {
nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1);
if (nmp->nm_wsize == 0)
nmp->nm_wsize = max;
}
pref = fxdr_unsigned(u_long, fsp->fs_rtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_rtpref);
if (pref < nmp->nm_rsize && pref >= NFS_FABLKSIZE)
nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_rtmax);
max = fxdr_unsigned(u_int32_t, fsp->fs_rtmax);
if (max < nmp->nm_rsize) {
nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1);
if (nmp->nm_rsize == 0)
nmp->nm_rsize = max;
}
pref = fxdr_unsigned(u_long, fsp->fs_dtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_dtpref);
if (pref < nmp->nm_readdirsize)
nmp->nm_readdirsize = pref;
if (max < nmp->nm_readdirsize) {
@ -591,7 +591,7 @@ nfs_mountdiskless(path, which, mountflag, sin, args, p, vpp, mpp)
return (0);
}
static void
static void
nfs_decode_args(nmp, argp)
struct nfsmount *nmp;
struct nfs_args *argp;
@ -722,7 +722,7 @@ nfs_decode_args(nmp, argp)
while (nfs_connect(nmp, (struct nfsreq *)0)) {
printf("nfs_args: retrying connect\n");
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nfscon", 0);
PSOCK, "nfscon", 0);
}
}
}
@ -825,7 +825,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
{
register struct nfsmount *nmp;
struct nfsnode *np;
int error, maxio;
int error;
struct vattr attrs;
if (mp->mnt_flag & MNT_UPDATE) {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id: nfs_vnops.c,v 1.101 1998/05/31 19:28:15 peter Exp $
* $Id: nfs_vnops.c,v 1.102 1998/05/31 19:29:28 peter Exp $
*/
@ -59,6 +59,7 @@
#include <sys/dirent.h>
#include <sys/fcntl.h>
#include <sys/lockf.h>
#include <sys/stat.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@ -237,8 +238,8 @@ static int nfs_renameit __P((struct vnode *sdvp,
/*
* Global variables
*/
extern u_long nfs_true, nfs_false;
extern u_long nfs_xdrneg1;
extern u_int32_t nfs_true, nfs_false;
extern u_int32_t nfs_xdrneg1;
extern struct nfsstats nfsstats;
extern nfstype nfsv3_type[9];
struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
@ -262,13 +263,13 @@ nfs_access(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register int t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
u_long mode, rmode;
u_int32_t mode, rmode;
int v3 = NFS_ISV3(vp);
/*
@ -298,7 +299,7 @@ nfs_access(ap)
nfsstats.rpccnt[NFSPROC_ACCESS]++;
nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
nfsm_fhtom(vp, v3);
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
mode = NFSV3ACCESS_READ;
else
@ -319,8 +320,8 @@ nfs_access(ap)
nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
nfsm_postop_attr(vp, attrflag);
if (!error) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
rmode = fxdr_unsigned(u_long, *tl);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
rmode = fxdr_unsigned(u_int32_t, *tl);
/*
* The NFS V3 spec does not clarify whether or not
* the returned access bits can be a superset of
@ -533,8 +534,8 @@ nfs_getattr(ap)
register struct vnode *vp = ap->a_vp;
register struct nfsnode *np = VTONFS(vp);
register caddr_t cp;
register u_long *tl;
register int t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -608,7 +609,7 @@ nfs_setattr(ap)
case VFIFO:
if (vap->va_mtime.tv_sec == VNOVAL &&
vap->va_atime.tv_sec == VNOVAL &&
vap->va_mode == (u_short)VNOVAL &&
vap->va_mode == (mode_t)VNOVAL &&
vap->va_uid == (uid_t)VNOVAL &&
vap->va_gid == (gid_t)VNOVAL)
return (0);
@ -661,9 +662,9 @@ nfs_setattrrpc(vp, vap, cred, procp)
{
register struct nfsv2_sattr *sp;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
u_long *tl;
u_int32_t *tl;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
int v3 = NFS_ISV3(vp);
@ -672,69 +673,69 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
if (vap->va_mode != (u_short)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
if (vap->va_mode != (mode_t)VNOVAL) {
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_mode);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_uid != (uid_t)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_uid);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_gid != (gid_t)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_gid);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_size != VNOVAL) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&vap->va_size, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_atime.tv_sec != VNOVAL) {
if (vap->va_atime.tv_sec != time_second) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_atime, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != time_second) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_mtime, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
if (vap->va_mode == (u_short)VNOVAL)
if (vap->va_mode == (mode_t)VNOVAL)
sp->sa_mode = nfs_xdrneg1;
else
sp->sa_mode = vtonfsv2_mode(vp->v_type, vap->va_mode);
@ -778,9 +779,9 @@ nfs_lookup(ap)
struct vnode **vpp = ap->a_vpp;
int flags = cnp->cn_flags;
struct vnode *newvp;
u_long *tl;
u_int32_t *tl;
caddr_t cp;
long t1, t2;
int32_t t1, t2;
struct nfsmount *nmp;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1002,9 +1003,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, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, len, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1034,9 +1035,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, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct nfsmount *nmp;
@ -1055,7 +1056,7 @@ nfs_readrpc(vp, uiop, cred)
len = (tsiz > nmp->nm_rsize) ? nmp->nm_rsize : tsiz;
nfsm_reqhead(vp, NFSPROC_READ, NFSX_FH(v3) + NFSX_UNSIGNED * 3);
nfsm_fhtom(vp, v3);
nfsm_build(tl, u_long *, NFSX_UNSIGNED * 3);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED * 3);
if (v3) {
txdr_hyper(&uiop->uio_offset, tl);
*(tl + 2) = txdr_unsigned(len);
@ -1071,7 +1072,7 @@ nfs_readrpc(vp, uiop, cred)
m_freem(mrep);
goto nfsmout;
}
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
eof = fxdr_unsigned(int, *(tl + 1));
} else
nfsm_loadattr(vp, (struct vattr *)0);
@ -1099,9 +1100,9 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
struct ucred *cred;
int *iomode, *must_commit;
{
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register int t1, t2, backup;
register int32_t t1, t2, backup;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
@ -1123,18 +1124,18 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len));
nfsm_fhtom(vp, v3);
if (v3) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
txdr_hyper(&uiop->uio_offset, tl);
tl += 2;
*tl++ = txdr_unsigned(len);
*tl++ = txdr_unsigned(*iomode);
*tl = txdr_unsigned(len);
} else {
register u_long x;
register u_int32_t x;
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
/* Set both "begin" and "current" to non-garbage. */
x = txdr_unsigned((u_long)uiop->uio_offset);
x = txdr_unsigned((u_int32_t)uiop->uio_offset);
*tl++ = x; /* "begin offset" */
*tl++ = x; /* "current offset" */
x = txdr_unsigned(len);
@ -1147,8 +1148,8 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
wccflag = NFSV3_WCCCHK;
nfsm_wcc_data(vp, wccflag);
if (!error) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED +
NFSX_V3WRITEVERF);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED
+ NFSX_V3WRITEVERF);
rlen = fxdr_unsigned(int, *tl++);
if (rlen == 0) {
error = NFSERR_IO;
@ -1216,9 +1217,9 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
{
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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 vnode *)0;
struct nfsnode *np = (struct nfsnode *)0;
struct vattr vattr;
@ -1226,7 +1227,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
caddr_t bpos, dpos;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
u_long rdev;
u_int32_t rdev;
int v3 = NFS_ISV3(dvp);
if (vap->va_type == VCHR || vap->va_type == VBLK)
@ -1247,12 +1248,12 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
sp3 = (struct nfsv3_sattr *)tl;
nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
*tl = txdr_unsigned(minor(vap->va_rdev));
}
@ -1338,9 +1339,9 @@ nfs_create(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
caddr_t bpos, dpos, cp2;
@ -1368,10 +1369,10 @@ nfs_create(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
nfsm_build(tl, u_long *, NFSX_V3CREATEVERF);
nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
#ifdef INET
if (!TAILQ_EMPTY(&in_ifaddrhead))
*tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
@ -1381,7 +1382,7 @@ nfs_create(ap)
*tl = ++create_verf;
} else {
*tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
nfsm_build(tl, u_long *, NFSX_V3SRVSATTR);
nfsm_build(tl, u_int32_t *, NFSX_V3SRVSATTR);
sp3 = (struct nfsv3_sattr *)tl;
nfsm_v3sattr(sp3, vap);
}
@ -1525,9 +1526,9 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
struct ucred *cred;
struct proc *proc;
{
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, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1646,9 +1647,9 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
struct ucred *cred;
struct proc *proc;
{
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, fwccflag = NFSV3_WCCRATTR, twccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1691,9 +1692,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 t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1755,9 +1756,9 @@ nfs_symlink(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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 slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1822,9 +1823,9 @@ nfs_mkdir(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
@ -1906,9 +1907,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 t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1999,9 +2000,9 @@ nfs_readdirrpc(vp, uiop, cred)
{
register int len, left;
register struct dirent *dp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
register nfsuint64 *cookiep;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -2041,13 +2042,13 @@ nfs_readdirrpc(vp, uiop, cred)
NFSX_READDIR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
*tl++ = dnp->n_cookieverf.nfsuquad[1];
} else {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
}
*tl = txdr_unsigned(nmp->nm_readdirsize);
@ -2055,7 +2056,8 @@ nfs_readdirrpc(vp, uiop, cred)
if (v3) {
nfsm_postop_attr(vp, attrflag);
if (!error) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
dnp->n_cookieverf.nfsuquad[0] = *tl++;
dnp->n_cookieverf.nfsuquad[1] = *tl;
} else {
@ -2063,17 +2065,19 @@ nfs_readdirrpc(vp, uiop, cred)
goto nfsmout;
}
}
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 */
while (more_dirs && bigenough) {
if (v3) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
3 * NFSX_UNSIGNED);
fxdr_hyper(tl, &fileno);
len = fxdr_unsigned(int, *(tl + 2));
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
fileno = fxdr_unsigned(u_quad_t, *tl++);
len = fxdr_unsigned(int, *tl);
}
@ -2120,9 +2124,11 @@ nfs_readdirrpc(vp, uiop, cred)
} else
nfsm_adv(nfsm_rndup(len));
if (v3) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
3 * NFSX_UNSIGNED);
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
}
if (bigenough) {
cookie.nfsuquad[0] = *tl++;
@ -2138,7 +2144,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);
}
m_freem(mrep);
@ -2183,9 +2189,9 @@ nfs_readdirplusrpc(vp, uiop, cred)
{
register int len, left;
register struct dirent *dp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
register struct vnode *newvp;
register nfsuint64 *cookiep;
caddr_t bpos, dpos, cp2, dpossav1, dpossav2;
@ -2229,7 +2235,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
nfsm_reqhead(vp, NFSPROC_READDIRPLUS,
NFSX_FH(1) + 6 * NFSX_UNSIGNED);
nfsm_fhtom(vp, 1);
nfsm_build(tl, u_long *, 6 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
@ -2242,14 +2248,14 @@ nfs_readdirplusrpc(vp, uiop, cred)
m_freem(mrep);
goto nfsmout;
}
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
dnp->n_cookieverf.nfsuquad[0] = *tl++;
dnp->n_cookieverf.nfsuquad[1] = *tl++;
more_dirs = fxdr_unsigned(int, *tl);
/* loop thru the dir entries, doctoring them to 4bsd form */
while (more_dirs && bigenough) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
fxdr_hyper(tl, &fileno);
len = fxdr_unsigned(int, *(tl + 2));
if (len <= 0 || len > NFS_MAXNAMLEN) {
@ -2296,7 +2302,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
uiop->uio_resid -= tlen;
} else
nfsm_adv(nfsm_rndup(len));
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
if (bigenough) {
cookie.nfsuquad[0] = *tl++;
cookie.nfsuquad[1] = *tl++;
@ -2313,7 +2319,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
dpossav1 = dpos;
mdsav1 = md;
nfsm_adv(NFSX_V3FATTR);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
doit = fxdr_unsigned(int, *tl);
if (doit) {
nfsm_getfh(fhp, fhsize, 1);
@ -2349,7 +2355,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
}
} else {
/* Just skip over the file handle */
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
i = fxdr_unsigned(int, *tl);
nfsm_adv(nfsm_rndup(i));
}
@ -2357,14 +2363,14 @@ nfs_readdirplusrpc(vp, uiop, cred)
vrele(newvp);
newvp = NULLVP;
}
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = fxdr_unsigned(int, *tl);
}
/*
* 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);
}
m_freem(mrep);
@ -2479,9 +2485,9 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
struct proc *procp;
struct nfsnode **npp;
{
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 vnode *)0;
struct nfsnode *np, *dnp = VTONFS(dvp);
caddr_t bpos, dpos, cp2;
@ -2558,8 +2564,8 @@ nfs_commit(vp, offset, cnt, cred, procp)
struct proc *procp;
{
register caddr_t cp;
register u_long *tl;
register int t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
register struct nfsmount *nmp = VFSTONFS(vp->v_mount);
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
@ -2570,14 +2576,14 @@ nfs_commit(vp, offset, cnt, cred, procp)
nfsstats.rpccnt[NFSPROC_COMMIT]++;
nfsm_reqhead(vp, NFSPROC_COMMIT, NFSX_FH(1));
nfsm_fhtom(vp, 1);
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
txdr_hyper(&offset, tl);
tl += 2;
*tl = txdr_unsigned(cnt);
nfsm_request(vp, NFSPROC_COMMIT, procp, cred);
nfsm_wcc_data(vp, wccflag);
if (!error) {
nfsm_dissect(tl, u_long *, NFSX_V3WRITEVERF);
nfsm_dissect(tl, u_int32_t *, NFSX_V3WRITEVERF);
if (bcmp((caddr_t)nmp->nm_verf, (caddr_t)tl,
NFSX_V3WRITEVERF)) {
bcopy((caddr_t)tl, (caddr_t)nmp->nm_verf,

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
* $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
* $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@ -59,7 +59,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
int auth_type, int auth_len, char *auth_str,
int verf_len, char *verf_str,
struct mbuf *mrest, int mrest_len,
struct mbuf **mbp, u_long *xidp));
struct mbuf **mbp, u_int32_t *xidp));
#define M_HASCL(m) ((m)->m_flags & M_EXT)
#define NFSMINOFF(m) \
@ -117,7 +117,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
{ if (v3) { \
t2 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED; \
if (t2 <= M_TRAILINGSPACE(mb)) { \
nfsm_build(tl, u_long *, t2); \
nfsm_build(tl, u_int32_t *, t2); \
*tl++ = txdr_unsigned(VTONFS(v)->n_fhsize); \
*(tl + ((t2>>2) - 2)) = 0; \
bcopy((caddr_t)VTONFS(v)->n_fhp,(caddr_t)tl, \
@ -136,7 +136,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FH); \
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
} else { \
@ -145,7 +145,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} }
#define nfsm_srvpostop_fh(f) \
{ nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
{ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = nfs_true; \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
@ -154,7 +154,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_mtofh(d, v, v3, f) \
{ struct nfsnode *ttnp; nfsfh_t *ttfhp; int ttfhsize; \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(f) = fxdr_unsigned(int, *tl); \
} else \
(f) = 1; \
@ -169,7 +169,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(v) = NFSTOV(ttnp); \
} \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (f) \
(f) = fxdr_unsigned(int, *tl); \
else if (fxdr_unsigned(int, *tl)) \
@ -181,7 +181,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_getfh(f, s, v3) \
{ if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int, *tl)) <= 0 || \
(s) > NFSX_V3FHMAX) { \
m_freem(mrep); \
@ -203,8 +203,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_postop_attr(v, f) \
{ struct vnode *ttvp = (v); \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
if ((f) = fxdr_unsigned(int, *tl)) { \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((f) = fxdr_unsigned(int, *tl)) != 0) { \
if ((t1 = nfs_loadattrcache(&ttvp, &md, &dpos, \
(struct vattr *)0)) != 0) { \
error = t1; \
@ -221,12 +221,12 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_wcc_data(v, f) \
{ int ttattrf, ttretf = 0; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED); \
if (f) \
ttretf = (VTONFS(v)->n_mtime == \
fxdr_unsigned(u_long, *(tl + 2))); \
fxdr_unsigned(u_int32_t, *(tl + 2))); \
} \
nfsm_postop_attr((v), ttattrf); \
if (f) { \
@ -248,23 +248,23 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
}
#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); \
} }
#define nfsm_srvnamesiz(s) \
{ nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(long,*tl)) > NFS_MAXNAMLEN) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int32_t,*tl)) > NFS_MAXNAMLEN) \
error = NFSERR_NAMETOL; \
if ((s) <= 0) \
error = EBADRPC; \
@ -312,7 +312,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
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((const char *)(a), (caddr_t)tl, (s)); \
@ -369,7 +369,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvmtofh(f) \
{ int fhlen = NFSX_V3FH; \
if (nfsd->nd_flag & ND_NFSV3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
fhlen = fxdr_unsigned(int, *tl); \
if (fhlen == 0) { \
bzero((caddr_t)(f), NFSX_V3FH); \
@ -379,7 +379,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
} \
if (fhlen != 0) { \
nfsm_dissect(tl, u_long *, NFSX_V3FH); \
nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
if ((nfsd->nd_flag & ND_NFSV3) == 0) \
nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
@ -398,7 +398,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
bp = mtod(mp, caddr_t); \
be = bp+mp->m_len; \
} \
tl = (u_long *)bp
tl = (u_int32_t *)bp
#define nfsm_srvfillattr(a, f) \
nfsm_srvfattr(nfsd, (a), (f))
@ -410,40 +410,40 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
nfsm_srvpostopattr(nfsd, (r), (a), &mb, &bpos)
#define nfsm_srvsattr(a) \
{ nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
{ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_mode = nfstov_mode(*tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_uid = fxdr_unsigned(uid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_gid = fxdr_unsigned(gid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_hyper(tl, &(a)->va_size); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
getnanotime(&(a)->va_atime); \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
* $Id: nfsproto.h,v 1.4 1998/05/31 17:27:58 peter Exp $
* $Id: nfsproto.h,v 1.5 1998/05/31 19:00:19 peter Exp $
*/
#ifndef _NFS_NFSPROTO_H_
@ -230,12 +230,12 @@
#define vtonfsv2_mode(t,m) \
txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
MAKEIMODE((t), (m)))
#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
#define vtonfsv3_mode(m) txdr_unsigned((m) & ALLPERMS)
#define nfstov_mode(a) (fxdr_unsigned(u_int32_t, (a)) & ALLPERMS)
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))])
#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))])
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
/* File types */
typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
@ -259,14 +259,14 @@ union nfsfh {
typedef union nfsfh nfsfh_t;
struct nfsv2_time {
u_long nfsv2_sec;
u_long nfsv2_usec;
u_int32_t nfsv2_sec;
u_int32_t nfsv2_usec;
};
typedef struct nfsv2_time nfstime2;
struct nfsv3_time {
u_long nfsv3_sec;
u_long nfsv3_nsec;
u_int32_t nfsv3_sec;
u_int32_t nfsv3_nsec;
};
typedef struct nfsv3_time nfstime3;
@ -275,7 +275,7 @@ typedef struct nfsv3_time nfstime3;
* protocol and to facilitate xdr conversion.
*/
struct nfs_uquad {
u_long nfsuquad[2];
u_int32_t nfsuquad[2];
};
typedef struct nfs_uquad nfsuint64;
@ -283,7 +283,7 @@ typedef struct nfs_uquad nfsuint64;
* Used to convert between two u_longs and a u_quad_t.
*/
union nfs_quadconvert {
u_long lval[2];
u_int32_t lval[2];
u_quad_t qval;
};
typedef union nfs_quadconvert nfsquad_t;
@ -292,8 +292,8 @@ typedef union nfs_quadconvert nfsquad_t;
* NFS Version 3 special file number.
*/
struct nfsv3_spec {
u_long specdata1;
u_long specdata2;
u_int32_t specdata1;
u_int32_t specdata2;
};
typedef struct nfsv3_spec nfsv3spec;
@ -307,19 +307,19 @@ typedef struct nfsv3_spec nfsv3spec;
* NFSX_FATTR(v3) macro.
*/
struct nfs_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 nfsv2fa_size;
u_long nfsv2fa_blocksize;
u_long nfsv2fa_rdev;
u_long nfsv2fa_blocks;
u_long nfsv2fa_fsid;
u_long nfsv2fa_fileid;
u_int32_t nfsv2fa_size;
u_int32_t nfsv2fa_blocksize;
u_int32_t nfsv2fa_rdev;
u_int32_t nfsv2fa_blocks;
u_int32_t nfsv2fa_fsid;
u_int32_t nfsv2fa_fileid;
nfstime2 nfsv2fa_atime;
nfstime2 nfsv2fa_mtime;
nfstime2 nfsv2fa_ctime;
@ -357,10 +357,10 @@ struct nfs_fattr {
#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
struct nfsv2_sattr {
u_long sa_mode;
u_long sa_uid;
u_long sa_gid;
u_long sa_size;
u_int32_t sa_mode;
u_int32_t sa_uid;
u_int32_t sa_gid;
u_int32_t sa_size;
nfstime2 sa_atime;
nfstime2 sa_mtime;
};
@ -369,25 +369,25 @@ struct nfsv2_sattr {
* NFS Version 3 sattr structure for the new node creation case.
*/
struct nfsv3_sattr {
u_long sa_modetrue;
u_long sa_mode;
u_long sa_uidfalse;
u_long sa_gidfalse;
u_long sa_sizefalse;
u_long sa_atimetype;
u_int32_t sa_modetrue;
u_int32_t sa_mode;
u_int32_t sa_uidfalse;
u_int32_t sa_gidfalse;
u_int32_t sa_sizefalse;
u_int32_t sa_atimetype;
nfstime3 sa_atime;
u_long sa_mtimetype;
u_int32_t sa_mtimetype;
nfstime3 sa_mtime;
};
struct nfs_statfs {
union {
struct {
u_long nfsv2sf_tsize;
u_long nfsv2sf_bsize;
u_long nfsv2sf_blocks;
u_long nfsv2sf_bfree;
u_long nfsv2sf_bavail;
u_int32_t nfsv2sf_tsize;
u_int32_t nfsv2sf_bsize;
u_int32_t nfsv2sf_blocks;
u_int32_t nfsv2sf_bfree;
u_int32_t nfsv2sf_bavail;
} sf_nfsv2;
struct {
nfsuint64 nfsv3sf_tbytes;
@ -396,7 +396,7 @@ struct nfs_statfs {
nfsuint64 nfsv3sf_tfiles;
nfsuint64 nfsv3sf_ffiles;
nfsuint64 nfsv3sf_afiles;
u_long nfsv3sf_invarsec;
u_int32_t nfsv3sf_invarsec;
} sf_nfsv3;
} sf_un;
};
@ -415,25 +415,25 @@ struct nfs_statfs {
#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
struct nfsv3_fsinfo {
u_long fs_rtmax;
u_long fs_rtpref;
u_long fs_rtmult;
u_long fs_wtmax;
u_long fs_wtpref;
u_long fs_wtmult;
u_long fs_dtpref;
u_int32_t fs_rtmax;
u_int32_t fs_rtpref;
u_int32_t fs_rtmult;
u_int32_t fs_wtmax;
u_int32_t fs_wtpref;
u_int32_t fs_wtmult;
u_int32_t fs_dtpref;
nfsuint64 fs_maxfilesize;
nfstime3 fs_timedelta;
u_long fs_properties;
u_int32_t fs_properties;
};
struct nfsv3_pathconf {
u_long pc_linkmax;
u_long pc_namemax;
u_long pc_notrunc;
u_long pc_chownrestricted;
u_long pc_caseinsensitive;
u_long pc_casepreserving;
u_int32_t pc_linkmax;
u_int32_t pc_namemax;
u_int32_t pc_notrunc;
u_int32_t pc_chownrestricted;
u_int32_t pc_caseinsensitive;
u_int32_t pc_casepreserving;
};
#endif

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsrtt.h 8.2 (Berkeley) 3/30/95
* $Id: nfsrtt.h,v 1.7 1997/02/22 09:42:50 peter Exp $
* $Id: nfsrtt.h,v 1.8 1997/06/03 17:22:47 dfr Exp $
*/
@ -95,7 +95,7 @@ struct nfsdrt {
struct drt {
int flag; /* Bits as defined above */
u_int32_t 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];

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsrvcache.h 8.3 (Berkeley) 3/30/95
* $Id: nfsrvcache.h,v 1.9 1997/06/03 17:22:47 dfr Exp $
* $Id: nfsrvcache.h,v 1.10 1998/02/03 22:15:04 bde Exp $
*/
@ -52,7 +52,7 @@
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 */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nqnfs.h 8.3 (Berkeley) 3/30/95
* $Id: nqnfs.h,v 1.14 1997/08/16 19:16:05 wollman Exp $
* $Id: nqnfs.h,v 1.15 1998/03/30 09:54:45 phk Exp $
*/
@ -88,18 +88,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;
@ -201,7 +201,7 @@ extern u_long nqfhhash;
#if defined(KERNEL) || defined(_KERNEL)
void nqnfs_lease_check __P((struct vnode *, struct proc *, struct ucred *, int));
void nqnfs_lease_updatetime __P((int));
int nqsrv_getlease __P((struct vnode *, u_long *, int,
int nqsrv_getlease __P((struct vnode *, u_int32_t *, int,
struct nfssvc_sock *, struct proc *,
struct sockaddr *, int *, u_quad_t *,
struct ucred *));

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)rpcv2.h 8.2 (Berkeley) 3/30/95
* $Id: rpcv2.h,v 1.7 1997/02/22 09:42:53 peter Exp $
* $Id: rpcv2.h,v 1.8 1997/05/11 18:05:39 tegge Exp $
*/
@ -105,20 +105,20 @@
* Structures used for RPCAUTH_KERB4.
*/
struct nfsrpc_fullverf {
u_long t1;
u_long t2;
u_long w2;
u_int32_t t1;
u_int32_t t2;
u_int32_t w2;
};
struct nfsrpc_fullblock {
u_long t1;
u_long t2;
u_long w1;
u_long w2;
u_int32_t t1;
u_int32_t t2;
u_int32_t w1;
u_int32_t w2;
};
struct nfsrpc_nickverf {
u_long kind;
u_int32_t kind;
struct nfsrpc_fullverf verf;
};

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)xdr_subs.h 8.3 (Berkeley) 3/30/95
* $Id$
* $Id: xdr_subs.h,v 1.9 1997/02/22 09:42:53 peter Exp $
*/
@ -52,8 +52,8 @@
* 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_nfsv2time(f, t) { \
(t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \
@ -80,12 +80,12 @@
}
#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]); \
}
#endif

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_syscalls.c,v 1.39 1998/05/31 17:27:53 peter Exp $
* $Id: nfs_syscalls.c,v 1.40 1998/05/31 18:46:06 peter Exp $
*/
#include <sys/param.h>
@ -75,7 +75,7 @@
static MALLOC_DEFINE(M_NFSSVC, "NFS srvsock", "Nfs server structure");
/* Global defs. */
extern int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
extern int32_t (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
struct proc *procp,
struct mbuf **mreqp));
@ -401,15 +401,15 @@ nfssvc_addsock(fp, mynam, p)
*/
if (so->so_type == SOCK_STREAM) {
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, p);
}
if (so->so_proto->pr_domain->dom_family == AF_INET &&
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, p);
}
so->so_rcv.sb_flags &= ~SB_NOINTR;
@ -677,7 +677,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, solockp,
@ -1064,7 +1064,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
int verf_len;
{
register struct nfsuid *nuidp;
register u_long *nickp, *verfp;
register u_int32_t *nickp, *verfp;
struct timeval ktvin, ktvout;
#ifdef DIAGNOSTIC
@ -1085,7 +1085,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru);
TAILQ_INSERT_TAIL(&nmp->nm_uidlruhead, nuidp, nu_lru);
nickp = (u_long *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
nickp = (u_int32_t *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
*nickp++ = txdr_unsigned(RPCAKN_NICKNAME);
*nickp = txdr_unsigned(nuidp->nu_nickname);
*auth_str = (char *)nickp;
@ -1094,7 +1094,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
/*
* Now we must encrypt the verifier and package it up.
*/
verfp = (u_long *)verf_str;
verfp = (u_int32_t *)verf_str;
*verfp++ = txdr_unsigned(RPCAKN_NICKNAME);
if (time_second > nuidp->nu_timestamp.tv_sec ||
(time_second == nuidp->nu_timestamp.tv_sec &&
@ -1133,19 +1133,19 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
struct mbuf *mrep;
{
register struct nfsuid *nuidp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct mbuf *md = *mdp;
struct timeval ktvin, ktvout;
u_long nick;
u_int32_t nick;
char *dpos = *dposp, *cp2;
int deltasec, error = 0;
if (len == (3 * NFSX_UNSIGNED)) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
ktvin.tv_sec = *tl++;
ktvin.tv_usec = *tl++;
nick = fxdr_unsigned(u_long, *tl);
nick = fxdr_unsigned(u_int32_t, *tl);
/*
* Decrypt the timestamp in ecb mode.

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_socket.c,v 1.38 1998/05/31 18:08:09 peter Exp $
* $Id: nfs_socket.c,v 1.39 1998/05/31 19:49:30 peter Exp $
*/
/*
@ -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,
extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers,
rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr,
rpc_auth_kerb;
extern u_long nfs_prog, nqnfs_prog;
extern u_int32_t nfs_prog, nqnfs_prog;
extern time_t nqnfsstarttime;
extern struct nfsstats nfsstats;
extern int nfsv3_procid[NFS_NPROCS];
@ -191,7 +191,7 @@ nfs_connect(nmp, rep)
struct sockaddr *saddr;
struct sockaddr_in *sin;
struct mbuf *m;
u_short tport;
u_int16_t tport;
struct proc *p = &proc0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
@ -283,20 +283,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, p);
}
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, p);
}
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;
}
error = soreserve(so, sndreserve, rcvreserve);
if (error)
@ -371,11 +371,11 @@ nfs_disconnect(nmp)
}
}
void
void
nfs_safedisconnect(nmp)
struct nfsmount *nmp;
{
struct nfsreq dummyreq;
struct nfsreq dummyreq;
bzero(&dummyreq, sizeof(dummyreq));
dummyreq.r_nmp = nmp;
@ -476,7 +476,7 @@ nfs_receive(rep, aname, mp)
struct iovec aio;
register struct mbuf *m;
struct mbuf *control;
u_long len;
u_int32_t len;
struct sockaddr **getnam;
int error, sotype, rcvflg;
struct proc *p = curproc; /* XXX */
@ -543,13 +543,13 @@ nfs_receive(rep, aname, mp)
nfs_sndunlock(&rep->r_nmp->nm_flag, &rep->r_nmp->nm_state);
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;
@ -572,8 +572,8 @@ nfs_receive(rep, aname, mp)
if (auio.uio_resid != sizeof (u_int32_t))
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;
}
@ -703,10 +703,10 @@ nfs_reply(myrep)
{
register struct nfsreq *rep;
register struct nfsmount *nmp = myrep->r_nmp;
register long t1;
register int32_t t1;
struct mbuf *mrep, *md;
struct sockaddr *nam;
u_long rxid, *tl;
u_int32_t rxid, *tl;
caddr_t dpos, cp2;
int error;
@ -756,7 +756,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) {
#ifndef NFS_NOSERVER
@ -885,7 +885,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;
@ -896,7 +896,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
int t1, nqlflag, cachable, s, error = 0, mrest_len, auth_len, auth_type;
int trylater_delay = NQ_TRYLATERDEL, trylater_cnt = 0, failed_auth = 0;
int verf_len, verf_type;
u_long xid;
u_int32_t xid;
u_quad_t frev;
char *auth_str, *verf_str;
NFSKERBKEY_T key; /* save session key */
@ -953,7 +953,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
*/
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;
@ -1050,7 +1050,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
/*
* 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;
@ -1075,17 +1075,17 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* Grab any Kerberos verifier, otherwise just throw it away.
*/
verf_type = fxdr_unsigned(int, *tl++);
i = fxdr_unsigned(int, *tl);
i = fxdr_unsigned(int32_t, *tl);
if ((nmp->nm_flag & NFSMNT_KERB) && verf_type == RPCAUTH_KERB4) {
error = nfs_savenickauth(nmp, cred, i, key, &md, &dpos, mrep);
if (error)
goto nfsmout;
} else if (i > 0)
nfsm_adv(nfsm_rndup(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);
if ((nmp->nm_flag & NFSMNT_NFSV3) &&
@ -1124,11 +1124,11 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* 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_second) {
@ -1170,7 +1170,7 @@ nfs_rephead(siz, nd, slp, 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;
@ -1186,7 +1186,7 @@ nfs_rephead(siz, nd, slp, 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);
@ -1238,7 +1238,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*tl++ = rpc_auth_kerb;
*tl++ = txdr_unsigned(3 * NFSX_UNSIGNED);
*tl = ktvout.tv_sec;
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = ktvout.tv_usec;
*tl++ = txdr_unsigned(nuidp->nu_cr.cr_uid);
} else {
@ -1255,7 +1255,7 @@ nfs_rephead(siz, nd, slp, 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);
if (nd->nd_flag & ND_NQNFS) {
*tl++ = txdr_unsigned(3);
*tl = txdr_unsigned(3);
@ -1273,7 +1273,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
default:
*tl = 0;
if (err != NFSERR_RETVOID) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap(nd, err));
else
@ -1288,13 +1288,13 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*/
if ((nd->nd_flag & ND_NQNFS) && err == 0) {
if (nd->nd_flag & ND_LEASE) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nd->nd_flag & ND_LEASE);
*tl++ = txdr_unsigned(cache);
*tl++ = txdr_unsigned(nd->nd_duration);
txdr_hyper(frev, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@ -1679,12 +1679,12 @@ nfs_getreq(nd, nfsd, 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, cp;
u_long nfsvers, auth_type;
u_int32_t nfsvers, auth_type;
uid_t nickuid;
int error = 0, nqnfs = 0, ticklen;
struct mbuf *mrep, *md;
@ -1698,14 +1698,14 @@ nfs_getreq(nd, nfsd, 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;
nd->nd_flag = 0;
if (*tl++ != rpc_vers) {
@ -1723,7 +1723,7 @@ nfs_getreq(nd, nfsd, has_header)
}
}
tl++;
nfsvers = fxdr_unsigned(u_long, *tl++);
nfsvers = fxdr_unsigned(u_int32_t, *tl++);
if (((nfsvers < NFS_VER2 || nfsvers > NFS_VER3) && !nqnfs) ||
(nfsvers != NQNFS_VER3 && nqnfs)) {
nd->nd_repstat = EPROGMISMATCH;
@ -1734,7 +1734,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_flag = (ND_NFSV3 | ND_NQNFS);
else if (nfsvers == NFS_VER3)
nd->nd_flag = ND_NFSV3;
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 ||
@ -1764,7 +1764,7 @@ nfs_getreq(nd, nfsd, 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);
bzero((caddr_t)&nd->nd_cr, sizeof (struct ucred));
nd->nd_cr.cr_ref = 1;
nd->nd_cr.cr_uid = fxdr_unsigned(uid_t, *tl++);
@ -1774,7 +1774,7 @@ nfs_getreq(nd, nfsd, 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 = 1; i <= len; i++)
if (i < NGROUPS)
nd->nd_cr.cr_groups[i] = fxdr_unsigned(gid_t, *tl++);
@ -1794,7 +1794,7 @@ nfs_getreq(nd, nfsd, has_header)
switch (fxdr_unsigned(int, *tl++)) {
case RPCAKN_FULLNAME:
ticklen = fxdr_unsigned(int, *tl);
*((u_long *)nfsd->nfsd_authstr) = *tl;
*((u_int32_t *)nfsd->nfsd_authstr) = *tl;
uio.uio_resid = nfsm_rndup(ticklen) + NFSX_UNSIGNED;
nfsd->nfsd_authlen = uio.uio_resid + NFSX_UNSIGNED;
if (uio.uio_resid > (len - 2 * NFSX_UNSIGNED)) {
@ -1808,7 +1808,7 @@ nfs_getreq(nd, nfsd, has_header)
iov.iov_base = (caddr_t)&nfsd->nfsd_authstr[4];
iov.iov_len = RPCAUTH_MAXSIZ - 4;
nfsm_mtouio(&uio, uio.uio_resid);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 4 * NFSX_UNSIGNED) {
printf("Bad kerb verifier\n");
@ -1817,7 +1817,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nfsm_dissect(cp, caddr_t, 4 * NFSX_UNSIGNED);
tl = (u_long *)cp;
tl = (u_int32_t *)cp;
if (fxdr_unsigned(int, *tl) != RPCAKN_FULLNAME) {
printf("Not fullname kerb verifier\n");
nd->nd_repstat = (NFSERR_AUTHERR|AUTH_BADVERF);
@ -1838,7 +1838,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nickuid = fxdr_unsigned(uid_t, *tl);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 3 * NFSX_UNSIGNED) {
printf("Kerb nick verifier bad\n");
@ -1846,7 +1846,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_procnum = NFSPROC_NOOP;
return (0);
}
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
tvin.tv_sec = *tl++;
tvin.tv_usec = *tl;
@ -1898,11 +1898,11 @@ nfs_getreq(nd, nfsd, 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_flag |= fxdr_unsigned(int, *tl);
if (nd->nd_flag & ND_LEASE) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int, *tl);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int32_t, *tl);
} else
nd->nd_duration = NQ_MINLEASE;
} else
@ -2066,7 +2066,7 @@ nfsrv_getstream(slp, waitflag)
register char *cp1, *cp2;
register int len;
struct mbuf *om, *m2, *recm = NULL;
u_long recmark;
u_int32_t recmark;
if (slp->ns_flag & SLP_GETSTREAM)
panic("nfs getstream");

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
* $Id: nfs_subs.c,v 1.59 1998/05/31 18:11:03 peter Exp $
* $Id: nfs_subs.c,v 1.60 1998/05/31 19:16:08 peter Exp $
*/
/*
@ -83,14 +83,14 @@
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
*/
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_auth_kerb;
u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false;
u_int32_t nfs_prog, nqnfs_prog, nfs_true, nfs_false;
/* And other global data */
static u_long nfs_xid = 0;
static u_int32_t nfs_xid = 0;
static enum vtype nv2tov_type[8]= {
VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON
};
@ -580,7 +580,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;
@ -600,11 +600,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;
}
}
@ -634,15 +634,15 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
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;
int siz, grpsiz, authsiz;
static u_long base;
static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@ -660,7 +660,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* First the RPC header.
*/
nfsm_build(tl, u_long *, 8 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
/* Get a pretty random xid to start with */
if (!nfs_xid)
@ -696,7 +696,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
*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);
@ -736,7 +736,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* And the verifier...
*/
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (verf_str) {
*tl++ = txdr_unsigned(RPCAUTH_KERB4);
*tl = txdr_unsigned(verf_len);
@ -1038,14 +1038,14 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
{
register struct mbuf *m1 = NULL, *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;
@ -1066,7 +1066,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);
@ -1207,7 +1207,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
register struct vattr *vap;
register struct nfs_fattr *fp;
register struct nfsnode *np;
register long t1;
register int32_t t1;
caddr_t cp2;
int error = 0, rdev;
struct mbuf *md;
@ -1252,7 +1252,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
if (vtyp == VNON || (vtyp == VREG && (vmode & S_IFMT) != 0))
vtyp = IFTOVT(vmode);
rdev = fxdr_unsigned(long, fp->fa2_rdev);
rdev = fxdr_unsigned(int32_t, fp->fa2_rdev);
fxdr_nfsv2time(&fp->fa2_mtime, &mtime);
/*
@ -1313,7 +1313,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
fxdr_hyper(&fp->fa3_size, &vap->va_size);
vap->va_blocksize = NFS_FABLKSIZE;
fxdr_hyper(&fp->fa3_used, &vap->va_bytes);
vap->va_fileid = fxdr_unsigned(int, fp->fa3_fileid.nfsuquad[1]);
vap->va_fileid = fxdr_unsigned(int32_t,
fp->fa3_fileid.nfsuquad[1]);
fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime);
fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime);
vap->va_flags = 0;
@ -1322,15 +1323,17 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink);
vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid);
vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid);
vap->va_size = fxdr_unsigned(u_long, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(long, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(long, fp->fa2_blocks) * NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(int32_t, fp->fa2_blocks)
* NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t,
fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}
if (vap->va_size != np->n_size) {
@ -1763,13 +1766,13 @@ nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
if (before_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, 7 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&(before_vap->va_size), tl);
tl += 2;
@ -1792,14 +1795,14 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
register struct nfs_fattr *fp;
if (after_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
* $Id: nfs_vfsops.c,v 1.67 1998/05/31 19:20:44 peter Exp $
* $Id: nfs_vfsops.c,v 1.68 1998/05/31 19:49:31 peter Exp $
*/
#include <sys/param.h>
@ -253,8 +253,8 @@ nfs_statfs(mp, sbp, p)
register struct vnode *vp;
register struct nfs_statfs *sfp;
register caddr_t cp;
register u_long *tl;
register long t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct nfsmount *nmp = VFSTONFS(mp);
int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
@ -297,15 +297,15 @@ nfs_statfs(mp, sbp, p)
sbp->f_bfree = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
fxdr_hyper(&sfp->sf_abytes, &tquad);
sbp->f_bavail = (long)(tquad / ((u_quad_t)NFS_FABLKSIZE));
sbp->f_files = (fxdr_unsigned(long, sfp->sf_tfiles.nfsuquad[1])
& 0x7fffffff);
sbp->f_ffree = (fxdr_unsigned(long, sfp->sf_ffiles.nfsuquad[1])
& 0x7fffffff);
sbp->f_files = (fxdr_unsigned(int32_t,
sfp->sf_tfiles.nfsuquad[1]) & 0x7fffffff);
sbp->f_ffree = (fxdr_unsigned(int32_t,
sfp->sf_ffiles.nfsuquad[1]) & 0x7fffffff);
} else {
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);
sbp->f_files = 0;
sbp->f_ffree = 0;
}
@ -331,8 +331,8 @@ nfs_fsinfo(nmp, vp, cred, p)
{
register struct nfsv3_fsinfo *fsp;
register caddr_t cp;
register long t1, t2;
register u_long *tl, pref, max;
register int32_t t1, t2;
register u_int32_t *tl, pref, max;
caddr_t bpos, dpos, cp2;
int error = 0, retattr;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -345,27 +345,27 @@ nfs_fsinfo(nmp, vp, cred, p)
nfsm_postop_attr(vp, retattr);
if (!error) {
nfsm_dissect(fsp, struct nfsv3_fsinfo *, NFSX_V3FSINFO);
pref = fxdr_unsigned(u_long, fsp->fs_wtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_wtpref);
if (pref < nmp->nm_wsize && pref >= NFS_FABLKSIZE)
nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_wtmax);
max = fxdr_unsigned(u_int32_t, fsp->fs_wtmax);
if (max < nmp->nm_wsize) {
nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1);
if (nmp->nm_wsize == 0)
nmp->nm_wsize = max;
}
pref = fxdr_unsigned(u_long, fsp->fs_rtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_rtpref);
if (pref < nmp->nm_rsize && pref >= NFS_FABLKSIZE)
nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);
max = fxdr_unsigned(u_long, fsp->fs_rtmax);
max = fxdr_unsigned(u_int32_t, fsp->fs_rtmax);
if (max < nmp->nm_rsize) {
nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1);
if (nmp->nm_rsize == 0)
nmp->nm_rsize = max;
}
pref = fxdr_unsigned(u_long, fsp->fs_dtpref);
pref = fxdr_unsigned(u_int32_t, fsp->fs_dtpref);
if (pref < nmp->nm_readdirsize)
nmp->nm_readdirsize = pref;
if (max < nmp->nm_readdirsize) {
@ -591,7 +591,7 @@ nfs_mountdiskless(path, which, mountflag, sin, args, p, vpp, mpp)
return (0);
}
static void
static void
nfs_decode_args(nmp, argp)
struct nfsmount *nmp;
struct nfs_args *argp;
@ -722,7 +722,7 @@ nfs_decode_args(nmp, argp)
while (nfs_connect(nmp, (struct nfsreq *)0)) {
printf("nfs_args: retrying connect\n");
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nfscon", 0);
PSOCK, "nfscon", 0);
}
}
}
@ -825,7 +825,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
{
register struct nfsmount *nmp;
struct nfsnode *np;
int error, maxio;
int error;
struct vattr attrs;
if (mp->mnt_flag & MNT_UPDATE) {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
* $Id: nfs_vnops.c,v 1.101 1998/05/31 19:28:15 peter Exp $
* $Id: nfs_vnops.c,v 1.102 1998/05/31 19:29:28 peter Exp $
*/
@ -59,6 +59,7 @@
#include <sys/dirent.h>
#include <sys/fcntl.h>
#include <sys/lockf.h>
#include <sys/stat.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@ -237,8 +238,8 @@ static int nfs_renameit __P((struct vnode *sdvp,
/*
* Global variables
*/
extern u_long nfs_true, nfs_false;
extern u_long nfs_xdrneg1;
extern u_int32_t nfs_true, nfs_false;
extern u_int32_t nfs_xdrneg1;
extern struct nfsstats nfsstats;
extern nfstype nfsv3_type[9];
struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON];
@ -262,13 +263,13 @@ nfs_access(ap)
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register int t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
u_long mode, rmode;
u_int32_t mode, rmode;
int v3 = NFS_ISV3(vp);
/*
@ -298,7 +299,7 @@ nfs_access(ap)
nfsstats.rpccnt[NFSPROC_ACCESS]++;
nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
nfsm_fhtom(vp, v3);
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
mode = NFSV3ACCESS_READ;
else
@ -319,8 +320,8 @@ nfs_access(ap)
nfsm_request(vp, NFSPROC_ACCESS, ap->a_p, ap->a_cred);
nfsm_postop_attr(vp, attrflag);
if (!error) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
rmode = fxdr_unsigned(u_long, *tl);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
rmode = fxdr_unsigned(u_int32_t, *tl);
/*
* The NFS V3 spec does not clarify whether or not
* the returned access bits can be a superset of
@ -533,8 +534,8 @@ nfs_getattr(ap)
register struct vnode *vp = ap->a_vp;
register struct nfsnode *np = VTONFS(vp);
register caddr_t cp;
register u_long *tl;
register int t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -608,7 +609,7 @@ nfs_setattr(ap)
case VFIFO:
if (vap->va_mtime.tv_sec == VNOVAL &&
vap->va_atime.tv_sec == VNOVAL &&
vap->va_mode == (u_short)VNOVAL &&
vap->va_mode == (mode_t)VNOVAL &&
vap->va_uid == (uid_t)VNOVAL &&
vap->va_gid == (gid_t)VNOVAL)
return (0);
@ -661,9 +662,9 @@ nfs_setattrrpc(vp, vap, cred, procp)
{
register struct nfsv2_sattr *sp;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
u_long *tl;
u_int32_t *tl;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
int v3 = NFS_ISV3(vp);
@ -672,69 +673,69 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
if (vap->va_mode != (u_short)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
if (vap->va_mode != (mode_t)VNOVAL) {
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_mode);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_uid != (uid_t)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_uid);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_gid != (gid_t)VNOVAL) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(vap->va_gid);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_size != VNOVAL) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&vap->va_size, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (vap->va_atime.tv_sec != VNOVAL) {
if (vap->va_atime.tv_sec != time_second) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_atime, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (vap->va_mtime.tv_sec != VNOVAL) {
if (vap->va_mtime.tv_sec != time_second) {
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_mtime, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
if (vap->va_mode == (u_short)VNOVAL)
if (vap->va_mode == (mode_t)VNOVAL)
sp->sa_mode = nfs_xdrneg1;
else
sp->sa_mode = vtonfsv2_mode(vp->v_type, vap->va_mode);
@ -778,9 +779,9 @@ nfs_lookup(ap)
struct vnode **vpp = ap->a_vpp;
int flags = cnp->cn_flags;
struct vnode *newvp;
u_long *tl;
u_int32_t *tl;
caddr_t cp;
long t1, t2;
int32_t t1, t2;
struct nfsmount *nmp;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1002,9 +1003,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, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, len, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1034,9 +1035,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, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct nfsmount *nmp;
@ -1055,7 +1056,7 @@ nfs_readrpc(vp, uiop, cred)
len = (tsiz > nmp->nm_rsize) ? nmp->nm_rsize : tsiz;
nfsm_reqhead(vp, NFSPROC_READ, NFSX_FH(v3) + NFSX_UNSIGNED * 3);
nfsm_fhtom(vp, v3);
nfsm_build(tl, u_long *, NFSX_UNSIGNED * 3);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED * 3);
if (v3) {
txdr_hyper(&uiop->uio_offset, tl);
*(tl + 2) = txdr_unsigned(len);
@ -1071,7 +1072,7 @@ nfs_readrpc(vp, uiop, cred)
m_freem(mrep);
goto nfsmout;
}
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
eof = fxdr_unsigned(int, *(tl + 1));
} else
nfsm_loadattr(vp, (struct vattr *)0);
@ -1099,9 +1100,9 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
struct ucred *cred;
int *iomode, *must_commit;
{
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register int t1, t2, backup;
register int32_t t1, t2, backup;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
@ -1123,18 +1124,18 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len));
nfsm_fhtom(vp, v3);
if (v3) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
txdr_hyper(&uiop->uio_offset, tl);
tl += 2;
*tl++ = txdr_unsigned(len);
*tl++ = txdr_unsigned(*iomode);
*tl = txdr_unsigned(len);
} else {
register u_long x;
register u_int32_t x;
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
/* Set both "begin" and "current" to non-garbage. */
x = txdr_unsigned((u_long)uiop->uio_offset);
x = txdr_unsigned((u_int32_t)uiop->uio_offset);
*tl++ = x; /* "begin offset" */
*tl++ = x; /* "current offset" */
x = txdr_unsigned(len);
@ -1147,8 +1148,8 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit)
wccflag = NFSV3_WCCCHK;
nfsm_wcc_data(vp, wccflag);
if (!error) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED +
NFSX_V3WRITEVERF);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED
+ NFSX_V3WRITEVERF);
rlen = fxdr_unsigned(int, *tl++);
if (rlen == 0) {
error = NFSERR_IO;
@ -1216,9 +1217,9 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
{
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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 vnode *)0;
struct nfsnode *np = (struct nfsnode *)0;
struct vattr vattr;
@ -1226,7 +1227,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
caddr_t bpos, dpos;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
u_long rdev;
u_int32_t rdev;
int v3 = NFS_ISV3(dvp);
if (vap->va_type == VCHR || vap->va_type == VBLK)
@ -1247,12 +1248,12 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
*tl++ = vtonfsv3_type(vap->va_type);
sp3 = (struct nfsv3_sattr *)tl;
nfsm_v3sattr(sp3, vap);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
*tl = txdr_unsigned(minor(vap->va_rdev));
}
@ -1338,9 +1339,9 @@ nfs_create(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
caddr_t bpos, dpos, cp2;
@ -1368,10 +1369,10 @@ nfs_create(ap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
nfsm_build(tl, u_long *, NFSX_V3CREATEVERF);
nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
#ifdef INET
if (!TAILQ_EMPTY(&in_ifaddrhead))
*tl++ = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr.s_addr;
@ -1381,7 +1382,7 @@ nfs_create(ap)
*tl = ++create_verf;
} else {
*tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
nfsm_build(tl, u_long *, NFSX_V3SRVSATTR);
nfsm_build(tl, u_int32_t *, NFSX_V3SRVSATTR);
sp3 = (struct nfsv3_sattr *)tl;
nfsm_v3sattr(sp3, vap);
}
@ -1525,9 +1526,9 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
struct ucred *cred;
struct proc *proc;
{
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, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1646,9 +1647,9 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
struct ucred *cred;
struct proc *proc;
{
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, fwccflag = NFSV3_WCCRATTR, twccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1691,9 +1692,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 t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1755,9 +1756,9 @@ nfs_symlink(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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 slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1822,9 +1823,9 @@ nfs_mkdir(ap)
register struct componentname *cnp = ap->a_cnp;
register struct nfsv2_sattr *sp;
register struct nfsv3_sattr *sp3;
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;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
@ -1906,9 +1907,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 t1, t2;
register int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -1999,9 +2000,9 @@ nfs_readdirrpc(vp, uiop, cred)
{
register int len, left;
register struct dirent *dp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
register nfsuint64 *cookiep;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@ -2041,13 +2042,13 @@ nfs_readdirrpc(vp, uiop, cred)
NFSX_READDIR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
*tl++ = dnp->n_cookieverf.nfsuquad[1];
} else {
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
}
*tl = txdr_unsigned(nmp->nm_readdirsize);
@ -2055,7 +2056,8 @@ nfs_readdirrpc(vp, uiop, cred)
if (v3) {
nfsm_postop_attr(vp, attrflag);
if (!error) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
dnp->n_cookieverf.nfsuquad[0] = *tl++;
dnp->n_cookieverf.nfsuquad[1] = *tl;
} else {
@ -2063,17 +2065,19 @@ nfs_readdirrpc(vp, uiop, cred)
goto nfsmout;
}
}
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 */
while (more_dirs && bigenough) {
if (v3) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
3 * NFSX_UNSIGNED);
fxdr_hyper(tl, &fileno);
len = fxdr_unsigned(int, *(tl + 2));
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
fileno = fxdr_unsigned(u_quad_t, *tl++);
len = fxdr_unsigned(int, *tl);
}
@ -2120,9 +2124,11 @@ nfs_readdirrpc(vp, uiop, cred)
} else
nfsm_adv(nfsm_rndup(len));
if (v3) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
3 * NFSX_UNSIGNED);
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *,
2 * NFSX_UNSIGNED);
}
if (bigenough) {
cookie.nfsuquad[0] = *tl++;
@ -2138,7 +2144,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);
}
m_freem(mrep);
@ -2183,9 +2189,9 @@ nfs_readdirplusrpc(vp, uiop, cred)
{
register int len, left;
register struct dirent *dp;
register u_long *tl;
register u_int32_t *tl;
register caddr_t cp;
register long t1, t2;
register int32_t t1, t2;
register struct vnode *newvp;
register nfsuint64 *cookiep;
caddr_t bpos, dpos, cp2, dpossav1, dpossav2;
@ -2229,7 +2235,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
nfsm_reqhead(vp, NFSPROC_READDIRPLUS,
NFSX_FH(1) + 6 * NFSX_UNSIGNED);
nfsm_fhtom(vp, 1);
nfsm_build(tl, u_long *, 6 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
@ -2242,14 +2248,14 @@ nfs_readdirplusrpc(vp, uiop, cred)
m_freem(mrep);
goto nfsmout;
}
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
dnp->n_cookieverf.nfsuquad[0] = *tl++;
dnp->n_cookieverf.nfsuquad[1] = *tl++;
more_dirs = fxdr_unsigned(int, *tl);
/* loop thru the dir entries, doctoring them to 4bsd form */
while (more_dirs && bigenough) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
fxdr_hyper(tl, &fileno);
len = fxdr_unsigned(int, *(tl + 2));
if (len <= 0 || len > NFS_MAXNAMLEN) {
@ -2296,7 +2302,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
uiop->uio_resid -= tlen;
} else
nfsm_adv(nfsm_rndup(len));
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
if (bigenough) {
cookie.nfsuquad[0] = *tl++;
cookie.nfsuquad[1] = *tl++;
@ -2313,7 +2319,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
dpossav1 = dpos;
mdsav1 = md;
nfsm_adv(NFSX_V3FATTR);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
doit = fxdr_unsigned(int, *tl);
if (doit) {
nfsm_getfh(fhp, fhsize, 1);
@ -2349,7 +2355,7 @@ nfs_readdirplusrpc(vp, uiop, cred)
}
} else {
/* Just skip over the file handle */
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
i = fxdr_unsigned(int, *tl);
nfsm_adv(nfsm_rndup(i));
}
@ -2357,14 +2363,14 @@ nfs_readdirplusrpc(vp, uiop, cred)
vrele(newvp);
newvp = NULLVP;
}
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
more_dirs = fxdr_unsigned(int, *tl);
}
/*
* 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);
}
m_freem(mrep);
@ -2479,9 +2485,9 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
struct proc *procp;
struct nfsnode **npp;
{
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 vnode *)0;
struct nfsnode *np, *dnp = VTONFS(dvp);
caddr_t bpos, dpos, cp2;
@ -2558,8 +2564,8 @@ nfs_commit(vp, offset, cnt, cred, procp)
struct proc *procp;
{
register caddr_t cp;
register u_long *tl;
register int t1, t2;
register u_int32_t *tl;
register int32_t t1, t2;
register struct nfsmount *nmp = VFSTONFS(vp->v_mount);
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
@ -2570,14 +2576,14 @@ nfs_commit(vp, offset, cnt, cred, procp)
nfsstats.rpccnt[NFSPROC_COMMIT]++;
nfsm_reqhead(vp, NFSPROC_COMMIT, NFSX_FH(1));
nfsm_fhtom(vp, 1);
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
txdr_hyper(&offset, tl);
tl += 2;
*tl = txdr_unsigned(cnt);
nfsm_request(vp, NFSPROC_COMMIT, procp, cred);
nfsm_wcc_data(vp, wccflag);
if (!error) {
nfsm_dissect(tl, u_long *, NFSX_V3WRITEVERF);
nfsm_dissect(tl, u_int32_t *, NFSX_V3WRITEVERF);
if (bcmp((caddr_t)nmp->nm_verf, (caddr_t)tl,
NFSX_V3WRITEVERF)) {
bcopy((caddr_t)tl, (caddr_t)nmp->nm_verf,

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
* $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
* $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@ -59,7 +59,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
int auth_type, int auth_len, char *auth_str,
int verf_len, char *verf_str,
struct mbuf *mrest, int mrest_len,
struct mbuf **mbp, u_long *xidp));
struct mbuf **mbp, u_int32_t *xidp));
#define M_HASCL(m) ((m)->m_flags & M_EXT)
#define NFSMINOFF(m) \
@ -117,7 +117,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
{ if (v3) { \
t2 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED; \
if (t2 <= M_TRAILINGSPACE(mb)) { \
nfsm_build(tl, u_long *, t2); \
nfsm_build(tl, u_int32_t *, t2); \
*tl++ = txdr_unsigned(VTONFS(v)->n_fhsize); \
*(tl + ((t2>>2) - 2)) = 0; \
bcopy((caddr_t)VTONFS(v)->n_fhp,(caddr_t)tl, \
@ -136,7 +136,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FH); \
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
} else { \
@ -145,7 +145,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} }
#define nfsm_srvpostop_fh(f) \
{ nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
{ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = nfs_true; \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
@ -154,7 +154,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_mtofh(d, v, v3, f) \
{ struct nfsnode *ttnp; nfsfh_t *ttfhp; int ttfhsize; \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(f) = fxdr_unsigned(int, *tl); \
} else \
(f) = 1; \
@ -169,7 +169,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(v) = NFSTOV(ttnp); \
} \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (f) \
(f) = fxdr_unsigned(int, *tl); \
else if (fxdr_unsigned(int, *tl)) \
@ -181,7 +181,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_getfh(f, s, v3) \
{ if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int, *tl)) <= 0 || \
(s) > NFSX_V3FHMAX) { \
m_freem(mrep); \
@ -203,8 +203,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_postop_attr(v, f) \
{ struct vnode *ttvp = (v); \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
if ((f) = fxdr_unsigned(int, *tl)) { \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((f) = fxdr_unsigned(int, *tl)) != 0) { \
if ((t1 = nfs_loadattrcache(&ttvp, &md, &dpos, \
(struct vattr *)0)) != 0) { \
error = t1; \
@ -221,12 +221,12 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_wcc_data(v, f) \
{ int ttattrf, ttretf = 0; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED); \
if (f) \
ttretf = (VTONFS(v)->n_mtime == \
fxdr_unsigned(u_long, *(tl + 2))); \
fxdr_unsigned(u_int32_t, *(tl + 2))); \
} \
nfsm_postop_attr((v), ttattrf); \
if (f) { \
@ -248,23 +248,23 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
}
#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); \
} }
#define nfsm_srvnamesiz(s) \
{ nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(long,*tl)) > NFS_MAXNAMLEN) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int32_t,*tl)) > NFS_MAXNAMLEN) \
error = NFSERR_NAMETOL; \
if ((s) <= 0) \
error = EBADRPC; \
@ -312,7 +312,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
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((const char *)(a), (caddr_t)tl, (s)); \
@ -369,7 +369,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvmtofh(f) \
{ int fhlen = NFSX_V3FH; \
if (nfsd->nd_flag & ND_NFSV3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
fhlen = fxdr_unsigned(int, *tl); \
if (fhlen == 0) { \
bzero((caddr_t)(f), NFSX_V3FH); \
@ -379,7 +379,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
} \
if (fhlen != 0) { \
nfsm_dissect(tl, u_long *, NFSX_V3FH); \
nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
if ((nfsd->nd_flag & ND_NFSV3) == 0) \
nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
@ -398,7 +398,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
bp = mtod(mp, caddr_t); \
be = bp+mp->m_len; \
} \
tl = (u_long *)bp
tl = (u_int32_t *)bp
#define nfsm_srvfillattr(a, f) \
nfsm_srvfattr(nfsd, (a), (f))
@ -410,40 +410,40 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
nfsm_srvpostopattr(nfsd, (r), (a), &mb, &bpos)
#define nfsm_srvsattr(a) \
{ nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
{ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_mode = nfstov_mode(*tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_uid = fxdr_unsigned(uid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_gid = fxdr_unsigned(gid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_hyper(tl, &(a)->va_size); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
getnanotime(&(a)->va_atime); \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95
* $Id: nfs_serv.c,v 1.66 1998/05/31 19:10:52 peter Exp $
* $Id: nfs_serv.c,v 1.67 1998/05/31 19:43:34 peter Exp $
*/
/*
@ -91,8 +91,8 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK,
nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
NFCHR, NFNON };
/* Global vars */
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;
extern enum vtype nv3tov_type[8];
extern struct nfsstats nfsstats;
@ -124,8 +124,8 @@ nfsrv3_access(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, getret;
char *cp2;
@ -139,7 +139,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
#endif
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly,
(nfsd->nd_flag & ND_KERBAUTH), TRUE);
if (error) {
@ -147,7 +147,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(1, (struct vattr *)0);
return (0);
}
nfsmode = fxdr_unsigned(u_long, *tl);
nfsmode = fxdr_unsigned(u_int32_t, *tl);
if ((nfsmode & NFSV3ACCESS_READ) &&
nfsrv_access(vp, VREAD, cred, rdonly, procp, 0))
nfsmode &= ~NFSV3ACCESS_READ;
@ -170,7 +170,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
vput(vp);
nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, vap);
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(nfsmode);
nfsm_srvdone;
}
@ -195,8 +195,8 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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;
@ -243,8 +243,8 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, preat_ret = 1, postat_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), gcheck = 0;
@ -258,10 +258,10 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
VATTR_NULL(vap);
if (v3) {
nfsm_srvsattr(vap);
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
gcheck = fxdr_unsigned(int, *tl);
if (gcheck) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
fxdr_nfsv3time(tl, &guard);
}
} else {
@ -286,7 +286,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
fxdr_nfsv2time(&sp->sa_atime, &vap->va_atime);
#else
vap->va_atime.tv_sec =
fxdr_unsigned(long, sp->sa_atime.nfsv2_sec);
fxdr_unsigned(int32_t, sp->sa_atime.nfsv2_sec);
vap->va_atime.tv_nsec = 0;
#endif
}
@ -374,8 +374,8 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
nfsfh_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, len, dirattr_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), pubflag;
@ -492,8 +492,8 @@ nfsrv_readlink(nfsd, slp, procp, 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, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -573,7 +573,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
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;
@ -597,8 +597,8 @@ nfsrv_read(nfsd, slp, procp, mrq)
struct iovec *iv2;
register struct mbuf *m;
register struct nfs_fattr *fp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
register int i;
caddr_t bpos;
int error = 0, rdonly, cache, cnt, len, left, siz, tlen, getret;
@ -617,11 +617,11 @@ nfsrv_read(nfsd, slp, procp, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
fxdr_hyper(tl, &off);
} else {
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);
}
nfsm_srvstrsiz(reqlen, NFS_SRVMAXDATA(nfsd));
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam,
@ -659,14 +659,14 @@ nfsrv_read(nfsd, slp, procp, mrq)
cnt = reqlen;
nfsm_reply(NFSX_POSTOPORFATTR(v3) + 3 * NFSX_UNSIGNED+nfsm_rndup(cnt));
if (v3) {
nfsm_build(tl, u_long *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V3FATTR / sizeof (u_long));
tl += (NFSX_V3FATTR / sizeof (u_int32_t));
} else {
nfsm_build(tl, u_long *, NFSX_V2FATTR + NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_V2FATTR + NFSX_UNSIGNED);
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V2FATTR / sizeof (u_long));
tl += (NFSX_V2FATTR / sizeof (u_int32_t));
}
len = left = cnt;
if (cnt > 0) {
@ -766,8 +766,8 @@ nfsrv_write(nfsd, slp, procp, mrq)
struct iovec *iv;
struct vattr va, forat;
register struct vattr *vap = &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, len, forat_ret = 1;
int ioflags, aftat_ret = 1, retlen, zeroing, adjust;
@ -789,18 +789,18 @@ nfsrv_write(nfsd, slp, procp, mrq)
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &off);
tl += 3;
stable = fxdr_unsigned(int, *tl++);
} else {
nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
off = (off_t)fxdr_unsigned(u_long, *++tl);
nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
off = (off_t)fxdr_unsigned(u_int32_t, *++tl);
tl += 2;
if (nfs_async)
stable = NFSV3WRITE_UNSTABLE;
}
retlen = len = fxdr_unsigned(long, *tl);
retlen = len = fxdr_unsigned(int32_t, *tl);
cnt = i = 0;
/*
@ -912,7 +912,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(forat_ret, &forat, aftat_ret, vap);
if (error)
return (0);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(retlen);
/*
* If nfs_async is set, then pretend the write was FILESYNC.
@ -958,8 +958,8 @@ nfsrv_writegather(ndp, slp, procp, mrq)
struct nfsrvw_delayhash *wpp;
struct ucred *cred;
struct vattr va, forat;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
caddr_t bpos, dpos;
int error = 0, rdonly, cache, len, forat_ret = 1;
int ioflags, aftat_ret = 1, s, adjust, v3, zeroing;
@ -994,18 +994,18 @@ nfsrv_writegather(ndp, slp, procp, mrq)
*/
nfsm_srvmtofh(&nfsd->nd_fh);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &nfsd->nd_off);
tl += 3;
nfsd->nd_stable = fxdr_unsigned(int, *tl++);
} else {
nfsm_dissect(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsd->nd_off = (off_t)fxdr_unsigned(u_long, *++tl);
nfsm_dissect(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
nfsd->nd_off = (off_t)fxdr_unsigned(u_int32_t, *++tl);
tl += 2;
if (nfs_async)
nfsd->nd_stable = NFSV3WRITE_UNSTABLE;
}
len = fxdr_unsigned(long, *tl);
len = fxdr_unsigned(int32_t, *tl);
nfsd->nd_len = len;
nfsd->nd_eoff = nfsd->nd_off + len;
@ -1198,7 +1198,7 @@ nfsrv_writegather(ndp, slp, procp, mrq)
NFSX_WRITEVERF(v3), v3);
if (v3) {
nfsm_srvwcc_data(forat_ret, &forat, aftat_ret, &va);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nfsd->nd_len);
*tl++ = txdr_unsigned(swp->nd_stable);
/*
@ -1328,10 +1328,10 @@ nfsrv_create(nfsd, slp, procp, mrq)
struct vattr va, dirfor, diraft;
register struct vattr *vap = &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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
@ -1373,7 +1373,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
}
VATTR_NULL(vap);
if (v3) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
how = fxdr_unsigned(int, *tl);
switch (how) {
case NFSV3CREATE_GUARDED:
@ -1395,13 +1395,13 @@ nfsrv_create(nfsd, slp, procp, mrq)
vap->va_type = VREG;
} else {
nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
vap->va_type = IFTOVT(fxdr_unsigned(u_long, sp->sa_mode));
vap->va_type = IFTOVT(fxdr_unsigned(u_int32_t, sp->sa_mode));
if (vap->va_type == VNON)
vap->va_type = VREG;
vap->va_mode = nfstov_mode(sp->sa_mode);
switch (vap->va_type) {
case VREG:
tsize = fxdr_unsigned(long, sp->sa_size);
tsize = fxdr_unsigned(int32_t, sp->sa_size);
if (tsize != -1)
vap->va_size = (u_quad_t)tsize;
break;
@ -1569,12 +1569,12 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
register struct vattr *vap = &va;
register u_long *tl;
register u_int32_t *tl;
struct nameidata nd;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
u_long major, minor;
u_int32_t major, minor;
enum vtype vtyp;
char *cp2;
struct mbuf *mb, *mb2, *mreq;
@ -1601,7 +1601,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
vrele(dirp);
return (0);
}
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
vtyp = nfsv3tov_type(*tl);
if (vtyp != VCHR && vtyp != VBLK && vtyp != VSOCK && vtyp != VFIFO) {
vrele(nd.ni_startdir);
@ -1614,9 +1614,9 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
VATTR_NULL(vap);
nfsm_srvsattr(vap);
if (vtyp == VCHR || vtyp == VBLK) {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
major = fxdr_unsigned(u_long, *tl++);
minor = fxdr_unsigned(u_long, *tl);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
major = fxdr_unsigned(u_int32_t, *tl++);
minor = fxdr_unsigned(u_int32_t, *tl);
vap->va_rdev = makedev(major, minor);
}
@ -1720,8 +1720,8 @@ nfsrv_remove(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -1805,8 +1805,8 @@ nfsrv_rename(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, fdirfor_ret = 1, fdiraft_ret = 1;
int tdirfor_ret = 1, tdiraft_ret = 1;
@ -2012,8 +2012,8 @@ nfsrv_link(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
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, dirfor_ret = 1, diraft_ret = 1;
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2115,8 +2115,8 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
struct vattr va, dirfor, diraft;
struct nameidata nd;
register struct vattr *vap = &va;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct nfsv2_sattr *sp;
char *bpos, *pathcp = (char *)0, *cp2;
struct uio io;
@ -2166,7 +2166,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
nfsm_mtouio(&io, len2);
if (!v3) {
nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
vap->va_mode = fxdr_unsigned(u_short, sp->sa_mode);
vap->va_mode = fxdr_unsigned(u_int16_t, sp->sa_mode);
}
*(pathcp + len2) = '\0';
if (nd.ni_vp) {
@ -2261,8 +2261,8 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
register struct nfs_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, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2301,7 +2301,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
if (v3) {
nfsm_srvsattr(vap);
} else {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
vap->va_mode = nfstov_mode(*tl++);
}
vap->va_type = VDIR;
@ -2373,8 +2373,8 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -2485,11 +2485,11 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
*/
struct flrep {
nfsuint64 fl_off;
u_long fl_postopok;
u_long fl_fattr[NFSX_V3FATTR / sizeof (u_long)];
u_long fl_fhok;
u_long fl_fhsize;
u_long fl_nfh[NFSX_V3FH / sizeof (u_long)];
u_int32_t fl_postopok;
u_int32_t fl_fattr[NFSX_V3FATTR / sizeof (u_int32_t)];
u_int32_t fl_fhok;
u_int32_t fl_fhsize;
u_int32_t fl_nfh[NFSX_V3FH / sizeof (u_int32_t)];
};
int
@ -2507,8 +2507,8 @@ nfsrv_readdir(nfsd, slp, procp, 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;
@ -2522,18 +2522,18 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
int siz, cnt, fullsiz, eofflag, rdonly, cache, ncookies;
int v3 = (nfsd->nd_flag & ND_NFSV3);
u_quad_t frev, off, toff, verf;
u_long *cookies = NULL, *cookiep;
u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
if (v3) {
nfsm_dissect(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
fxdr_hyper(tl, &toff);
tl += 2;
fxdr_hyper(tl, &verf);
tl += 2;
} else {
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
toff = fxdr_unsigned(u_quad_t, *tl++);
}
off = toff;
@ -2621,11 +2621,11 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
2 * NFSX_UNSIGNED);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
tl += 2;
} else
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)rbuf, M_TEMP);
@ -2667,7 +2667,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_COOKIEVERF(v3) + siz);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
}
mp = mp2 = mb;
@ -2720,7 +2720,7 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
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;
@ -2774,8 +2774,8 @@ nfsrv_readdirplus(nfsd, slp, procp, 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;
@ -2790,11 +2790,11 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1;
int siz, cnt, fullsiz, eofflag, rdonly, cache, dirlen, ncookies;
u_quad_t frev, off, toff, verf;
u_long *cookies = NULL, *cookiep;
u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
fxdr_hyper(tl, &toff);
tl += 2;
fxdr_hyper(tl, &verf);
@ -2881,7 +2881,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF +
2 * NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
tl += 2;
*tl++ = nfs_false;
@ -2939,7 +2939,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED;
nfsm_reply(cnt);
nfsm_srvpostop_attr(getret, &at);
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(&at.va_filerev, tl);
mp = mp2 = mb;
bp = bpos;
@ -3024,7 +3024,7 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
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';
@ -3090,8 +3090,8 @@ nfsrv_commit(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_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, for_ret = 1, aft_ret = 1, cnt, cache;
char *cp2;
@ -3103,7 +3103,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
#endif
fhp = &nfh.fh_generic;
nfsm_srvmtofh(fhp);
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
/*
* XXX At this time VOP_FSYNC() does not accept offset and byte
@ -3130,7 +3130,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
nfsm_build(tl, u_long *, NFSX_V3WRITEVERF);
nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
*tl++ = txdr_unsigned(boottime.tv_sec);
*tl = txdr_unsigned(boottime.tv_usec);
} else
@ -3154,8 +3154,8 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
register struct statfs *sf;
register struct nfs_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, getret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@ -3231,9 +3231,9 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register u_int32_t *tl;
register struct nfsv3_fsinfo *sip;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1, pref;
char *cp2;
@ -3307,9 +3307,9 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
struct sockaddr *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
register u_long *tl;
register u_int32_t *tl;
register struct nfsv3_pathconf *pc;
register long t1;
register int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1, linkmax, namemax;
int chownres, notrunc;

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_socket.c,v 1.38 1998/05/31 18:08:09 peter Exp $
* $Id: nfs_socket.c,v 1.39 1998/05/31 19:49:30 peter Exp $
*/
/*
@ -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,
extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers,
rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr,
rpc_auth_kerb;
extern u_long nfs_prog, nqnfs_prog;
extern u_int32_t nfs_prog, nqnfs_prog;
extern time_t nqnfsstarttime;
extern struct nfsstats nfsstats;
extern int nfsv3_procid[NFS_NPROCS];
@ -191,7 +191,7 @@ nfs_connect(nmp, rep)
struct sockaddr *saddr;
struct sockaddr_in *sin;
struct mbuf *m;
u_short tport;
u_int16_t tport;
struct proc *p = &proc0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
@ -283,20 +283,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, p);
}
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, p);
}
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;
}
error = soreserve(so, sndreserve, rcvreserve);
if (error)
@ -371,11 +371,11 @@ nfs_disconnect(nmp)
}
}
void
void
nfs_safedisconnect(nmp)
struct nfsmount *nmp;
{
struct nfsreq dummyreq;
struct nfsreq dummyreq;
bzero(&dummyreq, sizeof(dummyreq));
dummyreq.r_nmp = nmp;
@ -476,7 +476,7 @@ nfs_receive(rep, aname, mp)
struct iovec aio;
register struct mbuf *m;
struct mbuf *control;
u_long len;
u_int32_t len;
struct sockaddr **getnam;
int error, sotype, rcvflg;
struct proc *p = curproc; /* XXX */
@ -543,13 +543,13 @@ nfs_receive(rep, aname, mp)
nfs_sndunlock(&rep->r_nmp->nm_flag, &rep->r_nmp->nm_state);
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;
@ -572,8 +572,8 @@ nfs_receive(rep, aname, mp)
if (auio.uio_resid != sizeof (u_int32_t))
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;
}
@ -703,10 +703,10 @@ nfs_reply(myrep)
{
register struct nfsreq *rep;
register struct nfsmount *nmp = myrep->r_nmp;
register long t1;
register int32_t t1;
struct mbuf *mrep, *md;
struct sockaddr *nam;
u_long rxid, *tl;
u_int32_t rxid, *tl;
caddr_t dpos, cp2;
int error;
@ -756,7 +756,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) {
#ifndef NFS_NOSERVER
@ -885,7 +885,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;
@ -896,7 +896,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
int t1, nqlflag, cachable, s, error = 0, mrest_len, auth_len, auth_type;
int trylater_delay = NQ_TRYLATERDEL, trylater_cnt = 0, failed_auth = 0;
int verf_len, verf_type;
u_long xid;
u_int32_t xid;
u_quad_t frev;
char *auth_str, *verf_str;
NFSKERBKEY_T key; /* save session key */
@ -953,7 +953,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
*/
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;
@ -1050,7 +1050,7 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
/*
* 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;
@ -1075,17 +1075,17 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* Grab any Kerberos verifier, otherwise just throw it away.
*/
verf_type = fxdr_unsigned(int, *tl++);
i = fxdr_unsigned(int, *tl);
i = fxdr_unsigned(int32_t, *tl);
if ((nmp->nm_flag & NFSMNT_KERB) && verf_type == RPCAUTH_KERB4) {
error = nfs_savenickauth(nmp, cred, i, key, &md, &dpos, mrep);
if (error)
goto nfsmout;
} else if (i > 0)
nfsm_adv(nfsm_rndup(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);
if ((nmp->nm_flag & NFSMNT_NFSV3) &&
@ -1124,11 +1124,11 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
* 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_second) {
@ -1170,7 +1170,7 @@ nfs_rephead(siz, nd, slp, 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;
@ -1186,7 +1186,7 @@ nfs_rephead(siz, nd, slp, 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);
@ -1238,7 +1238,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*tl++ = rpc_auth_kerb;
*tl++ = txdr_unsigned(3 * NFSX_UNSIGNED);
*tl = ktvout.tv_sec;
nfsm_build(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = ktvout.tv_usec;
*tl++ = txdr_unsigned(nuidp->nu_cr.cr_uid);
} else {
@ -1255,7 +1255,7 @@ nfs_rephead(siz, nd, slp, 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);
if (nd->nd_flag & ND_NQNFS) {
*tl++ = txdr_unsigned(3);
*tl = txdr_unsigned(3);
@ -1273,7 +1273,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
default:
*tl = 0;
if (err != NFSERR_RETVOID) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap(nd, err));
else
@ -1288,13 +1288,13 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
*/
if ((nd->nd_flag & ND_NQNFS) && err == 0) {
if (nd->nd_flag & ND_LEASE) {
nfsm_build(tl, u_long *, 5 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nd->nd_flag & ND_LEASE);
*tl++ = txdr_unsigned(cache);
*tl++ = txdr_unsigned(nd->nd_duration);
txdr_hyper(frev, tl);
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = 0;
}
}
@ -1679,12 +1679,12 @@ nfs_getreq(nd, nfsd, 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, cp;
u_long nfsvers, auth_type;
u_int32_t nfsvers, auth_type;
uid_t nickuid;
int error = 0, nqnfs = 0, ticklen;
struct mbuf *mrep, *md;
@ -1698,14 +1698,14 @@ nfs_getreq(nd, nfsd, 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;
nd->nd_flag = 0;
if (*tl++ != rpc_vers) {
@ -1723,7 +1723,7 @@ nfs_getreq(nd, nfsd, has_header)
}
}
tl++;
nfsvers = fxdr_unsigned(u_long, *tl++);
nfsvers = fxdr_unsigned(u_int32_t, *tl++);
if (((nfsvers < NFS_VER2 || nfsvers > NFS_VER3) && !nqnfs) ||
(nfsvers != NQNFS_VER3 && nqnfs)) {
nd->nd_repstat = EPROGMISMATCH;
@ -1734,7 +1734,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_flag = (ND_NFSV3 | ND_NQNFS);
else if (nfsvers == NFS_VER3)
nd->nd_flag = ND_NFSV3;
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 ||
@ -1764,7 +1764,7 @@ nfs_getreq(nd, nfsd, 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);
bzero((caddr_t)&nd->nd_cr, sizeof (struct ucred));
nd->nd_cr.cr_ref = 1;
nd->nd_cr.cr_uid = fxdr_unsigned(uid_t, *tl++);
@ -1774,7 +1774,7 @@ nfs_getreq(nd, nfsd, 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 = 1; i <= len; i++)
if (i < NGROUPS)
nd->nd_cr.cr_groups[i] = fxdr_unsigned(gid_t, *tl++);
@ -1794,7 +1794,7 @@ nfs_getreq(nd, nfsd, has_header)
switch (fxdr_unsigned(int, *tl++)) {
case RPCAKN_FULLNAME:
ticklen = fxdr_unsigned(int, *tl);
*((u_long *)nfsd->nfsd_authstr) = *tl;
*((u_int32_t *)nfsd->nfsd_authstr) = *tl;
uio.uio_resid = nfsm_rndup(ticklen) + NFSX_UNSIGNED;
nfsd->nfsd_authlen = uio.uio_resid + NFSX_UNSIGNED;
if (uio.uio_resid > (len - 2 * NFSX_UNSIGNED)) {
@ -1808,7 +1808,7 @@ nfs_getreq(nd, nfsd, has_header)
iov.iov_base = (caddr_t)&nfsd->nfsd_authstr[4];
iov.iov_len = RPCAUTH_MAXSIZ - 4;
nfsm_mtouio(&uio, uio.uio_resid);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 4 * NFSX_UNSIGNED) {
printf("Bad kerb verifier\n");
@ -1817,7 +1817,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nfsm_dissect(cp, caddr_t, 4 * NFSX_UNSIGNED);
tl = (u_long *)cp;
tl = (u_int32_t *)cp;
if (fxdr_unsigned(int, *tl) != RPCAKN_FULLNAME) {
printf("Not fullname kerb verifier\n");
nd->nd_repstat = (NFSERR_AUTHERR|AUTH_BADVERF);
@ -1838,7 +1838,7 @@ nfs_getreq(nd, nfsd, has_header)
return (0);
}
nickuid = fxdr_unsigned(uid_t, *tl);
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (*tl++ != rpc_auth_kerb ||
fxdr_unsigned(int, *tl) != 3 * NFSX_UNSIGNED) {
printf("Kerb nick verifier bad\n");
@ -1846,7 +1846,7 @@ nfs_getreq(nd, nfsd, has_header)
nd->nd_procnum = NFSPROC_NOOP;
return (0);
}
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
tvin.tv_sec = *tl++;
tvin.tv_usec = *tl;
@ -1898,11 +1898,11 @@ nfs_getreq(nd, nfsd, 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_flag |= fxdr_unsigned(int, *tl);
if (nd->nd_flag & ND_LEASE) {
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int, *tl);
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED);
nd->nd_duration = fxdr_unsigned(int32_t, *tl);
} else
nd->nd_duration = NQ_MINLEASE;
} else
@ -2066,7 +2066,7 @@ nfsrv_getstream(slp, waitflag)
register char *cp1, *cp2;
register int len;
struct mbuf *om, *m2, *recm = NULL;
u_long recmark;
u_int32_t recmark;
if (slp->ns_flag & SLP_GETSTREAM)
panic("nfs getstream");

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
* $Id: nfs_subs.c,v 1.59 1998/05/31 18:11:03 peter Exp $
* $Id: nfs_subs.c,v 1.60 1998/05/31 19:16:08 peter Exp $
*/
/*
@ -83,14 +83,14 @@
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
*/
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_auth_kerb;
u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false;
u_int32_t nfs_prog, nqnfs_prog, nfs_true, nfs_false;
/* And other global data */
static u_long nfs_xid = 0;
static u_int32_t nfs_xid = 0;
static enum vtype nv2tov_type[8]= {
VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON
};
@ -580,7 +580,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;
@ -600,11 +600,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;
}
}
@ -634,15 +634,15 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
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;
int siz, grpsiz, authsiz;
static u_long base;
static u_int32_t base;
authsiz = nfsm_rndup(auth_len);
MGETHDR(mb, M_WAIT, MT_DATA);
@ -660,7 +660,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* First the RPC header.
*/
nfsm_build(tl, u_long *, 8 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
/* Get a pretty random xid to start with */
if (!nfs_xid)
@ -696,7 +696,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
*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);
@ -736,7 +736,7 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
/*
* And the verifier...
*/
nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
if (verf_str) {
*tl++ = txdr_unsigned(RPCAUTH_KERB4);
*tl = txdr_unsigned(verf_len);
@ -1038,14 +1038,14 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
{
register struct mbuf *m1 = NULL, *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;
@ -1066,7 +1066,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);
@ -1207,7 +1207,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
register struct vattr *vap;
register struct nfs_fattr *fp;
register struct nfsnode *np;
register long t1;
register int32_t t1;
caddr_t cp2;
int error = 0, rdev;
struct mbuf *md;
@ -1252,7 +1252,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
*/
if (vtyp == VNON || (vtyp == VREG && (vmode & S_IFMT) != 0))
vtyp = IFTOVT(vmode);
rdev = fxdr_unsigned(long, fp->fa2_rdev);
rdev = fxdr_unsigned(int32_t, fp->fa2_rdev);
fxdr_nfsv2time(&fp->fa2_mtime, &mtime);
/*
@ -1313,7 +1313,8 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
fxdr_hyper(&fp->fa3_size, &vap->va_size);
vap->va_blocksize = NFS_FABLKSIZE;
fxdr_hyper(&fp->fa3_used, &vap->va_bytes);
vap->va_fileid = fxdr_unsigned(int, fp->fa3_fileid.nfsuquad[1]);
vap->va_fileid = fxdr_unsigned(int32_t,
fp->fa3_fileid.nfsuquad[1]);
fxdr_nfsv3time(&fp->fa3_atime, &vap->va_atime);
fxdr_nfsv3time(&fp->fa3_ctime, &vap->va_ctime);
vap->va_flags = 0;
@ -1322,15 +1323,17 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
vap->va_nlink = fxdr_unsigned(u_short, fp->fa_nlink);
vap->va_uid = fxdr_unsigned(uid_t, fp->fa_uid);
vap->va_gid = fxdr_unsigned(gid_t, fp->fa_gid);
vap->va_size = fxdr_unsigned(u_long, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(long, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(long, fp->fa2_blocks) * NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(long, fp->fa2_fileid);
vap->va_size = fxdr_unsigned(u_int32_t, fp->fa2_size);
vap->va_blocksize = fxdr_unsigned(int32_t, fp->fa2_blocksize);
vap->va_bytes = fxdr_unsigned(int32_t, fp->fa2_blocks)
* NFS_FABLKSIZE;
vap->va_fileid = fxdr_unsigned(int32_t, fp->fa2_fileid);
fxdr_nfsv2time(&fp->fa2_atime, &vap->va_atime);
vap->va_flags = 0;
vap->va_ctime.tv_sec = fxdr_unsigned(long, fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_sec = fxdr_unsigned(u_int32_t,
fp->fa2_ctime.nfsv2_sec);
vap->va_ctime.tv_nsec = 0;
vap->va_gen = fxdr_unsigned(u_long, fp->fa2_ctime.nfsv2_usec);
vap->va_gen = fxdr_unsigned(u_int32_t,fp->fa2_ctime.nfsv2_usec);
vap->va_filerev = 0;
}
if (vap->va_size != np->n_size) {
@ -1763,13 +1766,13 @@ nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
if (before_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, 7 * NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(&(before_vap->va_size), tl);
tl += 2;
@ -1792,14 +1795,14 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
{
register struct mbuf *mb = *mbp, *mb2;
register char *bpos = *bposp;
register u_long *tl;
register u_int32_t *tl;
register struct nfs_fattr *fp;
if (after_ret) {
nfsm_build(tl, u_long *, NFSX_UNSIGNED);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FATTR);
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95
* $Id: nfs_syscalls.c,v 1.39 1998/05/31 17:27:53 peter Exp $
* $Id: nfs_syscalls.c,v 1.40 1998/05/31 18:46:06 peter Exp $
*/
#include <sys/param.h>
@ -75,7 +75,7 @@
static MALLOC_DEFINE(M_NFSSVC, "NFS srvsock", "Nfs server structure");
/* Global defs. */
extern int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
extern int32_t (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
struct proc *procp,
struct mbuf **mreqp));
@ -401,15 +401,15 @@ nfssvc_addsock(fp, mynam, p)
*/
if (so->so_type == SOCK_STREAM) {
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, p);
}
if (so->so_proto->pr_domain->dom_family == AF_INET &&
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, p);
}
so->so_rcv.sb_flags &= ~SB_NOINTR;
@ -677,7 +677,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, solockp,
@ -1064,7 +1064,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
int verf_len;
{
register struct nfsuid *nuidp;
register u_long *nickp, *verfp;
register u_int32_t *nickp, *verfp;
struct timeval ktvin, ktvout;
#ifdef DIAGNOSTIC
@ -1085,7 +1085,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru);
TAILQ_INSERT_TAIL(&nmp->nm_uidlruhead, nuidp, nu_lru);
nickp = (u_long *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
nickp = (u_int32_t *)malloc(2 * NFSX_UNSIGNED, M_TEMP, M_WAITOK);
*nickp++ = txdr_unsigned(RPCAKN_NICKNAME);
*nickp = txdr_unsigned(nuidp->nu_nickname);
*auth_str = (char *)nickp;
@ -1094,7 +1094,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
/*
* Now we must encrypt the verifier and package it up.
*/
verfp = (u_long *)verf_str;
verfp = (u_int32_t *)verf_str;
*verfp++ = txdr_unsigned(RPCAKN_NICKNAME);
if (time_second > nuidp->nu_timestamp.tv_sec ||
(time_second == nuidp->nu_timestamp.tv_sec &&
@ -1133,19 +1133,19 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
struct mbuf *mrep;
{
register struct nfsuid *nuidp;
register u_long *tl;
register long t1;
register u_int32_t *tl;
register int32_t t1;
struct mbuf *md = *mdp;
struct timeval ktvin, ktvout;
u_long nick;
u_int32_t nick;
char *dpos = *dposp, *cp2;
int deltasec, error = 0;
if (len == (3 * NFSX_UNSIGNED)) {
nfsm_dissect(tl, u_long *, 3 * NFSX_UNSIGNED);
nfsm_dissect(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
ktvin.tv_sec = *tl++;
ktvin.tv_usec = *tl++;
nick = fxdr_unsigned(u_long, *tl);
nick = fxdr_unsigned(u_int32_t, *tl);
/*
* Decrypt the timestamp in ecb mode.

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
* $Id: nfsm_subs.h,v 1.19 1998/05/31 18:19:43 peter Exp $
* $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
*/
@ -59,7 +59,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
int auth_type, int auth_len, char *auth_str,
int verf_len, char *verf_str,
struct mbuf *mrest, int mrest_len,
struct mbuf **mbp, u_long *xidp));
struct mbuf **mbp, u_int32_t *xidp));
#define M_HASCL(m) ((m)->m_flags & M_EXT)
#define NFSMINOFF(m) \
@ -117,7 +117,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
{ if (v3) { \
t2 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED; \
if (t2 <= M_TRAILINGSPACE(mb)) { \
nfsm_build(tl, u_long *, t2); \
nfsm_build(tl, u_int32_t *, t2); \
*tl++ = txdr_unsigned(VTONFS(v)->n_fhsize); \
*(tl + ((t2>>2) - 2)) = 0; \
bcopy((caddr_t)VTONFS(v)->n_fhp,(caddr_t)tl, \
@ -136,7 +136,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
nfsm_build(tl, u_long *, NFSX_UNSIGNED + NFSX_V3FH); \
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
} else { \
@ -145,7 +145,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} }
#define nfsm_srvpostop_fh(f) \
{ nfsm_build(tl, u_long *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
{ nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = nfs_true; \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
@ -154,7 +154,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_mtofh(d, v, v3, f) \
{ struct nfsnode *ttnp; nfsfh_t *ttfhp; int ttfhsize; \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(f) = fxdr_unsigned(int, *tl); \
} else \
(f) = 1; \
@ -169,7 +169,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
(v) = NFSTOV(ttnp); \
} \
if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (f) \
(f) = fxdr_unsigned(int, *tl); \
else if (fxdr_unsigned(int, *tl)) \
@ -181,7 +181,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_getfh(f, s, v3) \
{ if (v3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int, *tl)) <= 0 || \
(s) > NFSX_V3FHMAX) { \
m_freem(mrep); \
@ -203,8 +203,8 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_postop_attr(v, f) \
{ struct vnode *ttvp = (v); \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
if ((f) = fxdr_unsigned(int, *tl)) { \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (((f) = fxdr_unsigned(int, *tl)) != 0) { \
if ((t1 = nfs_loadattrcache(&ttvp, &md, &dpos, \
(struct vattr *)0)) != 0) { \
error = t1; \
@ -221,12 +221,12 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_wcc_data(v, f) \
{ int ttattrf, ttretf = 0; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 6 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 6 * NFSX_UNSIGNED); \
if (f) \
ttretf = (VTONFS(v)->n_mtime == \
fxdr_unsigned(u_long, *(tl + 2))); \
fxdr_unsigned(u_int32_t, *(tl + 2))); \
} \
nfsm_postop_attr((v), ttattrf); \
if (f) { \
@ -248,23 +248,23 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
}
#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); \
} }
#define nfsm_srvnamesiz(s) \
{ nfsm_dissect(tl,u_long *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(long,*tl)) > NFS_MAXNAMLEN) \
{ nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
if (((s) = fxdr_unsigned(int32_t,*tl)) > NFS_MAXNAMLEN) \
error = NFSERR_NAMETOL; \
if ((s) <= 0) \
error = EBADRPC; \
@ -312,7 +312,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
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((const char *)(a), (caddr_t)tl, (s)); \
@ -369,7 +369,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
#define nfsm_srvmtofh(f) \
{ int fhlen = NFSX_V3FH; \
if (nfsd->nd_flag & ND_NFSV3) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
fhlen = fxdr_unsigned(int, *tl); \
if (fhlen == 0) { \
bzero((caddr_t)(f), NFSX_V3FH); \
@ -379,7 +379,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
} \
} \
if (fhlen != 0) { \
nfsm_dissect(tl, u_long *, NFSX_V3FH); \
nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
if ((nfsd->nd_flag & ND_NFSV3) == 0) \
nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
@ -398,7 +398,7 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
bp = mtod(mp, caddr_t); \
be = bp+mp->m_len; \
} \
tl = (u_long *)bp
tl = (u_int32_t *)bp
#define nfsm_srvfillattr(a, f) \
nfsm_srvfattr(nfsd, (a), (f))
@ -410,40 +410,40 @@ struct mbuf *nfsm_rpchead __P((struct ucred *cr, int nmflag, int procid,
nfsm_srvpostopattr(nfsd, (r), (a), &mb, &bpos)
#define nfsm_srvsattr(a) \
{ nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
{ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_mode = nfstov_mode(*tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_uid = fxdr_unsigned(uid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
(a)->va_gid = fxdr_unsigned(gid_t, *tl); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
if (*tl == nfs_true) { \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_hyper(tl, &(a)->va_size); \
} \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_atime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \
getnanotime(&(a)->va_atime); \
break; \
}; \
nfsm_dissect(tl, u_long *, NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
switch (fxdr_unsigned(int, *tl)) { \
case NFSV3SATTRTIME_TOCLIENT: \
nfsm_dissect(tl, u_long *, 2 * NFSX_UNSIGNED); \
nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
fxdr_nfsv3time(tl, &(a)->va_mtime); \
break; \
case NFSV3SATTRTIME_TOSERVER: \

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
* $Id: nfsproto.h,v 1.4 1998/05/31 17:27:58 peter Exp $
* $Id: nfsproto.h,v 1.5 1998/05/31 19:00:19 peter Exp $
*/
#ifndef _NFS_NFSPROTO_H_
@ -230,12 +230,12 @@
#define vtonfsv2_mode(t,m) \
txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
MAKEIMODE((t), (m)))
#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((long)(a))])
#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((long)(a))])
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_long,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_long,(a))&0x7]
#define vtonfsv3_mode(m) txdr_unsigned((m) & ALLPERMS)
#define nfstov_mode(a) (fxdr_unsigned(u_int32_t, (a)) & ALLPERMS)
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))])
#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))])
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
/* File types */
typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
@ -259,14 +259,14 @@ union nfsfh {
typedef union nfsfh nfsfh_t;
struct nfsv2_time {
u_long nfsv2_sec;
u_long nfsv2_usec;
u_int32_t nfsv2_sec;
u_int32_t nfsv2_usec;
};
typedef struct nfsv2_time nfstime2;
struct nfsv3_time {
u_long nfsv3_sec;
u_long nfsv3_nsec;
u_int32_t nfsv3_sec;
u_int32_t nfsv3_nsec;
};
typedef struct nfsv3_time nfstime3;
@ -275,7 +275,7 @@ typedef struct nfsv3_time nfstime3;
* protocol and to facilitate xdr conversion.
*/
struct nfs_uquad {
u_long nfsuquad[2];
u_int32_t nfsuquad[2];
};
typedef struct nfs_uquad nfsuint64;
@ -283,7 +283,7 @@ typedef struct nfs_uquad nfsuint64;
* Used to convert between two u_longs and a u_quad_t.
*/
union nfs_quadconvert {
u_long lval[2];
u_int32_t lval[2];
u_quad_t qval;
};
typedef union nfs_quadconvert nfsquad_t;
@ -292,8 +292,8 @@ typedef union nfs_quadconvert nfsquad_t;
* NFS Version 3 special file number.
*/
struct nfsv3_spec {
u_long specdata1;
u_long specdata2;
u_int32_t specdata1;
u_int32_t specdata2;
};
typedef struct nfsv3_spec nfsv3spec;
@ -307,19 +307,19 @@ typedef struct nfsv3_spec nfsv3spec;
* NFSX_FATTR(v3) macro.
*/
struct nfs_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 nfsv2fa_size;
u_long nfsv2fa_blocksize;
u_long nfsv2fa_rdev;
u_long nfsv2fa_blocks;
u_long nfsv2fa_fsid;
u_long nfsv2fa_fileid;
u_int32_t nfsv2fa_size;
u_int32_t nfsv2fa_blocksize;
u_int32_t nfsv2fa_rdev;
u_int32_t nfsv2fa_blocks;
u_int32_t nfsv2fa_fsid;
u_int32_t nfsv2fa_fileid;
nfstime2 nfsv2fa_atime;
nfstime2 nfsv2fa_mtime;
nfstime2 nfsv2fa_ctime;
@ -357,10 +357,10 @@ struct nfs_fattr {
#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
struct nfsv2_sattr {
u_long sa_mode;
u_long sa_uid;
u_long sa_gid;
u_long sa_size;
u_int32_t sa_mode;
u_int32_t sa_uid;
u_int32_t sa_gid;
u_int32_t sa_size;
nfstime2 sa_atime;
nfstime2 sa_mtime;
};
@ -369,25 +369,25 @@ struct nfsv2_sattr {
* NFS Version 3 sattr structure for the new node creation case.
*/
struct nfsv3_sattr {
u_long sa_modetrue;
u_long sa_mode;
u_long sa_uidfalse;
u_long sa_gidfalse;
u_long sa_sizefalse;
u_long sa_atimetype;
u_int32_t sa_modetrue;
u_int32_t sa_mode;
u_int32_t sa_uidfalse;
u_int32_t sa_gidfalse;
u_int32_t sa_sizefalse;
u_int32_t sa_atimetype;
nfstime3 sa_atime;
u_long sa_mtimetype;
u_int32_t sa_mtimetype;
nfstime3 sa_mtime;
};
struct nfs_statfs {
union {
struct {
u_long nfsv2sf_tsize;
u_long nfsv2sf_bsize;
u_long nfsv2sf_blocks;
u_long nfsv2sf_bfree;
u_long nfsv2sf_bavail;
u_int32_t nfsv2sf_tsize;
u_int32_t nfsv2sf_bsize;
u_int32_t nfsv2sf_blocks;
u_int32_t nfsv2sf_bfree;
u_int32_t nfsv2sf_bavail;
} sf_nfsv2;
struct {
nfsuint64 nfsv3sf_tbytes;
@ -396,7 +396,7 @@ struct nfs_statfs {
nfsuint64 nfsv3sf_tfiles;
nfsuint64 nfsv3sf_ffiles;
nfsuint64 nfsv3sf_afiles;
u_long nfsv3sf_invarsec;
u_int32_t nfsv3sf_invarsec;
} sf_nfsv3;
} sf_un;
};
@ -415,25 +415,25 @@ struct nfs_statfs {
#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
struct nfsv3_fsinfo {
u_long fs_rtmax;
u_long fs_rtpref;
u_long fs_rtmult;
u_long fs_wtmax;
u_long fs_wtpref;
u_long fs_wtmult;
u_long fs_dtpref;
u_int32_t fs_rtmax;
u_int32_t fs_rtpref;
u_int32_t fs_rtmult;
u_int32_t fs_wtmax;
u_int32_t fs_wtpref;
u_int32_t fs_wtmult;
u_int32_t fs_dtpref;
nfsuint64 fs_maxfilesize;
nfstime3 fs_timedelta;
u_long fs_properties;
u_int32_t fs_properties;
};
struct nfsv3_pathconf {
u_long pc_linkmax;
u_long pc_namemax;
u_long pc_notrunc;
u_long pc_chownrestricted;
u_long pc_caseinsensitive;
u_long pc_casepreserving;
u_int32_t pc_linkmax;
u_int32_t pc_namemax;
u_int32_t pc_notrunc;
u_int32_t pc_chownrestricted;
u_int32_t pc_caseinsensitive;
u_int32_t pc_casepreserving;
};
#endif

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsrvcache.h 8.3 (Berkeley) 3/30/95
* $Id: nfsrvcache.h,v 1.9 1997/06/03 17:22:47 dfr Exp $
* $Id: nfsrvcache.h,v 1.10 1998/02/03 22:15:04 bde Exp $
*/
@ -52,7 +52,7 @@
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 */

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
* $Id: nfs.h,v 1.38 1998/05/31 17:48:03 peter Exp $
* $Id: nfs.h,v 1.39 1998/05/31 19:49:28 peter Exp $
*/
#ifndef _NFS_NFS_H_
@ -204,14 +204,14 @@ 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) */
u_char *nsd_authstr; /* Auth string (ret) */
int nsd_verflen; /* and the verfier */
u_char *nsd_verfstr;
struct timeval nsd_timestamp; /* timestamp from verifier */
u_long nsd_ttl; /* credential ttl (sec) */
u_int32_t nsd_ttl; /* credential ttl (sec) */
NFSKERBKEY_T nsd_key; /* Session key */
};
@ -342,7 +342,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 */
@ -382,7 +382,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
#define NFS_WDELAYHASHSIZ 16 /* and with this */
#endif
#define NWDELAYHASH(sock, f) \
(&(sock)->ns_wdelayhashtbl[(*((u_long *)(f))) % NFS_WDELAYHASHSIZ])
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
#ifndef NFS_MUIDHASHSIZ
#define NFS_MUIDHASHSIZ 63 /* Tune the size of nfsmount with this */
#endif
@ -395,7 +395,7 @@ extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
* Network address hash list element
*/
union nethostaddr {
u_long had_inetaddr;
u_int32_t had_inetaddr;
struct sockaddr *had_nam;
};
@ -407,7 +407,7 @@ struct nfsuid {
struct ucred nu_cr; /* Cred uid mapped to */
int nu_expire; /* Expiry time (sec) */
struct timeval nu_timestamp; /* Kerb. timestamp */
u_long nu_nickname; /* Nickname on server */
u_int32_t nu_nickname; /* Nickname on server */
NFSKERBKEY_T nu_key; /* and session key */
};
@ -439,7 +439,7 @@ struct nfssvc_sock {
int ns_cc;
int ns_reclen;
int ns_numuids;
u_long ns_sref;
u_int32_t ns_sref;
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
@ -502,8 +502,8 @@ struct nfsrv_descript {
int nd_flag; /* nd_flag */
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_long nd_retxid; /* Reply xid */
u_long nd_duration; /* Lease duration */
u_int32_t nd_retxid; /* Reply xid */
u_int32_t nd_duration; /* Lease duration */
struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */