summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_bio.c10
-rw-r--r--sys/nfs/nfs_node.c6
-rw-r--r--sys/nfs/nfs_serv.c38
-rw-r--r--sys/nfs/nfs_socket.c66
-rw-r--r--sys/nfs/nfs_subs.c8
-rw-r--r--sys/nfs/nfs_syscalls.c16
-rw-r--r--sys/nfs/nfs_vfsops.c6
-rw-r--r--sys/nfs/nfs_vnops.c40
-rw-r--r--sys/nfs/nfsm_subs.h6
9 files changed, 97 insertions, 99 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index f727197a23e..80748a74a3e 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.59 2009/06/23 08:08:50 jasper Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.60 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -429,7 +429,7 @@ again:
if (error)
return (error);
} else if ((n + on) == biosize) {
- bp->b_proc = (struct proc *)0;
+ bp->b_proc = NULL;
bp->b_flags |= B_ASYNC;
(void)nfs_writebp(bp, 0);
} else {
@@ -463,9 +463,9 @@ nfs_getcacheblk(vp, bn, size, p)
if (nmp->nm_flag & NFSMNT_INT) {
bp = getblk(vp, bn, size, PCATCH, 0);
- while (bp == (struct buf *)0) {
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p))
- return ((struct buf *)0);
+ while (bp == NULL) {
+ if (nfs_sigintr(nmp, NULL, p))
+ return (NULL);
bp = getblk(vp, bn, size, 0, 2 * hz);
}
} else
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index 58040d660ad..4557d6f21fe 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_node.c,v 1.44 2008/12/24 02:43:52 thib Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.45 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
@@ -167,9 +167,9 @@ nfs_inactive(v)
if (ap->a_vp->v_type != VDIR) {
sp = np->n_sillyrename;
- np->n_sillyrename = (struct sillyrename *)0;
+ np->n_sillyrename = NULL;
} else
- sp = (struct sillyrename *)0;
+ sp = NULL;
if (sp) {
/*
* Remove the silly file that was rename'd earlier
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index a4fc8cbbfd0..54fdd986716 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.76 2009/07/17 12:36:21 blambert Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.77 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -462,7 +462,7 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
uiop->uio_resid = len;
uiop->uio_rw = UIO_READ;
uiop->uio_segflg = UIO_SYSSPACE;
- uiop->uio_procp = (struct proc *)0;
+ uiop->uio_procp = NULL;
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
m_freem(mp3);
@@ -797,7 +797,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
uiop->uio_resid = len;
uiop->uio_rw = UIO_WRITE;
uiop->uio_segflg = UIO_SYSSPACE;
- uiop->uio_procp = (struct proc *)0;
+ uiop->uio_procp = NULL;
uiop->uio_offset = off;
error = VOP_WRITE(vp, uiop, ioflags, cred);
nfsstats.srvvop_writes++;
@@ -1040,7 +1040,7 @@ loop1:
ioflags = (IO_SYNC | IO_NODELOCKED);
uiop->uio_rw = UIO_WRITE;
uiop->uio_segflg = UIO_SYSSPACE;
- uiop->uio_procp = (struct proc *)0;
+ uiop->uio_procp = NULL;
uiop->uio_offset = nfsd->nd_off;
uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off;
if (uiop->uio_resid > 0) {
@@ -1253,7 +1253,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
procp);
else {
vrele(dirp);
- dirp = (struct vnode *)0;
+ dirp = NULL;
}
}
if (error) {
@@ -1471,7 +1471,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
enum vtype vtyp;
char *cp2;
struct mbuf *mb, *mreq;
- struct vnode *vp, *dirp = (struct vnode *)0;
+ struct vnode *vp, *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
@@ -1728,7 +1728,7 @@ nfsrv_rename(nfsd, slp, procp, mrq)
procp);
else {
vrele(fdirp);
- fdirp = (struct vnode *)0;
+ fdirp = NULL;
}
}
if (error) {
@@ -1755,7 +1755,7 @@ nfsrv_rename(nfsd, slp, procp, mrq)
procp);
else {
vrele(tdirp);
- tdirp = (struct vnode *)0;
+ tdirp = NULL;
}
}
if (error) {
@@ -1879,7 +1879,7 @@ nfsrv_link(nfsd, slp, procp, mrq)
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
struct mbuf *mb, *mreq;
- struct vnode *vp, *xp, *dirp = (struct vnode *)0;
+ struct vnode *vp, *xp, *dirp = NULL;
struct vattr dirfor, diraft, at;
nfsfh_t nfh, dnfh;
fhandle_t *fhp, *dfhp;
@@ -1909,7 +1909,7 @@ nfsrv_link(nfsd, slp, procp, mrq)
procp);
else {
vrele(dirp);
- dirp = (struct vnode *)0;
+ dirp = NULL;
}
}
if (error)
@@ -1978,7 +1978,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
int error = 0, len, len2, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
struct mbuf *mb, *mreq;
- struct vnode *dirp = (struct vnode *)0;
+ struct vnode *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
@@ -1996,7 +1996,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
procp);
else {
vrele(dirp);
- dirp = (struct vnode *)0;
+ dirp = NULL;
}
}
if (error)
@@ -2016,7 +2016,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
io.uio_iovcnt = 1;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
- io.uio_procp = (struct proc *)0;
+ io.uio_procp = NULL;
nfsm_mtouio(&io, len2);
if (!v3) {
nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -2118,7 +2118,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
struct mbuf *mb, *mreq;
- struct vnode *vp, *dirp = (struct vnode *)0;
+ struct vnode *vp, *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
@@ -2135,7 +2135,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
procp);
else {
vrele(dirp);
- dirp = (struct vnode *)0;
+ dirp = NULL;
}
}
if (error) {
@@ -2229,7 +2229,7 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
struct mbuf *mb, *mreq;
- struct vnode *vp, *dirp = (struct vnode *)0;
+ struct vnode *vp, *dirp = NULL;
struct vattr dirfor, diraft;
nfsfh_t nfh;
fhandle_t *fhp;
@@ -2248,7 +2248,7 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
procp);
else {
vrele(dirp);
- dirp = (struct vnode *)0;
+ dirp = NULL;
}
}
if (error) {
@@ -2415,7 +2415,7 @@ again:
io.uio_resid = fullsiz;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
- io.uio_procp = (struct proc *)0;
+ io.uio_procp = NULL;
eofflag = 0;
if (cookies) {
@@ -2628,7 +2628,7 @@ again:
io.uio_resid = fullsiz;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
- io.uio_procp = (struct proc *)0;
+ io.uio_procp = NULL;
eofflag = 0;
if (cookies) {
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 06f7850d066..6d151c0479d 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.89 2009/07/20 11:47:58 blambert Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.90 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -234,7 +234,7 @@ nfs_connect(nmp, rep)
struct sockaddr_in *sin;
struct mbuf *m;
- nmp->nm_so = (struct socket *)0;
+ nmp->nm_so = NULL;
saddr = mtod(nmp->nm_nam, struct sockaddr *);
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
nmp->nm_soproto);
@@ -424,7 +424,7 @@ nfs_disconnect(nmp)
if (nmp->nm_so) {
so = nmp->nm_so;
- nmp->nm_so = (struct socket *)0;
+ nmp->nm_so = NULL;
soshutdown(so, SHUT_RDWR);
soclose(so);
}
@@ -468,7 +468,7 @@ nfs_send(so, nam, top, rep)
} else
soflags = so->so_proto->pr_flags;
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
- sendnam = (struct mbuf *)0;
+ sendnam = NULL;
else
sendnam = nam;
if (so->so_type == SOCK_SEQPACKET)
@@ -476,8 +476,7 @@ nfs_send(so, nam, top, rep)
else
flags = 0;
- error = sosend(so, sendnam, (struct uio *)0, top,
- (struct mbuf *)0, flags);
+ error = sosend(so, sendnam, NULL, top, NULL, flags);
if (error) {
if (rep) {
/*
@@ -528,8 +527,8 @@ nfs_receive(rep, aname, mp)
/*
* Set up arguments for soreceive()
*/
- *mp = (struct mbuf *)0;
- *aname = (struct mbuf *)0;
+ *mp = NULL;
+ *aname = NULL;
sotype = rep->r_nmp->nm_sotype;
/*
@@ -595,9 +594,8 @@ tryagain:
auio.uio_procp = p;
do {
rcvflg = MSG_WAITALL;
- error = soreceive(so, (struct mbuf **)0, &auio,
- (struct mbuf **)0, (struct mbuf **)0, &rcvflg,
- 0);
+ error = soreceive(so, NULL, &auio, NULL, NULL,
+ &rcvflg, 0);
if (error == EWOULDBLOCK && rep) {
if (rep->r_flags & R_SOFTTERM)
return (EINTR);
@@ -640,8 +638,8 @@ tryagain:
auio.uio_resid = len;
do {
rcvflg = MSG_WAITALL;
- error = soreceive(so, (struct mbuf **)0,
- &auio, mp, (struct mbuf **)0, &rcvflg, 0);
+ error = soreceive(so, NULL, &auio, mp, NULL,
+ &rcvflg, 0);
} while (error == EWOULDBLOCK || error == EINTR ||
error == ERESTART);
if (!error && auio.uio_resid > 0) {
@@ -664,8 +662,8 @@ tryagain:
auio.uio_procp = p;
do {
rcvflg = 0;
- error = soreceive(so, (struct mbuf **)0,
- &auio, mp, &control, &rcvflg, 0);
+ error = soreceive(so, NULL, &auio, mp, &control,
+ &rcvflg, 0);
if (control)
m_freem(control);
if (error == EWOULDBLOCK && rep) {
@@ -683,7 +681,7 @@ tryagain:
errout:
if (error && error != EINTR && error != ERESTART) {
m_freem(*mp);
- *mp = (struct mbuf *)0;
+ *mp = NULL;
if (error != EPIPE)
log(LOG_INFO,
"receive error %d from nfs server %s\n",
@@ -701,15 +699,15 @@ errout:
if ((so = rep->r_nmp->nm_so) == NULL)
return (EACCES);
if (so->so_state & SS_ISCONNECTED)
- getnam = (struct mbuf **)0;
+ getnam = NULL;
else
getnam = aname;
auio.uio_resid = len = 1000000;
auio.uio_procp = p;
do {
rcvflg = 0;
- error = soreceive(so, getnam, &auio, mp,
- (struct mbuf **)0, &rcvflg, 0);
+ error = soreceive(so, getnam, &auio, mp, NULL,
+ &rcvflg, 0);
if (error == EWOULDBLOCK &&
(rep->r_flags & R_SOFTTERM))
return (EINTR);
@@ -718,7 +716,7 @@ errout:
}
if (error) {
m_freem(*mp);
- *mp = (struct mbuf *)0;
+ *mp = NULL;
}
/*
* Search for any mbufs that are not a multiple of 4 bytes long
@@ -1226,10 +1224,10 @@ nfs_timer(arg)
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
- (struct mbuf *)0, (struct mbuf *)0, curproc);
+ NULL, NULL, curproc);
else
error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
- nmp->nm_nam, (struct mbuf *)0, curproc);
+ nmp->nm_nam, NULL, curproc);
if (error) {
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
so->so_error = 0;
@@ -1313,7 +1311,7 @@ nfs_sndlock(flagp, rep)
if (rep->r_nmp->nm_flag & NFSMNT_INT)
slpflag = PCATCH;
} else
- p = (struct proc *)0;
+ p = NULL;
while (*flagp & NFSMNT_SNDLOCK) {
if (rep && nfs_sigintr(rep->r_nmp, rep, p))
return (EINTR);
@@ -1663,9 +1661,9 @@ nfsrv_rcv(so, arg, waitflag)
*/
auio.uio_resid = 1000000000;
flags = MSG_DONTWAIT;
- error = soreceive(so, &nam, &auio, &mp, (struct mbuf **)0,
+ error = soreceive(so, &nam, &auio, &mp, NULL,
&flags, 0);
- if (error || mp == (struct mbuf *)0) {
+ if (error || mp == NULL) {
if (error == EWOULDBLOCK)
slp->ns_flag |= SLP_NEEDQ;
else
@@ -1699,7 +1697,7 @@ nfsrv_rcv(so, arg, waitflag)
auio.uio_resid = 1000000000;
flags = MSG_DONTWAIT;
error = soreceive(so, &nam, &auio, &mp,
- (struct mbuf **)0, &flags, 0);
+ NULL, &flags, 0);
if (mp) {
if (nam) {
m = nam;
@@ -1711,7 +1709,7 @@ nfsrv_rcv(so, arg, waitflag)
else
slp->ns_rec = m;
slp->ns_recend = m;
- m->m_nextpkt = (struct mbuf *)0;
+ m->m_nextpkt = NULL;
}
if (error) {
if ((so->so_proto->pr_flags & PR_CONNREQUIRED)
@@ -1794,12 +1792,12 @@ nfsrv_getstream(slp, waitflag)
recm = NULL;
if (slp->ns_cc == slp->ns_reclen) {
recm = slp->ns_raw;
- slp->ns_raw = slp->ns_rawend = (struct mbuf *)0;
+ slp->ns_raw = slp->ns_rawend = NULL;
slp->ns_cc = slp->ns_reclen = 0;
} else if (slp->ns_cc > slp->ns_reclen) {
len = 0;
m = slp->ns_raw;
- om = (struct mbuf *)0;
+ om = NULL;
while (len < slp->ns_reclen) {
if ((len + m->m_len) > slp->ns_reclen) {
m2 = m_copym(m, 0, slp->ns_reclen - len,
@@ -1822,7 +1820,7 @@ nfsrv_getstream(slp, waitflag)
len += m->m_len;
m = m->m_next;
recm = slp->ns_raw;
- om->m_next = (struct mbuf *)0;
+ om->m_next = NULL;
} else {
om = m;
len += m->m_len;
@@ -1850,7 +1848,7 @@ nfsrv_getstream(slp, waitflag)
else
slp->ns_rec = slp->ns_frag;
slp->ns_recend = slp->ns_frag;
- slp->ns_frag = (struct mbuf *)0;
+ slp->ns_frag = NULL;
}
}
}
@@ -1870,13 +1868,13 @@ nfsrv_dorec(slp, nfsd, ndp)
*ndp = NULL;
if ((slp->ns_flag & SLP_VALID) == 0 ||
- (m = slp->ns_rec) == (struct mbuf *)0)
+ (m = slp->ns_rec) == NULL)
return (ENOBUFS);
slp->ns_rec = m->m_nextpkt;
if (slp->ns_rec)
- m->m_nextpkt = (struct mbuf *)0;
+ m->m_nextpkt = NULL;
else
- slp->ns_recend = (struct mbuf *)0;
+ slp->ns_recend = NULL;
if (m->m_type == MT_SONAME) {
nam = m;
m = m->m_next;
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 81f338d56a7..1705640ae68 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.97 2009/07/09 22:29:56 thib Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.98 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -1231,7 +1231,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p)
int error, rdonly;
struct componentname *cnp = &ndp->ni_cnd;
- *retdirp = (struct vnode *)0;
+ *retdirp = NULL;
cnp->cn_pnbuf = pool_get(&namei_pool, PR_WAITOK);
/*
* Copy the name from the mbuf list to ndp->ni_pnbuf
@@ -1348,7 +1348,7 @@ nfsm_adj(mp, len, nul)
m = mp;
for (;;) {
count += m->m_len;
- if (m->m_next == (struct mbuf *)0)
+ if (m->m_next == NULL)
break;
m = m->m_next;
}
@@ -1506,7 +1506,7 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp)
int error, exflags;
struct sockaddr_in *saddr;
- *vpp = (struct vnode *)0;
+ *vpp = NULL;
mp = vfs_getvfs(&fhp->fh_fsid);
if (!mp)
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 87edf869da9..966c0ce2af1 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.83 2009/07/20 11:47:58 blambert Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.84 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -228,7 +228,7 @@ nfssvc_addsock(fp, mynam)
int error, s;
so = (struct socket *)fp->f_data;
- tslp = (struct nfssvc_sock *)0;
+ tslp = NULL;
/*
* Add it to the list, as required.
*/
@@ -332,7 +332,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
else if (slp->ns_flag & SLP_NEEDQ) {
slp->ns_flag &= ~SLP_NEEDQ;
(void) nfs_sndlock(&slp->ns_solock,
- (struct nfsreq *)0);
+ NULL);
nfsrv_rcv(slp->ns_so, (caddr_t)slp,
M_WAIT);
nfs_sndunlock(&slp->ns_solock);
@@ -358,7 +358,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
pool_put(&nfsrv_descript_pl, nd);
nd = NULL;
}
- nfsd->nfsd_slp = (struct nfssvc_sock *)0;
+ nfsd->nfsd_slp = NULL;
nfsd->nfsd_flag &= ~NFSD_REQINPROG;
nfsrv_slpderef(slp);
continue;
@@ -369,7 +369,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
if (so->so_proto->pr_flags & PR_CONNREQUIRED)
solockp = &slp->ns_solock;
else
- solockp = (int *)0;
+ solockp = NULL;
if (nd) {
if (nd->nd_nam2)
nd->nd_nam = nd->nd_nam2;
@@ -410,7 +410,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
}
nfsstats.srvrpccnt[nd->nd_procnum]++;
nfsrv_updatecache(nd, 1, mreq);
- nd->nd_mrep = (struct mbuf *)0;
+ nd->nd_mrep = NULL;
/* FALLTHROUGH */
case RC_REPLY:
@@ -426,7 +426,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
}
m = mreq;
m->m_pkthdr.len = siz;
- m->m_pkthdr.rcvif = (struct ifnet *)0;
+ m->m_pkthdr.rcvif = NULL;
/*
* For stream protocols, prepend a Sun RPC
* Record Mark.
@@ -436,7 +436,7 @@ nfssvc_nfsd(struct nfsd *nfsd)
*mtod(m, u_int32_t *) = htonl(0x80000000 | siz);
}
if (solockp)
- (void) nfs_sndlock(solockp, (struct nfsreq *)0);
+ (void) nfs_sndlock(solockp, NULL);
if (slp->ns_flag & SLP_VALID)
error = nfs_send(so, nd->nd_nam2, m, NULL);
else {
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 3e798842449..cb376b5781b 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.84 2009/07/13 15:39:55 thib Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.85 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -541,7 +541,7 @@ nfs_decode_args(nmp, argp, nargp)
if (nmp->nm_so && adjsock) {
nfs_disconnect(nmp);
if (nmp->nm_sotype == SOCK_DGRAM)
- while (nfs_connect(nmp, (struct nfsreq *)0)) {
+ while (nfs_connect(nmp, NULL)) {
printf("nfs_args: retrying connect\n");
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nfscon", 0);
@@ -703,7 +703,7 @@ mountnfs(argp, mp, nam, pth, hst)
* the first request, in case the server is not responding.
*/
if (nmp->nm_sotype == SOCK_DGRAM &&
- (error = nfs_connect(nmp, (struct nfsreq *)0)))
+ (error = nfs_connect(nmp, NULL)))
goto bad;
/*
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 56e8641cf5d..70101e5176e 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.118 2009/07/18 14:40:31 thib Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.119 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -815,7 +815,7 @@ dorpc:
nfsm_postop_attr(newvp, attrflag);
nfsm_postop_attr(dvp, attrflag);
} else
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
*vpp = newvp;
m_freem(mrep);
cnp->cn_flags |= SAVENAME;
@@ -839,7 +839,7 @@ dorpc:
nfsm_postop_attr(newvp, attrflag);
nfsm_postop_attr(dvp, attrflag);
} else
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
} else if (flags & ISDOTDOT) {
VOP_UNLOCK(dvp, 0, p);
cnp->cn_flags |= PDIRUNLOCK;
@@ -857,7 +857,7 @@ dorpc:
nfsm_postop_attr(newvp, attrflag);
nfsm_postop_attr(dvp, attrflag);
} else
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
if (lockparent && (flags & ISLASTCN)) {
if ((error = vn_lock(dvp, LK_EXCLUSIVE, p))) {
@@ -879,7 +879,7 @@ dorpc:
nfsm_postop_attr(newvp, attrflag);
nfsm_postop_attr(dvp, attrflag);
} else
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
if (!lockparent || !(flags & ISLASTCN)) {
VOP_UNLOCK(dvp, 0, p);
cnp->cn_flags |= PDIRUNLOCK;
@@ -1196,7 +1196,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
struct nfsv2_sattr *sp;
u_int32_t *tl;
int32_t t1;
- struct vnode *newvp = (struct vnode *)0;
+ struct vnode *newvp = NULL;
struct nfsnode *np = NULL;
char *cp2;
caddr_t dpos;
@@ -1246,7 +1246,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
if (!gotvp) {
if (newvp) {
vrele(newvp);
- newvp = (struct vnode *)0;
+ newvp = NULL;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
cnp->cn_namelen, cnp->cn_cred, cnp->cn_proc, &np);
@@ -1306,8 +1306,8 @@ nfs_create(v)
struct nfsv2_sattr *sp;
u_int32_t *tl;
int32_t t1;
- struct nfsnode *np = (struct nfsnode *)0;
- struct vnode *newvp = (struct vnode *)0;
+ struct nfsnode *np = NULL;
+ struct vnode *newvp = NULL;
caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -1356,7 +1356,7 @@ again:
if (!gotvp) {
if (newvp) {
vrele(newvp);
- newvp = (struct vnode *)0;
+ newvp = NULL;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
cnp->cn_namelen, cnp->cn_cred, cnp->cn_proc, &np);
@@ -1472,7 +1472,7 @@ nfs_removeit(sp)
{
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred,
- (struct proc *)0));
+ NULL));
}
/*
@@ -1715,7 +1715,7 @@ nfs_symlink(v)
caddr_t dpos, cp2;
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
struct mbuf *mreq, *mrep, *md, *mb;
- struct vnode *newvp = (struct vnode *)0;
+ struct vnode *newvp = NULL;
int v3 = NFS_ISV3(dvp);
nfsstats.rpccnt[NFSPROC_SYMLINK]++;
@@ -1771,8 +1771,8 @@ nfs_mkdir(v)
u_int32_t *tl;
int32_t t1;
int len;
- struct nfsnode *np = (struct nfsnode *)0;
- struct vnode *newvp = (struct vnode *)0;
+ struct nfsnode *np = NULL;
+ struct vnode *newvp = NULL;
caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
int gotvp = 0;
@@ -2409,7 +2409,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
dpos = dpossav1;
mdsav2 = md;
md = mdsav1;
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
dpos = dpossav2;
md = mdsav2;
dp->d_type =
@@ -2517,7 +2517,7 @@ nfs_sillyrename(dvp, vp, cnp)
/* Try lookitups until we get one that isn't there */
while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
- cnp->cn_proc, (struct nfsnode **)0) == 0) {
+ cnp->cn_proc, NULL) == 0) {
sp->s_name[4]++;
if (sp->s_name[4] > 'z') {
error = EINVAL;
@@ -2557,7 +2557,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
{
u_int32_t *tl;
int32_t t1;
- struct vnode *newvp = (struct vnode *)0;
+ struct vnode *newvp = NULL;
struct nfsnode *np, *dnp = VTONFS(dvp);
caddr_t dpos, cp2;
int error = 0, fhlen, attrflag;
@@ -2606,7 +2606,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
return (ENOENT);
}
} else
- nfsm_loadattr(newvp, (struct vattr *)0);
+ nfsm_loadattr(newvp, NULL);
}
m_freem(mrep);
nfsmout:
@@ -2847,7 +2847,7 @@ loop:
"nfsfsync", slptimeo);
splx(s);
if (error) {
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p))
+ if (nfs_sigintr(nmp, NULL, p))
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
@@ -2882,7 +2882,7 @@ loop:
error = vwaitforio(vp, slpflag, "nfs_fsync", slptimeo);
splx(s);
if (error) {
- if (nfs_sigintr(nmp, (struct nfsreq *)0, p))
+ if (nfs_sigintr(nmp, NULL, p))
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 60a12c5536d..44dfe2e0ec2 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsm_subs.h,v 1.38 2009/06/06 00:33:51 thib Exp $ */
+/* $OpenBSD: nfsm_subs.h,v 1.39 2009/07/20 16:49:40 thib Exp $ */
/* $NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $ */
/*
@@ -114,7 +114,7 @@
nfsm_adv(NFSX_V3FATTR); \
} \
if (f) \
- nfsm_loadattr((v), (struct vattr *)0); \
+ nfsm_loadattr((v), NULL); \
}
#define nfsm_getfh(f, s, v3) { \
@@ -146,7 +146,7 @@
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) { \
+ NULL)) != 0) { \
error = t1; \
(f) = 0; \
m_freem(mrep); \