summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_bio.c26
-rw-r--r--sys/nfs/nfs_boot.c12
-rw-r--r--sys/nfs/nfs_node.c6
-rw-r--r--sys/nfs/nfs_serv.c200
-rw-r--r--sys/nfs/nfs_socket.c120
-rw-r--r--sys/nfs/nfs_srvcache.c30
-rw-r--r--sys/nfs/nfs_subs.c134
-rw-r--r--sys/nfs/nfs_syscalls.c103
-rw-r--r--sys/nfs/nfs_vfsops.c49
-rw-r--r--sys/nfs/nfs_vnops.c272
10 files changed, 481 insertions, 471 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index fb26a59aeae..8cf96e5f53b 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.33 2001/12/19 08:58:06 art Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.34 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -70,13 +70,13 @@ struct nfsstats nfsstats;
*/
int
nfs_bioread(vp, uio, ioflag, cred)
- register struct vnode *vp;
- register struct uio *uio;
+ struct vnode *vp;
+ struct uio *uio;
int ioflag;
struct ucred *cred;
{
- register struct nfsnode *np = VTONFS(vp);
- register int biosize, diff;
+ struct nfsnode *np = VTONFS(vp);
+ int biosize, diff;
struct buf *bp = NULL, *rabp;
struct vattr vattr;
struct proc *p;
@@ -289,12 +289,12 @@ nfs_write(v)
int a_ioflag;
struct ucred *a_cred;
} */ *ap = v;
- register int biosize;
- register struct uio *uio = ap->a_uio;
+ int biosize;
+ struct uio *uio = ap->a_uio;
struct proc *p = uio->uio_procp;
- register struct vnode *vp = ap->a_vp;
+ struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
- register struct ucred *cred = ap->a_cred;
+ struct ucred *cred = ap->a_cred;
int ioflag = ap->a_ioflag;
struct buf *bp;
struct vattr vattr;
@@ -455,7 +455,7 @@ nfs_getcacheblk(vp, bn, size, p)
int size;
struct proc *p;
{
- register struct buf *bp;
+ struct buf *bp;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
if (nmp->nm_flag & NFSMNT_INT) {
@@ -482,7 +482,7 @@ nfs_vinvalbuf(vp, flags, cred, p, intrflg)
struct proc *p;
int intrflg;
{
- register struct nfsnode *np = VTONFS(vp);
+ struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
int error = 0, slpflag, slptimeo;
@@ -585,8 +585,8 @@ nfs_doio(bp, p)
struct buf *bp;
struct proc *p;
{
- register struct uio *uiop;
- register struct vnode *vp;
+ struct uio *uiop;
+ struct vnode *vp;
struct nfsnode *np;
struct nfsmount *nmp;
int s, error = 0, diff, len, iomode, must_commit = 0;
diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c
index 679aa744f82..ca528293618 100644
--- a/sys/nfs/nfs_boot.c
+++ b/sys/nfs/nfs_boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_boot.c,v 1.12 2001/11/14 23:37:33 mickey Exp $ */
+/* $OpenBSD: nfs_boot.c,v 1.13 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_boot.c,v 1.26 1996/05/07 02:51:25 thorpej Exp $ */
/*
@@ -140,16 +140,18 @@ nfs_boot_init(nd, procp)
*/
if (nfsbootdevname)
ifp = ifunit(nfsbootdevname);
- else
- for (ifp = ifnet.tqh_first; ifp != 0; ifp = ifp->if_list.tqe_next)
+ else {
+ for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL;
+ ifp = TAILQ_NEXT(ifp, if_list)) {
if ((ifp->if_flags &
(IFF_LOOPBACK|IFF_POINTOPOINT)) == 0)
break;
+ }
+ }
if (ifp == NULL)
panic("nfs_boot: no suitable interface");
bcopy(ifp->if_xname, ireq.ifr_name, IFNAMSIZ);
- printf("nfs_boot: using network interface '%s'\n",
- ireq.ifr_name);
+ printf("nfs_boot: using network interface '%s'\n", ireq.ifr_name);
/*
* Bring up the interface.
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index d88a7649524..00eb790fe97 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_node.c,v 1.19 2001/12/19 08:58:06 art Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.20 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
@@ -124,7 +124,7 @@ nfs_nget(mntp, fhp, fhsize, npp)
nhpp = NFSNOHASH(nfs_hash(fhp, fhsize));
loop:
- for (np = nhpp->lh_first; np != 0; np = np->n_hash.le_next) {
+ for (np = LIST_FIRST(nhpp); np != NULL; np = LIST_NEXT(np, n_hash)) {
if (mntp != NFSTOV(np)->v_mount || np->n_fhsize != fhsize ||
bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize))
continue;
@@ -236,7 +236,7 @@ nfs_reclaim(v)
* this nfs node.
*/
if (vp->v_type == VDIR) {
- dp = np->n_cookies.lh_first;
+ dp = LIST_FIRST(&np->n_cookies);
while (dp) {
dp2 = dp;
dp = dp->ndm_list.le_next;
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index a66f457ceeb..704165b2fa1 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.29 2001/12/19 08:58:06 art Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.30 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -109,8 +109,8 @@ nfsrv3_access(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_t nfh;
fhandle_t *fhp;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache = 0, getret;
char *cp2;
@@ -171,13 +171,13 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct nfs_fattr *fp;
+ struct nfs_fattr *fp;
struct vattr va;
struct vnode *vp;
nfsfh_t nfh;
fhandle_t *fhp;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache;
char *cp2;
@@ -217,13 +217,13 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, preat;
- register struct nfsv2_sattr *sp;
- register struct nfs_fattr *fp;
+ struct nfsv2_sattr *sp;
+ struct nfs_fattr *fp;
struct vnode *vp;
nfsfh_t nfh;
fhandle_t *fhp;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ 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;
@@ -346,14 +346,14 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct nfs_fattr *fp;
+ struct nfs_fattr *fp;
struct nameidata nd;
struct vnode *vp, *dirp;
nfsfh_t nfh;
fhandle_t *fhp;
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1;
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirattr_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -421,10 +421,10 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct iovec iv[(NFS_MAXPATHLEN+MLEN-1)/MLEN];
- register struct iovec *ivp = iv;
- register struct mbuf *mp;
- register u_int32_t *tl;
- register int32_t t1;
+ struct iovec *ivp = iv;
+ struct mbuf *mp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, i, tlen, len, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -520,13 +520,13 @@ nfsrv_read(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct iovec *iv;
+ struct iovec *iv;
struct iovec *iv2;
- register struct mbuf *m;
- register struct nfs_fattr *fp;
- register u_int32_t *tl;
- register int32_t t1;
- register int i;
+ struct mbuf *m;
+ struct nfs_fattr *fp;
+ u_int32_t *tl;
+ int32_t t1;
+ int i;
caddr_t bpos;
int error = 0, rdonly, cache, cnt, len, left, siz, tlen, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3), reqlen;
@@ -686,14 +686,14 @@ nfsrv_write(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct iovec *ivp;
- register int i, cnt;
- register struct mbuf *mp;
- register struct nfs_fattr *fp;
+ struct iovec *ivp;
+ int i, cnt;
+ struct mbuf *mp;
+ struct nfs_fattr *fp;
struct iovec *iv;
struct vattr va, forat;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, len, forat_ret = 1;
int ioflags, aftat_ret = 1, retlen, zeroing, adjust;
@@ -869,17 +869,17 @@ nfsrv_writegather(ndp, slp, procp, mrq)
struct proc *procp;
struct mbuf **mrq;
{
- register struct iovec *ivp;
- register struct mbuf *mp;
- register struct nfsrv_descript *wp, *nfsd, *owp, *swp;
- register struct nfs_fattr *fp;
- register int i = 0;
+ struct iovec *ivp;
+ struct mbuf *mp;
+ struct nfsrv_descript *wp, *nfsd, *owp, *swp;
+ struct nfs_fattr *fp;
+ int i = 0;
struct iovec *iov;
struct nfsrvw_delayhash *wpp;
struct ucred *cred;
struct vattr va, forat;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos, dpos;
int error = 0, rdonly, cache, len = 0, forat_ret = 1;
int ioflags, aftat_ret = 1, s, adjust, v3, zeroing;
@@ -965,10 +965,10 @@ nfsmout:
*/
s = splsoftclock();
owp = NULL;
- wp = slp->ns_tq.lh_first;
+ wp = LIST_FIRST(&slp->ns_tq);
while (wp && wp->nd_time < nfsd->nd_time) {
owp = wp;
- wp = wp->nd_tq.le_next;
+ wp = LIST_NEXT(wp, nd_tq);
}
if (owp) {
LIST_INSERT_AFTER(owp, nfsd, nd_tq);
@@ -978,16 +978,16 @@ nfsmout:
if (nfsd->nd_mrep) {
wpp = NWDELAYHASH(slp, nfsd->nd_fh.fh_fid.fid_data);
owp = NULL;
- wp = wpp->lh_first;
+ wp = LIST_FIRST(wpp);
while (wp &&
bcmp((caddr_t)&nfsd->nd_fh,(caddr_t)&wp->nd_fh,NFSX_V3FH)) {
owp = wp;
- wp = wp->nd_hash.le_next;
+ wp = LIST_NEXT(wp, nd_hash);
}
while (wp && wp->nd_off < nfsd->nd_off &&
- !bcmp((caddr_t)&nfsd->nd_fh,(caddr_t)&wp->nd_fh,NFSX_V3FH)) {
+ !bcmp((caddr_t)&nfsd->nd_fh,(caddr_t)&wp->nd_fh,NFSX_V3FH)) {
owp = wp;
- wp = wp->nd_hash.le_next;
+ wp = LIST_NEXT(wp, nd_hash);
}
if (owp) {
LIST_INSERT_AFTER(owp, nfsd, nd_hash);
@@ -997,7 +997,7 @@ nfsmout:
* coalesce.
*/
for(; nfsd && NFSW_CONTIG(owp, nfsd); nfsd = wp) {
- wp = nfsd->nd_hash.le_next;
+ wp = LIST_NEXT(nfsd, nd_hash);
if (NFSW_SAMECRED(owp, nfsd))
nfsrvw_coalesce(owp, nfsd);
}
@@ -1015,8 +1015,8 @@ nfsmout:
loop1:
cur_usec = (u_quad_t)time.tv_sec * 1000000 + (u_quad_t)time.tv_usec;
s = splsoftclock();
- for (nfsd = slp->ns_tq.lh_first; nfsd; nfsd = owp) {
- owp = nfsd->nd_tq.le_next;
+ for (nfsd = LIST_FIRST(&slp->ns_tq); nfsd != NULL; nfsd = owp) {
+ owp = LIST_NEXT(nfsd, nd_tq);
if (nfsd->nd_time > cur_usec)
break;
if (nfsd->nd_mreq)
@@ -1135,7 +1135,7 @@ loop1:
nfsd->nd_time = 0;
LIST_INSERT_HEAD(&slp->ns_tq, nfsd, nd_tq);
}
- nfsd = swp->nd_coalesce.lh_first;
+ nfsd = LIST_FIRST(&swp->nd_coalesce);
if (nfsd) {
LIST_REMOVE(nfsd, nd_tq);
}
@@ -1153,13 +1153,15 @@ loop1:
* Search for a reply to return.
*/
s = splsoftclock();
- for (nfsd = slp->ns_tq.lh_first; nfsd; nfsd = nfsd->nd_tq.le_next)
+ for (nfsd = LIST_FIRST(&slp->ns_tq); nfsd != NULL;
+ nfsd = LIST_NEXT(nfsd, nd_tq)) {
if (nfsd->nd_mreq) {
LIST_REMOVE(nfsd, nd_tq);
*mrq = nfsd->nd_mreq;
*ndp = nfsd;
break;
}
+ }
splx(s);
return (0);
}
@@ -1174,11 +1176,11 @@ loop1:
*/
void
nfsrvw_coalesce(owp, nfsd)
- register struct nfsrv_descript *owp;
- register struct nfsrv_descript *nfsd;
+ struct nfsrv_descript *owp;
+ struct nfsrv_descript *nfsd;
{
- register int overlap;
- register struct mbuf *mp;
+ int overlap;
+ struct mbuf *mp;
LIST_REMOVE(nfsd, nd_hash);
LIST_REMOVE(nfsd, nd_tq);
@@ -1232,13 +1234,13 @@ nfsrv_create(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct nfs_fattr *fp;
+ struct nfs_fattr *fp;
struct vattr va, dirfor, diraft;
- register struct nfsv2_sattr *sp;
- register u_int32_t *tl;
+ struct nfsv2_sattr *sp;
+ u_int32_t *tl;
struct nameidata nd;
- register caddr_t cp;
- register int32_t t1;
+ caddr_t cp;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, tsize, dirfor_ret = 1, diraft_ret = 1;
dev_t rdev = 0;
@@ -1472,9 +1474,9 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
- register u_int32_t *tl;
+ u_int32_t *tl;
struct nameidata nd;
- register int32_t t1;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
u_int32_t major, minor;
@@ -1620,8 +1622,8 @@ nfsrv_remove(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct nameidata nd;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -1703,8 +1705,8 @@ nfsrv_rename(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ 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;
@@ -1884,8 +1886,8 @@ nfsrv_link(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct nameidata nd;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ 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);
@@ -1981,8 +1983,8 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
struct nameidata nd;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
struct nfsv2_sattr *sp;
char *bpos, *pathcp = NULL, *cp2;
struct uio io;
@@ -2121,11 +2123,11 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
struct vattr va, dirfor, diraft;
- register struct nfs_fattr *fp;
+ struct nfs_fattr *fp;
struct nameidata nd;
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1;
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -2234,8 +2236,8 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, cache, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -2363,12 +2365,12 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register char *bp, *be;
- register struct mbuf *mp;
- register struct dirent *dp;
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1;
+ char *bp, *be;
+ struct mbuf *mp;
+ struct dirent *dp;
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
struct mbuf *mb, *mb2, *mreq, *mp2;
char *cpos, *cend, *cp2, *rbuf;
@@ -2624,12 +2626,12 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register char *bp, *be;
- register struct mbuf *mp;
- register struct dirent *dp;
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1;
+ char *bp, *be;
+ struct mbuf *mp;
+ struct dirent *dp;
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
struct mbuf *mb, *mb2, *mreq, *mp2;
char *cpos, *cend, *cp2, *rbuf;
@@ -2925,8 +2927,8 @@ nfsrv_commit(nfsd, slp, procp, mrq)
struct vnode *vp;
nfsfh_t nfh;
fhandle_t *fhp;
- register u_int32_t *tl;
- register int32_t t1;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, for_ret = 1, aft_ret = 1, cnt, cache;
char *cp2;
@@ -2983,10 +2985,10 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register struct statfs *sf;
- register struct nfs_statfs *sfp;
- register u_int32_t *tl;
- register int32_t t1;
+ struct statfs *sf;
+ struct nfs_statfs *sfp;
+ u_int32_t *tl;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -3062,9 +3064,9 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register u_int32_t *tl;
- register struct nfsv3_fsinfo *sip;
- register int32_t t1;
+ u_int32_t *tl;
+ struct nfsv3_fsinfo *sip;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1, pref;
char *cp2;
@@ -3133,9 +3135,9 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
struct mbuf *nam = nfsd->nd_nam;
caddr_t dpos = nfsd->nd_dpos;
struct ucred *cred = &nfsd->nd_cr;
- register u_int32_t *tl;
- register struct nfsv3_pathconf *pc;
- register int32_t t1;
+ u_int32_t *tl;
+ struct nfsv3_pathconf *pc;
+ int32_t t1;
caddr_t bpos;
int error = 0, rdonly, cache, getret = 1;
register_t linkmax, namemax, chownres, notrunc;
@@ -3248,9 +3250,9 @@ nfsrv_noop(nfsd, slp, procp, mrq)
*/
int
nfsrv_access(vp, flags, cred, rdonly, p, override)
- register struct vnode *vp;
+ struct vnode *vp;
int flags;
- register struct ucred *cred;
+ struct ucred *cred;
int rdonly;
struct proc *p;
int override;
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 8f52565b268..4c1e84d529c 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.22 2001/06/25 03:28:09 csapuntz Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.23 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -142,10 +142,10 @@ struct nfsrtt nfsrtt;
*/
int
nfs_connect(nmp, rep)
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
struct nfsreq *rep;
{
- register struct socket *so;
+ struct socket *so;
int s, error, rcvreserve, sndreserve;
struct sockaddr *saddr;
struct sockaddr_in *sin;
@@ -303,10 +303,10 @@ bad:
*/
int
nfs_reconnect(rep)
- register struct nfsreq *rep;
+ struct nfsreq *rep;
{
- register struct nfsreq *rp;
- register struct nfsmount *nmp = rep->r_nmp;
+ struct nfsreq *rp;
+ struct nfsmount *nmp = rep->r_nmp;
int error;
nfs_disconnect(nmp);
@@ -320,7 +320,8 @@ nfs_reconnect(rep)
* Loop through outstanding request list and fix up all requests
* on old socket.
*/
- for (rp = nfs_reqq.tqh_first; rp != 0; rp = rp->r_chain.tqe_next) {
+ for (rp = TAILQ_FIRST(&nfs_reqq); rp != NULL;
+ rp = TAILQ_NEXT(rp, r_chain)) {
if (rp->r_nmp == nmp)
rp->r_flags |= R_MUSTRESEND;
}
@@ -332,9 +333,9 @@ nfs_reconnect(rep)
*/
void
nfs_disconnect(nmp)
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
{
- register struct socket *so;
+ struct socket *so;
if (nmp->nm_so) {
so = nmp->nm_so;
@@ -359,9 +360,9 @@ nfs_disconnect(nmp)
*/
int
nfs_send(so, nam, top, rep)
- register struct socket *so;
+ struct socket *so;
struct mbuf *nam;
- register struct mbuf *top;
+ struct mbuf *top;
struct nfsreq *rep;
{
struct mbuf *sendnam;
@@ -428,14 +429,14 @@ nfs_send(so, nam, top, rep)
*/
int
nfs_receive(rep, aname, mp)
- register struct nfsreq *rep;
+ struct nfsreq *rep;
struct mbuf **aname;
struct mbuf **mp;
{
- register struct socket *so;
+ struct socket *so;
struct uio auio;
struct iovec aio;
- register struct mbuf *m;
+ struct mbuf *m;
struct mbuf *control;
u_int32_t len;
struct mbuf **getnam;
@@ -641,9 +642,9 @@ int
nfs_reply(myrep)
struct nfsreq *myrep;
{
- register struct nfsreq *rep;
- register struct nfsmount *nmp = myrep->r_nmp;
- register int32_t t1;
+ struct nfsreq *rep;
+ struct nfsmount *nmp = myrep->r_nmp;
+ int32_t t1;
struct mbuf *mrep, *nam, *md;
u_int32_t rxid, *tl;
caddr_t dpos, cp2;
@@ -708,8 +709,8 @@ nfsmout:
* Loop through the request list to match up the reply
* Iff no match, just drop the datagram
*/
- for (rep = nfs_reqq.tqh_first; rep != 0;
- rep = rep->r_chain.tqe_next) {
+ for (rep = TAILQ_FIRST(&nfs_reqq); rep != NULL;
+ rep = TAILQ_NEXT(rep, r_chain)) {
if (rep->r_mrep == NULL && rxid == rep->r_xid) {
/* Found it.. */
rep->r_mrep = mrep;
@@ -810,10 +811,10 @@ nfs_request(vp, mrest, procnum, procp, cred, mrp, mdp, dposp)
struct mbuf **mdp;
caddr_t *dposp;
{
- register struct mbuf *m, *mrep;
- register struct nfsreq *rep;
- register u_int32_t *tl;
- register int i;
+ struct mbuf *m, *mrep;
+ struct nfsreq *rep;
+ u_int32_t *tl;
+ int i;
struct nfsmount *nmp;
struct mbuf *md, *mheadend;
char nickv[RPCX_NICKVERF];
@@ -1076,8 +1077,8 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
struct mbuf **mbp;
caddr_t *bposp;
{
- register u_int32_t *tl;
- register struct mbuf *mreq;
+ u_int32_t *tl;
+ struct mbuf *mreq;
caddr_t bpos;
struct mbuf *mb, *mb2;
@@ -1117,11 +1118,11 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
* verifier back, otherwise just RPCAUTH_NULL.
*/
if (nd->nd_flag & ND_KERBFULL) {
- register struct nfsuid *nuidp;
+ struct nfsuid *nuidp;
struct timeval ktvin, ktvout;
for (nuidp = NUIDHASH(slp, nd->nd_cr.cr_uid)->lh_first;
- nuidp != 0; nuidp = nuidp->nu_hash.le_next) {
+ nuidp != NULL; nuidp = LIST_NEXT(nuidp, nu_hash)) {
if (nuidp->nu_cr.cr_uid == nd->nd_cr.cr_uid &&
(!nd->nd_nam2 || netaddr_match(NU_NETFAM(nuidp),
&nuidp->nu_haddr, nd->nd_nam2)))
@@ -1216,7 +1217,8 @@ nfs_timer(arg)
#endif
s = splsoftnet();
- for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) {
+ for (rep = TAILQ_FIRST(&nfs_reqq); rep != NULL;
+ rep = TAILQ_NEXT(rep, r_chain)) {
nmp = rep->r_nmp;
if (rep->r_mrep || (rep->r_flags & R_SOFTTERM))
continue;
@@ -1309,9 +1311,10 @@ nfs_timer(arg)
* completed now.
*/
cur_usec = (u_quad_t)time.tv_sec * 1000000 + (u_quad_t)time.tv_usec;
- for (slp = nfssvc_sockhead.tqh_first; slp != 0;
- slp = slp->ns_chain.tqe_next) {
- if (slp->ns_tq.lh_first && slp->ns_tq.lh_first->nd_time<=cur_usec)
+ for (slp = TAILQ_FIRST(&nfssvc_sockhead); slp != NULL;
+ slp = TAILQ_NEXT(slp, ns_chain)) {
+ if (LIST_FIRST(&slp->ns_tq) &&
+ LIST_FIRST(&slp->ns_tq)->nd_time <= cur_usec)
nfsrv_wakenfsd(slp);
}
#endif /* NFSSERVER */
@@ -1327,7 +1330,7 @@ int
nfs_sigintr(nmp, rep, p)
struct nfsmount *nmp;
struct nfsreq *rep;
- register struct proc *p;
+ struct proc *p;
{
if (rep && (rep->r_flags & R_SOFTTERM))
@@ -1349,7 +1352,7 @@ nfs_sigintr(nmp, rep, p)
*/
int
nfs_sndlock(flagp, rep)
- register int *flagp;
+ int *flagp;
struct nfsreq *rep;
{
struct proc *p;
@@ -1381,7 +1384,7 @@ nfs_sndlock(flagp, rep)
*/
void
nfs_sndunlock(flagp)
- register int *flagp;
+ int *flagp;
{
if ((*flagp & NFSMNT_SNDLOCK) == 0)
@@ -1395,9 +1398,9 @@ nfs_sndunlock(flagp)
int
nfs_rcvlock(rep)
- register struct nfsreq *rep;
+ struct nfsreq *rep;
{
- register int *flagp = &rep->r_nmp->nm_flag;
+ int *flagp = &rep->r_nmp->nm_flag;
int slpflag, slptimeo = 0;
if (*flagp & NFSMNT_INT)
@@ -1424,7 +1427,7 @@ nfs_rcvlock(rep)
*/
void
nfs_rcvunlock(flagp)
- register int *flagp;
+ int *flagp;
{
if ((*flagp & NFSMNT_RCVLOCK) == 0)
@@ -1442,12 +1445,12 @@ nfs_rcvunlock(flagp)
*/
void
nfs_realign(m, hsiz)
- register struct mbuf *m;
+ struct mbuf *m;
int hsiz;
{
- register struct mbuf *m2;
- register int siz, mlen, olen;
- register caddr_t tcp, fcp;
+ struct mbuf *m2;
+ int siz, mlen, olen;
+ caddr_t tcp, fcp;
struct mbuf *mnew;
while (m) {
@@ -1535,13 +1538,13 @@ nfs_realign(m, hsiz)
*/
int
nfs_getreq(nd, nfsd, has_header)
- register struct nfsrv_descript *nd;
+ struct nfsrv_descript *nd;
struct nfsd *nfsd;
int has_header;
{
- register int len, i;
- register u_int32_t *tl;
- register int32_t t1;
+ int len, i;
+ u_int32_t *tl;
+ int32_t t1;
struct uio uio;
struct iovec iov;
caddr_t dpos, cp2, cp;
@@ -1549,7 +1552,7 @@ nfs_getreq(nd, nfsd, has_header)
uid_t nickuid;
int error = 0, ticklen;
struct mbuf *mrep, *md;
- register struct nfsuid *nuidp;
+ struct nfsuid *nuidp;
struct timeval tvin, tvout;
mrep = nd->nd_mrep;
@@ -1702,7 +1705,7 @@ nfs_getreq(nd, nfsd, has_header)
tvin.tv_usec = *tl;
for (nuidp = NUIDHASH(nfsd->nfsd_slp,nickuid)->lh_first;
- nuidp != 0; nuidp = nuidp->nu_hash.le_next) {
+ nuidp != NULL; nuidp = LIST_NEXT(nuidp, nu_hash)) {
if (nuidp->nu_cr.cr_uid == nickuid &&
(!nd->nd_nam2 ||
netaddr_match(NU_NETFAM(nuidp),
@@ -1812,8 +1815,8 @@ nfsrv_rcv(so, arg, waitflag)
caddr_t arg;
int waitflag;
{
- register struct nfssvc_sock *slp = (struct nfssvc_sock *)arg;
- register struct mbuf *m;
+ struct nfssvc_sock *slp = (struct nfssvc_sock *)arg;
+ struct mbuf *m;
struct mbuf *mp, *nam;
struct uio auio;
int flags, error;
@@ -1921,12 +1924,12 @@ dorecs:
*/
int
nfsrv_getstream(slp, waitflag)
- register struct nfssvc_sock *slp;
+ struct nfssvc_sock *slp;
int waitflag;
{
- register struct mbuf *m, **mpp;
- register char *cp1, *cp2;
- register int len;
+ struct mbuf *m, **mpp;
+ char *cp1, *cp2;
+ int len;
struct mbuf *om, *m2, *recm = NULL;
u_int32_t recmark;
@@ -2042,12 +2045,12 @@ nfsrv_getstream(slp, waitflag)
*/
int
nfsrv_dorec(slp, nfsd, ndp)
- register struct nfssvc_sock *slp;
+ struct nfssvc_sock *slp;
struct nfsd *nfsd;
struct nfsrv_descript **ndp;
{
- register struct mbuf *m, *nam;
- register struct nfsrv_descript *nd;
+ struct mbuf *m, *nam;
+ struct nfsrv_descript *nd;
int error;
*ndp = NULL;
@@ -2091,11 +2094,12 @@ void
nfsrv_wakenfsd(slp)
struct nfssvc_sock *slp;
{
- register struct nfsd *nd;
+ struct nfsd *nd;
if ((slp->ns_flag & SLP_VALID) == 0)
return;
- for (nd = nfsd_head.tqh_first; nd != 0; nd = nd->nfsd_chain.tqe_next) {
+ for (nd = TAILQ_FIRST(&nfsd_head); nd != NULL;
+ nd = TAILQ_NEXT(nd, nfsd_chain)) {
if (nd->nfsd_flag & NFSD_WAITING) {
nd->nfsd_flag &= ~NFSD_WAITING;
if (nd->nfsd_slp)
diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c
index 8aaa06382cc..1b5f2fd0b17 100644
--- a/sys/nfs/nfs_srvcache.c
+++ b/sys/nfs/nfs_srvcache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_srvcache.c,v 1.7 2001/06/25 03:28:09 csapuntz Exp $ */
+/* $OpenBSD: nfs_srvcache.c,v 1.8 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */
/*
@@ -163,11 +163,11 @@ nfsrv_initcache()
*/
int
nfsrv_getcache(nd, slp, repp)
- register struct nfsrv_descript *nd;
+ struct nfsrv_descript *nd;
struct nfssvc_sock *slp;
struct mbuf **repp;
{
- register struct nfsrvcache *rp;
+ struct nfsrvcache *rp;
struct mbuf *mb;
struct sockaddr_in *saddr;
caddr_t bpos;
@@ -180,8 +180,8 @@ nfsrv_getcache(nd, slp, repp)
if (!nd->nd_nam2)
return (RC_DOIT);
loop:
- for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != 0;
- rp = rp->rc_hash.le_next) {
+ for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != NULL;
+ rp = LIST_NEXT(rp, rc_hash)) {
if (nd->nd_retxid == rp->rc_xid && nd->nd_procnum == rp->rc_proc &&
netaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) {
if ((rp->rc_flag & RC_LOCKED) != 0) {
@@ -191,7 +191,7 @@ loop:
}
rp->rc_flag |= RC_LOCKED;
/* If not at end of LRU chain, move it there */
- if (rp->rc_lru.tqe_next) {
+ if (TAILQ_NEXT(rp, rc_lru)) {
TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru);
TAILQ_INSERT_TAIL(&nfsrvlruhead, rp, rc_lru);
}
@@ -231,11 +231,11 @@ loop:
numnfsrvcache++;
rp->rc_flag = RC_LOCKED;
} else {
- rp = nfsrvlruhead.tqh_first;
+ rp = TAILQ_FIRST(&nfsrvlruhead);
while ((rp->rc_flag & RC_LOCKED) != 0) {
rp->rc_flag |= RC_WANTED;
(void) tsleep((caddr_t)rp, PZERO-1, "nfsrc", 0);
- rp = nfsrvlruhead.tqh_first;
+ rp = TAILQ_FIRST(&nfsrvlruhead);
}
rp->rc_flag |= RC_LOCKED;
LIST_REMOVE(rp, rc_hash);
@@ -276,17 +276,17 @@ loop:
*/
void
nfsrv_updatecache(nd, repvalid, repmbuf)
- register struct nfsrv_descript *nd;
+ struct nfsrv_descript *nd;
int repvalid;
struct mbuf *repmbuf;
{
- register struct nfsrvcache *rp;
+ struct nfsrvcache *rp;
if (!nd->nd_nam2)
return;
loop:
- for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != 0;
- rp = rp->rc_hash.le_next) {
+ for (rp = NFSRCHASH(nd->nd_retxid)->lh_first; rp != NULL;
+ rp = LIST_NEXT(rp, rc_hash)) {
if (nd->nd_retxid == rp->rc_xid && nd->nd_procnum == rp->rc_proc &&
netaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) {
if ((rp->rc_flag & RC_LOCKED) != 0) {
@@ -327,10 +327,10 @@ loop:
void
nfsrv_cleancache()
{
- register struct nfsrvcache *rp, *nextrp;
+ struct nfsrvcache *rp, *nextrp;
- for (rp = nfsrvlruhead.tqh_first; rp != 0; rp = nextrp) {
- nextrp = rp->rc_lru.tqe_next;
+ for (rp = TAILQ_FIRST(&nfsrvlruhead); rp != NULL; rp = nextrp) {
+ nextrp = TAILQ_NEXT(rp, rc_lru);
LIST_REMOVE(rp, rc_hash);
TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru);
free(rp, M_NFSD);
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 15dded43510..c317cb7781d 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.39 2002/01/11 01:20:56 nate Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.40 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -552,8 +552,8 @@ nfsm_reqh(vp, procid, hsiz, bposp)
int hsiz;
caddr_t *bposp;
{
- register struct mbuf *mb;
- register caddr_t bpos;
+ struct mbuf *mb;
+ caddr_t bpos;
MGET(mb, M_WAIT, MT_DATA);
if (hsiz >= MINCLSIZE)
@@ -575,7 +575,7 @@ nfsm_reqh(vp, procid, hsiz, bposp)
struct mbuf *
nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
verf_str, mrest, mrest_len, mbp, xidp)
- register struct ucred *cr;
+ struct ucred *cr;
int nmflag;
int procid;
int auth_type;
@@ -588,10 +588,10 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
struct mbuf **mbp;
u_int32_t *xidp;
{
- register struct mbuf *mb;
- register u_int32_t *tl;
- register caddr_t bpos;
- register int i;
+ struct mbuf *mb;
+ u_int32_t *tl;
+ caddr_t bpos;
+ int i;
struct mbuf *mreq, *mb2;
int siz, grpsiz, authsiz;
@@ -728,13 +728,13 @@ nfsm_rpchead(cr, nmflag, procid, auth_type, auth_len, auth_str, verf_len,
int
nfsm_mbuftouio(mrep, uiop, siz, dpos)
struct mbuf **mrep;
- register struct uio *uiop;
+ struct uio *uiop;
int siz;
caddr_t *dpos;
{
- register char *mbufcp, *uiocp;
- register int xfer, left, len;
- register struct mbuf *mp;
+ char *mbufcp, *uiocp;
+ int xfer, left, len;
+ struct mbuf *mp;
long uiosiz, rem;
int error = 0;
@@ -803,14 +803,14 @@ nfsm_mbuftouio(mrep, uiop, siz, dpos)
*/
int
nfsm_uiotombuf(uiop, mq, siz, bpos)
- register struct uio *uiop;
+ struct uio *uiop;
struct mbuf **mq;
int siz;
caddr_t *bpos;
{
- register char *uiocp;
- register struct mbuf *mp, *mp2;
- register int xfer, left, mlen;
+ char *uiocp;
+ struct mbuf *mp, *mp2;
+ int xfer, left, mlen;
int uiosiz, clflg, rem;
char *cp;
@@ -895,9 +895,9 @@ nfsm_disct(mdp, dposp, siz, left, cp2)
int left;
caddr_t *cp2;
{
- register struct mbuf *mp, *mp2;
- register int siz2, xfer;
- register caddr_t p;
+ struct mbuf *mp, *mp2;
+ int siz2, xfer;
+ caddr_t p;
mp = *mdp;
while (left == 0) {
@@ -957,8 +957,8 @@ nfs_adv(mdp, dposp, offs, left)
int offs;
int left;
{
- register struct mbuf *m;
- register int s;
+ struct mbuf *m;
+ int s;
m = *mdp;
s = left;
@@ -984,7 +984,7 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
char *cp;
long siz;
{
- register struct mbuf *m1 = NULL, *m2;
+ struct mbuf *m1 = NULL, *m2;
long left, xfer, len, tlen;
u_int32_t *tl;
int putsize;
@@ -1084,7 +1084,7 @@ int
nfs_vfs_init(vfsp)
struct vfsconf *vfsp;
{
- register int i;
+ int i;
/* Ensure async daemons disabled */
for (i = 0; i < NFS_MAXASYNCDAEMON; i++)
@@ -1116,12 +1116,12 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
caddr_t *dposp;
struct vattr *vaper;
{
- register struct vnode *vp = *vpp;
- register struct vattr *vap;
- register struct nfs_fattr *fp;
+ struct vnode *vp = *vpp;
+ struct vattr *vap;
+ struct nfs_fattr *fp;
extern int (**spec_nfsv2nodeop_p) __P((void *));
- register struct nfsnode *np;
- register int32_t t1;
+ struct nfsnode *np;
+ int32_t t1;
caddr_t cp2;
int error = 0;
int32_t rdev;
@@ -1299,11 +1299,11 @@ nfs_attrtimeo (np)
*/
int
nfs_getattrcache(vp, vaper)
- register struct vnode *vp;
+ struct vnode *vp;
struct vattr *vaper;
{
- register struct nfsnode *np = VTONFS(vp);
- register struct vattr *vap;
+ struct nfsnode *np = VTONFS(vp);
+ struct vattr *vap;
if ((time.tv_sec - np->n_attrstamp) >= nfs_attrtimeo(np)) {
nfsstats.attrcache_misses++;
@@ -1340,7 +1340,7 @@ nfs_getattrcache(vp, vaper)
*/
int
nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag)
- register struct nameidata *ndp;
+ struct nameidata *ndp;
fhandle_t *fhp;
int len;
struct nfssvc_sock *slp;
@@ -1351,9 +1351,9 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag)
struct proc *p;
int kerbflag;
{
- register int i, rem;
- register struct mbuf *md;
- register char *fromcp, *tocp;
+ int i, rem;
+ struct mbuf *md;
+ char *fromcp, *tocp;
struct vnode *dp;
int error, rdonly;
struct componentname *cnp = &ndp->ni_cnd;
@@ -1457,12 +1457,12 @@ out:
void
nfsm_adj(mp, len, nul)
struct mbuf *mp;
- register int len;
+ int len;
int nul;
{
- register struct mbuf *m;
- register int count, i;
- register char *cp;
+ struct mbuf *m;
+ int count, i;
+ char *cp;
/*
* Trim from tail. Scan the mbuf chain,
@@ -1520,15 +1520,15 @@ void
nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
struct nfsrv_descript *nfsd;
int before_ret;
- register struct vattr *before_vap;
+ struct vattr *before_vap;
int after_ret;
struct vattr *after_vap;
struct mbuf **mbp;
char **bposp;
{
- register struct mbuf *mb = *mbp, *mb2;
- register char *bpos = *bposp;
- register u_int32_t *tl;
+ struct mbuf *mb = *mbp, *mb2;
+ char *bpos = *bposp;
+ u_int32_t *tl;
if (before_ret) {
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
@@ -1555,10 +1555,10 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
struct mbuf **mbp;
char **bposp;
{
- register struct mbuf *mb = *mbp, *mb2;
- register char *bpos = *bposp;
- register u_int32_t *tl;
- register struct nfs_fattr *fp;
+ struct mbuf *mb = *mbp, *mb2;
+ char *bpos = *bposp;
+ u_int32_t *tl;
+ struct nfs_fattr *fp;
if (after_ret) {
nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
@@ -1575,9 +1575,9 @@ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
void
nfsm_srvfattr(nfsd, vap, fp)
- register struct nfsrv_descript *nfsd;
- register struct vattr *vap;
- register struct nfs_fattr *fp;
+ struct nfsrv_descript *nfsd;
+ struct vattr *vap;
+ struct nfs_fattr *fp;
{
fp->fa_nlink = txdr_unsigned(vap->va_nlink);
@@ -1634,8 +1634,8 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp, kerbflag)
int kerbflag;
{
struct proc *p = curproc; /* XXX */
- register struct mount *mp;
- register int i;
+ struct mount *mp;
+ int i;
struct ucred *credanon;
int error, exflags;
struct sockaddr_in *saddr;
@@ -1701,7 +1701,7 @@ netaddr_match(family, haddr, nam)
union nethostaddr *haddr;
struct mbuf *nam;
{
- register struct sockaddr_in *inetaddr;
+ struct sockaddr_in *inetaddr;
switch (family) {
case AF_INET:
@@ -1713,7 +1713,7 @@ netaddr_match(family, haddr, nam)
#ifdef ISO
case AF_ISO:
{
- register struct sockaddr_iso *isoaddr1, *isoaddr2;
+ struct sockaddr_iso *isoaddr1, *isoaddr2;
isoaddr1 = mtod(nam, struct sockaddr_iso *);
isoaddr2 = mtod(haddr->had_nam, struct sockaddr_iso *);
@@ -1741,18 +1741,18 @@ void
nfs_clearcommit(mp)
struct mount *mp;
{
- register struct vnode *vp, *nvp;
- register struct buf *bp, *nbp;
+ struct vnode *vp, *nvp;
+ struct buf *bp, *nbp;
int s;
s = splbio();
loop:
- for (vp = mp->mnt_vnodelist.lh_first; vp; vp = nvp) {
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; vp = nvp) {
if (vp->v_mount != mp) /* Paranoia */
goto loop;
- nvp = vp->v_mntvnodes.le_next;
- for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
- nbp = bp->b_vnbufs.le_next;
+ nvp = LIST_NEXT(vp, v_mntvnodes);
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
+ nbp = LIST_NEXT(bp, b_vnbufs);
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
== (B_DELWRI | B_NEEDCOMMIT))
bp->b_flags &= ~B_NEEDCOMMIT;
@@ -1768,9 +1768,9 @@ loop:
int
nfsrv_errmap(nd, err)
struct nfsrv_descript *nd;
- register int err;
+ int err;
{
- register short *defaulterrp, *errp;
+ short *defaulterrp, *errp;
if (nd->nd_flag & ND_NFSV3) {
if (nd->nd_procnum <= NFSPROC_COMMIT) {
@@ -1797,10 +1797,10 @@ nfsrv_errmap(nd, err)
*/
void
nfsrvw_sort(list, num)
- register gid_t *list;
- register int num;
+ gid_t *list;
+ int num;
{
- register int i, j;
+ int i, j;
gid_t v;
/* Insertion sort. */
@@ -1818,9 +1818,9 @@ nfsrvw_sort(list, num)
*/
void
nfsrv_setcred(incred, outcred)
- register struct ucred *incred, *outcred;
+ struct ucred *incred, *outcred;
{
- register int i;
+ int i;
bzero((caddr_t)outcred, sizeof (struct ucred));
outcred->cr_ref = 1;
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 35653cc1479..f9ea458157a 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.23 2002/01/11 01:20:56 nate Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.24 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -189,8 +189,9 @@ nfs_clientd(struct nfsmount *nmp, struct ucred *cred, struct nfsd_cargs *ncd,
/*
* Finally, we can free up the mount structure.
*/
- for (nuidp = nmp->nm_uidlruhead.tqh_first; nuidp != 0; nuidp = nnuidp) {
- nnuidp = nuidp->nu_lru.tqe_next;
+ for (nuidp = TAILQ_FIRST(&nmp->nm_uidlruhead); nuidp != NULL;
+ nuidp = nnuidp) {
+ nnuidp = TAILQ_NEXT(nuidp, nu_lru);
LIST_REMOVE(nuidp, nu_hash);
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru);
free((caddr_t)nuidp, M_NFSUID);
@@ -219,7 +220,7 @@ sys_nfssvc(p, v, retval)
void *v;
register_t *retval;
{
- register struct sys_nfssvc_args /* {
+ struct sys_nfssvc_args /* {
syscallarg(int) flag;
syscallarg(caddr_t) argp;
} */ *uap = v;
@@ -317,7 +318,7 @@ sys_nfssvc(p, v, retval)
* added this credential.
*/
for (nuidp = NUIDHASH(slp,nsd->nsd_cr.cr_uid)->lh_first;
- nuidp != 0; nuidp = nuidp->nu_hash.le_next) {
+ nuidp != NULL; nuidp = LIST_NEXT(nuidp, nu_hash)) {
if (nuidp->nu_cr.cr_uid == nsd->nsd_cr.cr_uid &&
(!nfsd->nfsd_nd->nd_nam2 ||
netaddr_match(NU_NETFAM(nuidp),
@@ -343,7 +344,7 @@ sys_nfssvc(p, v, retval)
free((caddr_t)nuidp, M_NFSUID);
} else {
if (nuidp == (struct nfsuid *)0) {
- nuidp = slp->ns_uidlruhead.tqh_first;
+ nuidp = TAILQ_FIRST(&slp->ns_uidlruhead);
LIST_REMOVE(nuidp, nu_hash);
TAILQ_REMOVE(&slp->ns_uidlruhead, nuidp,
nu_lru);
@@ -412,10 +413,10 @@ nfssvc_addsock(fp, mynam)
struct file *fp;
struct mbuf *mynam;
{
- register struct mbuf *m;
- register int siz;
- register struct nfssvc_sock *slp;
- register struct socket *so;
+ struct mbuf *m;
+ int siz;
+ struct nfssvc_sock *slp;
+ struct socket *so;
struct nfssvc_sock *tslp;
int error, s;
@@ -503,11 +504,11 @@ nfssvc_nfsd(nsd, argp, p)
caddr_t argp;
struct proc *p;
{
- register struct mbuf *m;
- register int siz;
- register struct nfssvc_sock *slp;
- register struct socket *so;
- register int *solockp;
+ struct mbuf *m;
+ int siz;
+ struct nfssvc_sock *slp;
+ struct socket *so;
+ int *solockp;
struct nfsd *nfsd = nsd->nsd_nfsd;
struct nfsrv_descript *nd = NULL;
struct mbuf *mreq;
@@ -543,10 +544,10 @@ nfssvc_nfsd(nsd, argp, p)
if (error)
goto done;
}
- if (nfsd->nfsd_slp == (struct nfssvc_sock *)0 &&
+ if (nfsd->nfsd_slp == NULL &&
(nfsd_head_flag & NFSD_CHECKSLP) != 0) {
- for (slp = nfssvc_sockhead.tqh_first; slp != 0;
- slp = slp->ns_chain.tqe_next) {
+ for (slp = TAILQ_FIRST(&nfssvc_sockhead);
+ slp != 0; slp = TAILQ_NEXT(slp, ns_chain)) {
if ((slp->ns_flag & (SLP_VALID | SLP_DOREC))
== (SLP_VALID | SLP_DOREC)) {
slp->ns_flag &= ~SLP_DOREC;
@@ -574,8 +575,9 @@ nfssvc_nfsd(nsd, argp, p)
error = nfsrv_dorec(slp, nfsd, &nd);
cur_usec = (u_quad_t)time.tv_sec * 1000000 +
(u_quad_t)time.tv_usec;
- if (error && slp->ns_tq.lh_first &&
- slp->ns_tq.lh_first->nd_time <= cur_usec) {
+ if (error && LIST_FIRST(&slp->ns_tq) &&
+ LIST_FIRST(&slp->ns_tq)->nd_time
+ <= cur_usec) {
error = 0;
cacherep = RC_DOIT;
writes_todo = 1;
@@ -732,8 +734,8 @@ nfssvc_nfsd(nsd, argp, p)
cur_usec = (u_quad_t)time.tv_sec * 1000000 +
(u_quad_t)time.tv_usec;
s = splsoftclock();
- if (slp->ns_tq.lh_first &&
- slp->ns_tq.lh_first->nd_time <= cur_usec) {
+ if (LIST_FIRST(&slp->ns_tq) &&
+ LIST_FIRST(&slp->ns_tq)->nd_time <= cur_usec) {
cacherep = RC_DOIT;
writes_todo = 1;
} else
@@ -767,10 +769,10 @@ done:
*/
void
nfsrv_zapsock(slp)
- register struct nfssvc_sock *slp;
+ struct nfssvc_sock *slp;
{
- register struct nfsuid *nuidp, *nnuidp;
- register struct nfsrv_descript *nwp, *nnwp;
+ struct nfsuid *nuidp, *nnuidp;
+ struct nfsrv_descript *nwp, *nnwp;
struct socket *so;
struct file *fp;
struct mbuf *m;
@@ -788,9 +790,9 @@ nfsrv_zapsock(slp)
MFREE(slp->ns_nam, m);
m_freem(slp->ns_raw);
m_freem(slp->ns_rec);
- for (nuidp = slp->ns_uidlruhead.tqh_first; nuidp != 0;
+ for (nuidp = TAILQ_FIRST(&slp->ns_uidlruhead); nuidp != NULL;
nuidp = nnuidp) {
- nnuidp = nuidp->nu_lru.tqe_next;
+ nnuidp = TAILQ_NEXT(nuidp, nu_lru);
LIST_REMOVE(nuidp, nu_hash);
TAILQ_REMOVE(&slp->ns_uidlruhead, nuidp, nu_lru);
if (nuidp->nu_flag & NU_NAM)
@@ -798,8 +800,8 @@ nfsrv_zapsock(slp)
free((caddr_t)nuidp, M_NFSUID);
}
s = splsoftclock();
- for (nwp = slp->ns_tq.lh_first; nwp; nwp = nnwp) {
- nnwp = nwp->nd_tq.le_next;
+ for (nwp = LIST_FIRST(&slp->ns_tq); nwp != NULL; nwp = nnwp) {
+ nnwp = LIST_NEXT(nwp, nd_tq);
LIST_REMOVE(nwp, nd_tq);
free((caddr_t)nwp, M_NFSRVDESC);
}
@@ -814,7 +816,7 @@ nfsrv_zapsock(slp)
*/
void
nfsrv_slpderef(slp)
- register struct nfssvc_sock *slp;
+ struct nfssvc_sock *slp;
{
if (--(slp->ns_sref) == 0 && (slp->ns_flag & SLP_VALID) == 0) {
TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain);
@@ -831,14 +833,15 @@ void
nfsrv_init(terminating)
int terminating;
{
- register struct nfssvc_sock *slp, *nslp;
+ struct nfssvc_sock *slp, *nslp;
if (nfssvc_sockhead_flag & SLP_INIT)
panic("nfsd init");
nfssvc_sockhead_flag |= SLP_INIT;
if (terminating) {
- for (slp = nfssvc_sockhead.tqh_first; slp != 0; slp = nslp) {
- nslp = slp->ns_chain.tqe_next;
+ for (slp = TAILQ_FIRST(&nfssvc_sockhead); slp != NULL;
+ slp = nslp) {
+ nslp = TAILQ_NEXT(slp, ns_chain);
if (slp->ns_flag & SLP_VALID)
nfsrv_zapsock(slp);
TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain);
@@ -876,10 +879,10 @@ nfsrv_init(terminating)
static void
nfsd_rt(sotype, nd, cacherep)
int sotype;
- register struct nfsrv_descript *nd;
+ struct nfsrv_descript *nd;
int cacherep;
{
- register struct drt *rt;
+ struct drt *rt;
rt = &nfsdrt.drt[nfsdrt.pos];
if (cacherep == RC_DOIT)
@@ -914,8 +917,8 @@ int
nfssvc_iod(p)
struct proc *p;
{
- register struct buf *bp, *nbp;
- register int i, myiod;
+ struct buf *bp, *nbp;
+ int i, myiod;
struct vnode *vp;
int error = 0, s;
@@ -937,12 +940,12 @@ nfssvc_iod(p)
* Just loop around doin our stuff until SIGKILL
*/
for (;;) {
- while (nfs_bufq.tqh_first == NULL && error == 0) {
+ while (TAILQ_FIRST(&nfs_bufq) == NULL && error == 0) {
nfs_iodwant[myiod] = p;
error = tsleep((caddr_t)&nfs_iodwant[myiod],
PWAIT | PCATCH, "nfsidl", 0);
}
- while ((bp = nfs_bufq.tqh_first) != NULL) {
+ while ((bp = TAILQ_FIRST(&nfs_bufq)) != NULL) {
/* Take one off the front of the list */
TAILQ_REMOVE(&nfs_bufq, bp, b_freelist);
if (bp->b_flags & B_READ)
@@ -956,8 +959,8 @@ nfssvc_iod(p)
*/
vp = bp->b_vp;
s = splbio();
- for (nbp = vp->v_dirtyblkhd.lh_first; nbp;
- nbp = nbp->b_vnbufs.le_next) {
+ for (nbp = LIST_FIRST(&vp->v_dirtyblkhd); nbp != NULL;
+ nbp = LIST_NEXT(nbp, b_vnbufs)) {
if ((nbp->b_flags &
(B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI)
continue;
@@ -1035,7 +1038,7 @@ nfs_getset_niothreads(set)
*/
int
nfs_getauth(nmp, rep, cred, auth_str, auth_len, verf_str, verf_len, key)
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
struct nfsreq *rep;
struct ucred *cred;
char **auth_str;
@@ -1104,8 +1107,8 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
char *verf_str;
int verf_len;
{
- register struct nfsuid *nuidp;
- register u_int32_t *nickp, *verfp;
+ struct nfsuid *nuidp;
+ u_int32_t *nickp, *verfp;
struct timeval ktvin, ktvout;
#ifdef DIAGNOSTIC
@@ -1113,7 +1116,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
panic("nfs_getnickauth verf too small");
#endif
for (nuidp = NMUIDHASH(nmp, cred->cr_uid)->lh_first;
- nuidp != 0; nuidp = nuidp->nu_hash.le_next) {
+ nuidp != NULL; nuidp = LIST_NEXT(nuidp, nu_hash)) {
if (nuidp->nu_cr.cr_uid == cred->cr_uid)
break;
}
@@ -1165,7 +1168,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len)
*/
int
nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
struct ucred *cred;
int len;
NFSKERBKEY_T key;
@@ -1173,9 +1176,9 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
char **dposp;
struct mbuf *mrep;
{
- register struct nfsuid *nuidp;
- register u_int32_t *tl;
- register int32_t t1;
+ struct nfsuid *nuidp;
+ u_int32_t *tl;
+ int32_t t1;
struct mbuf *md = *mdp;
struct timeval ktvin, ktvout;
u_int32_t nick;
@@ -1209,7 +1212,7 @@ nfs_savenickauth(nmp, cred, len, key, mdp, dposp, mrep)
malloc(sizeof (struct nfsuid), M_NFSUID,
M_WAITOK);
} else {
- nuidp = nmp->nm_uidlruhead.tqh_first;
+ nuidp = TAILQ_FIRST(&nmp->nm_uidlruhead);
LIST_REMOVE(nuidp, nu_hash);
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp,
nu_lru);
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 2790e6ca1fb..a9c2791843b 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.43 2002/01/11 01:20:56 nate Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.44 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -115,14 +115,14 @@ struct mount *nfs_mount_diskless
int
nfs_statfs(mp, sbp, p)
struct mount *mp;
- register struct statfs *sbp;
+ struct statfs *sbp;
struct proc *p;
{
- register struct vnode *vp;
- register struct nfs_statfs *sfp = NULL;
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1, t2;
+ struct vnode *vp;
+ struct nfs_statfs *sfp = NULL;
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct nfsmount *nmp = VFSTONFS(mp);
int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
@@ -191,15 +191,15 @@ nfs_statfs(mp, sbp, p)
*/
int
nfs_fsinfo(nmp, vp, cred, p)
- register struct nfsmount *nmp;
- register struct vnode *vp;
+ struct nfsmount *nmp;
+ struct vnode *vp;
struct ucred *cred;
struct proc *p;
{
- register struct nfsv3_fsinfo *fsp;
- register caddr_t cp;
- register int32_t t1, t2;
- register u_int32_t *tl, pref, max;
+ struct nfsv3_fsinfo *fsp;
+ caddr_t cp;
+ int32_t t1, t2;
+ u_int32_t *tl, pref, max;
caddr_t bpos, dpos, cp2;
int error = 0, retattr;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -643,7 +643,7 @@ nfs_mount(mp, path, data, ndp, p)
}
if (mp->mnt_flag & MNT_UPDATE) {
- register struct nfsmount *nmp = VFSTONFS(mp);
+ struct nfsmount *nmp = VFSTONFS(mp);
if (nmp == NULL)
return (EIO);
@@ -683,12 +683,12 @@ nfs_mount(mp, path, data, ndp, p)
*/
int
mountnfs(argp, mp, nam, pth, hst)
- register struct nfs_args *argp;
- register struct mount *mp;
+ struct nfs_args *argp;
+ struct mount *mp;
struct mbuf *nam;
char *pth, *hst;
{
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
int error;
if (mp->mnt_flag & MNT_UPDATE) {
@@ -766,7 +766,7 @@ nfs_unmount(mp, mntflags, p)
int mntflags;
struct proc *p;
{
- register struct nfsmount *nmp;
+ struct nfsmount *nmp;
int error, flags = 0;
if (mntflags & MNT_FORCE)
@@ -840,23 +840,22 @@ nfs_sync(mp, waitfor, cred, p)
struct ucred *cred;
struct proc *p;
{
- register struct vnode *vp;
+ struct vnode *vp;
int error, allerror = 0;
/*
* Force stale buffer cache information to be flushed.
*/
loop:
- for (vp = mp->mnt_vnodelist.lh_first;
- vp != NULL;
- vp = vp->v_mntvnodes.le_next) {
+ for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL;
+ vp = LIST_NEXT(vp, v_mntvnodes)) {
/*
* If the vnode that we are about to sync is no longer
* associated with this mount point, start over.
*/
if (vp->v_mount != mp)
goto loop;
- if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL ||
+ if (VOP_ISLOCKED(vp) || LIST_FIRST(&vp->v_dirtyblkhd) == NULL ||
waitfor == MNT_LAZY)
continue;
if (vget(vp, LK_EXCLUSIVE, p))
@@ -947,7 +946,7 @@ nfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
/* ARGSUSED */
int
nfs_fhtovp(mp, fhp, vpp)
- register struct mount *mp;
+ struct mount *mp;
struct fid *fhp;
struct vnode **vpp;
{
@@ -1004,7 +1003,7 @@ nfs_quotactl(mp, cmd, uid, arg, p)
/* ARGUSED */
int
nfs_checkexp(mp, nam, exflagsp, credanonp)
- register struct mount *mp;
+ struct mount *mp;
struct mbuf *nam;
int *exflagsp;
struct ucred **credanonp;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 14c28a1e302..c4dd3e30242 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.46 2001/12/22 09:58:04 art Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.47 2002/01/16 21:51:16 ericj Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -269,10 +269,10 @@ nfs_access(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct vnode *vp = ap->a_vp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -361,7 +361,7 @@ nfs_open(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
+ struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
struct vattr vattr;
int error;
@@ -462,8 +462,8 @@ nfs_close(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
int error = 0;
if (vp->v_type == VREG) {
@@ -496,11 +496,11 @@ nfs_getattr(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
- register caddr_t cp;
- register u_int32_t *tl;
- register int32_t t1, t2;
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
+ caddr_t cp;
+ u_int32_t *tl;
+ int32_t t1, t2;
caddr_t bpos, dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -540,9 +540,9 @@ nfs_setattr(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
- register struct vattr *vap = ap->a_vap;
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
+ struct vattr *vap = ap->a_vap;
int error = 0;
u_quad_t tsize = 0;
@@ -619,9 +619,9 @@ nfs_setattrrpc(vp, vap, cred, procp)
struct ucred *cred;
struct proc *procp;
{
- register struct nfsv2_sattr *sp;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct nfsv2_sattr *sp;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
u_int32_t *tl;
int error = 0, wccflag = NFSV3_WCCRATTR;
@@ -677,15 +677,15 @@ nfs_lookup(v)
struct vnode **a_vpp;
struct componentname *a_cnp;
} */ *ap = v;
- register struct componentname *cnp = ap->a_cnp;
- register struct vnode *dvp = ap->a_dvp;
- register struct vnode **vpp = ap->a_vpp;
+ struct componentname *cnp = ap->a_cnp;
+ struct vnode *dvp = ap->a_dvp;
+ struct vnode **vpp = ap->a_vpp;
struct proc *p = cnp->cn_proc;
- register int flags = cnp->cn_flags;
- register struct vnode *newvp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ int flags = cnp->cn_flags;
+ struct vnode *newvp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
struct nfsmount *nmp;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -834,7 +834,7 @@ nfs_read(v)
int a_ioflag;
struct ucred *a_cred;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
+ struct vnode *vp = ap->a_vp;
if (vp->v_type != VREG)
return (EPERM);
@@ -853,7 +853,7 @@ nfs_readlink(v)
struct uio *a_uio;
struct ucred *a_cred;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
+ struct vnode *vp = ap->a_vp;
if (vp->v_type != VLNK)
return (EPERM);
@@ -866,13 +866,13 @@ nfs_readlink(v)
*/
int
nfs_readlinkrpc(vp, uiop, cred)
- register struct vnode *vp;
+ struct vnode *vp;
struct uio *uiop;
struct ucred *cred;
{
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, len, attrflag;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -997,7 +997,7 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
*tl++ = txdr_unsigned(*iomode);
*tl = txdr_unsigned(len);
} else {
- register u_int32_t x;
+ u_int32_t x;
nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
/* Set both "begin" and "current" to non-garbage. */
@@ -1073,15 +1073,15 @@ nfsmout:
*/
int
nfs_mknodrpc(dvp, vpp, cnp, vap)
- register struct vnode *dvp;
- register struct vnode **vpp;
- register struct componentname *cnp;
- register struct vattr *vap;
+ struct vnode *dvp;
+ struct vnode **vpp;
+ struct componentname *cnp;
+ struct vattr *vap;
{
- register struct nfsv2_sattr *sp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct nfsv2_sattr *sp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np;
char *cp2;
@@ -1194,13 +1194,13 @@ nfs_create(v)
struct componentname *a_cnp;
struct vattr *a_vap;
} */ *ap = v;
- register struct vnode *dvp = ap->a_dvp;
- register struct vattr *vap = ap->a_vap;
- register struct componentname *cnp = ap->a_cnp;
- register struct nfsv2_sattr *sp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct vnode *dvp = ap->a_dvp;
+ struct vattr *vap = ap->a_vap;
+ struct componentname *cnp = ap->a_cnp;
+ struct nfsv2_sattr *sp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
caddr_t bpos, dpos, cp2;
@@ -1229,8 +1229,8 @@ again:
if (fmode & O_EXCL) {
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
- if (in_ifaddr.tqh_first)
- *tl++ = in_ifaddr.tqh_first->ia_addr.sin_addr.s_addr;
+ if (TAILQ_FIRST(&in_ifaddr))
+ *tl++ = TAILQ_FIRST(&in_ifaddr)->ia_addr.sin_addr.s_addr;
else
*tl++ = create_verf;
*tl = ++create_verf;
@@ -1307,10 +1307,10 @@ nfs_remove(v)
struct vnode * a_vp;
struct componentname * a_cnp;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct vnode *dvp = ap->a_dvp;
- register struct componentname *cnp = ap->a_cnp;
- register struct nfsnode *np = VTONFS(vp);
+ struct vnode *vp = ap->a_vp;
+ struct vnode *dvp = ap->a_dvp;
+ struct componentname *cnp = ap->a_cnp;
+ struct nfsnode *np = VTONFS(vp);
int error = 0;
struct vattr vattr;
@@ -1364,7 +1364,7 @@ nfs_remove(v)
*/
int
nfs_removeit(sp)
- register struct sillyrename *sp;
+ struct sillyrename *sp;
{
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred,
@@ -1376,15 +1376,15 @@ nfs_removeit(sp)
*/
int
nfs_removerpc(dvp, name, namelen, cred, proc)
- register struct vnode *dvp;
+ struct vnode *dvp;
char *name;
int namelen;
struct ucred *cred;
struct proc *proc;
{
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1420,12 +1420,12 @@ nfs_rename(v)
struct vnode *a_tvp;
struct componentname *a_tcnp;
} */ *ap = v;
- register struct vnode *fvp = ap->a_fvp;
- register struct vnode *tvp = ap->a_tvp;
- register struct vnode *fdvp = ap->a_fdvp;
- register struct vnode *tdvp = ap->a_tdvp;
- register struct componentname *tcnp = ap->a_tcnp;
- register struct componentname *fcnp = ap->a_fcnp;
+ struct vnode *fvp = ap->a_fvp;
+ struct vnode *tvp = ap->a_tvp;
+ struct vnode *fdvp = ap->a_fdvp;
+ struct vnode *tdvp = ap->a_tdvp;
+ struct componentname *tcnp = ap->a_tcnp;
+ struct componentname *fcnp = ap->a_fcnp;
int error;
#ifndef DIAGNOSTIC
@@ -1483,7 +1483,7 @@ int
nfs_renameit(sdvp, scnp, sp)
struct vnode *sdvp;
struct componentname *scnp;
- register struct sillyrename *sp;
+ struct sillyrename *sp;
{
return (nfs_renamerpc(sdvp, scnp->cn_nameptr, scnp->cn_namelen,
sdvp, sp->s_name, sp->s_namlen, scnp->cn_cred, scnp->cn_proc));
@@ -1494,18 +1494,18 @@ nfs_renameit(sdvp, scnp, sp)
*/
int
nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
- register struct vnode *fdvp;
+ struct vnode *fdvp;
char *fnameptr;
int fnamelen;
- register struct vnode *tdvp;
+ struct vnode *tdvp;
char *tnameptr;
int tnamelen;
struct ucred *cred;
struct proc *proc;
{
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ u_int32_t *tl;
+ caddr_t cp;
+ 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;
@@ -1546,12 +1546,12 @@ nfs_link(v)
struct vnode *a_vp;
struct componentname *a_cnp;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct vnode *dvp = ap->a_dvp;
- register struct componentname *cnp = ap->a_cnp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct vnode *vp = ap->a_vp;
+ struct vnode *dvp = ap->a_dvp;
+ struct componentname *cnp = ap->a_cnp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1615,13 +1615,13 @@ nfs_symlink(v)
struct vattr *a_vap;
char *a_target;
} */ *ap = v;
- register struct vnode *dvp = ap->a_dvp;
- register struct vattr *vap = ap->a_vap;
- register struct componentname *cnp = ap->a_cnp;
- register struct nfsv2_sattr *sp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct vnode *dvp = ap->a_dvp;
+ struct vattr *vap = ap->a_vap;
+ struct componentname *cnp = ap->a_cnp;
+ struct nfsv2_sattr *sp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1681,14 +1681,14 @@ nfs_mkdir(v)
struct componentname *a_cnp;
struct vattr *a_vap;
} */ *ap = v;
- register struct vnode *dvp = ap->a_dvp;
- register struct vattr *vap = ap->a_vap;
- register struct componentname *cnp = ap->a_cnp;
- register struct nfsv2_sattr *sp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
- register int len;
+ struct vnode *dvp = ap->a_dvp;
+ struct vattr *vap = ap->a_vap;
+ struct componentname *cnp = ap->a_cnp;
+ struct nfsv2_sattr *sp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
+ int len;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
caddr_t bpos, dpos, cp2;
@@ -1762,12 +1762,12 @@ nfs_rmdir(v)
struct vnode *a_vp;
struct componentname *a_cnp;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct vnode *dvp = ap->a_dvp;
- register struct componentname *cnp = ap->a_cnp;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct vnode *vp = ap->a_vp;
+ struct vnode *dvp = ap->a_dvp;
+ struct componentname *cnp = ap->a_cnp;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
@@ -1990,12 +1990,12 @@ nfs_readdirrpc(struct vnode *vp,
struct ucred *cred,
int *end_of_directory)
{
- register int len, left;
+ int len, left;
struct nfs_dirent *ndp = NULL;
- register struct dirent *dp = NULL;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ struct dirent *dp = NULL;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
caddr_t bpos, dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
nfsuint64 cookie;
@@ -2174,13 +2174,13 @@ int
nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
int *end_of_directory)
{
- register int len, left;
+ int len, left;
struct nfs_dirent *ndirp = NULL;
- register struct dirent *dp = NULL;
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
- register struct vnode *newvp;
+ struct dirent *dp = NULL;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
+ struct vnode *newvp;
caddr_t bpos, dpos, cp2, dpossav1, dpossav2;
struct mbuf *mreq, *mrep, *md, *mb, *mb2, *mdsav1, *mdsav2;
struct nameidata nami, *ndp = &nami;
@@ -2400,7 +2400,7 @@ nfs_sillyrename(dvp, vp, cnp)
struct vnode *dvp, *vp;
struct componentname *cnp;
{
- register struct sillyrename *sp;
+ struct sillyrename *sp;
struct nfsnode *np;
int error;
@@ -2456,16 +2456,16 @@ bad:
*/
int
nfs_lookitup(dvp, name, len, cred, procp, npp)
- register struct vnode *dvp;
+ struct vnode *dvp;
char *name;
int len;
struct ucred *cred;
struct proc *procp;
struct nfsnode **npp;
{
- register u_int32_t *tl;
- register caddr_t cp;
- register int32_t t1, t2;
+ u_int32_t *tl;
+ caddr_t cp;
+ int32_t t1, t2;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np, *dnp = VTONFS(dvp);
caddr_t bpos, dpos, cp2;
@@ -2586,7 +2586,7 @@ nfs_bmap(v)
daddr_t *a_bnp;
int *a_runp;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
+ struct vnode *vp = ap->a_vp;
if (ap->a_vpp != NULL)
*ap->a_vpp = vp;
@@ -2686,8 +2686,8 @@ again:
bvecpos = 0;
if (NFS_ISV3(vp) && commit) {
s = splbio();
- for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
- nbp = bp->b_vnbufs.le_next;
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
+ nbp = LIST_NEXT(bp, b_vnbufs);
if (bvecpos >= NFS_COMMITBVECSIZ)
break;
if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT))
@@ -2748,8 +2748,8 @@ again:
*/
loop:
s = splbio();
- for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) {
- nbp = bp->b_vnbufs.le_next;
+ for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp != NULL; bp = nbp) {
+ nbp = LIST_NEXT(bp, b_vnbufs);
if (bp->b_flags & B_BUSY) {
if (waitfor != MNT_WAIT || passone)
continue;
@@ -2799,8 +2799,8 @@ loop:
}
goto loop2;
}
-
- if (vp->v_dirtyblkhd.lh_first && commit) {
+
+ if (LIST_FIRST(&vp->v_dirtyblkhd) && commit) {
#if 0
vprint("nfs_fsync: dirty", vp);
#endif
@@ -2850,7 +2850,7 @@ nfs_advlock(v)
struct flock *a_fl;
int a_flags;
} */ *ap = v;
- register struct nfsnode *np = VTONFS(ap->a_vp);
+ struct nfsnode *np = VTONFS(ap->a_vp);
return (lf_advlock(&np->n_lockf, np->n_size, ap->a_id, ap->a_op,
ap->a_fl, ap->a_flags));
@@ -2866,8 +2866,8 @@ nfs_print(v)
struct vop_print_args /* {
struct vnode *a_vp;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
printf("tag VT_NFS, fileid %ld fsid 0x%lx",
np->n_vattr.va_fileid, np->n_vattr.va_fsid);
@@ -2899,11 +2899,11 @@ nfs_bwrite(v)
*/
int
nfs_writebp(bp, force)
- register struct buf *bp;
+ struct buf *bp;
int force;
{
- register int oldflags = bp->b_flags, retv = 1;
- register struct proc *p = curproc; /* XXX */
+ int oldflags = bp->b_flags, retv = 1;
+ struct proc *p = curproc; /* XXX */
off_t off;
int s;
@@ -3018,7 +3018,7 @@ nfsspec_read(v)
int a_ioflag;
struct ucred *a_cred;
} */ *ap = v;
- register struct nfsnode *np = VTONFS(ap->a_vp);
+ struct nfsnode *np = VTONFS(ap->a_vp);
/*
* Set access flag.
@@ -3042,7 +3042,7 @@ nfsspec_write(v)
int a_ioflag;
struct ucred *a_cred;
} */ *ap = v;
- register struct nfsnode *np = VTONFS(ap->a_vp);
+ struct nfsnode *np = VTONFS(ap->a_vp);
/*
* Set update flag.
@@ -3068,8 +3068,8 @@ nfsspec_close(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
struct vattr vattr;
if (np->n_flag & (NACC | NUPD)) {
@@ -3102,7 +3102,7 @@ nfsfifo_read(v)
struct ucred *a_cred;
} */ *ap = v;
extern int (**fifo_vnodeop_p) __P((void *));
- register struct nfsnode *np = VTONFS(ap->a_vp);
+ struct nfsnode *np = VTONFS(ap->a_vp);
/*
* Set access flag.
@@ -3127,7 +3127,7 @@ nfsfifo_write(v)
struct ucred *a_cred;
} */ *ap = v;
extern int (**fifo_vnodeop_p) __P((void *));
- register struct nfsnode *np = VTONFS(ap->a_vp);
+ struct nfsnode *np = VTONFS(ap->a_vp);
/*
* Set update flag.
@@ -3153,8 +3153,8 @@ nfsfifo_close(v)
struct ucred *a_cred;
struct proc *a_p;
} */ *ap = v;
- register struct vnode *vp = ap->a_vp;
- register struct nfsnode *np = VTONFS(vp);
+ struct vnode *vp = ap->a_vp;
+ struct nfsnode *np = VTONFS(vp);
struct vattr vattr;
extern int (**fifo_vnodeop_p) __P((void *));