Convert old style (type foo *)0 casts to NULLs

PR:		kern/40360
Requested by:	Hiten PAndya via direct email
This commit is contained in:
Matthew Dillon 2002-07-11 17:54:58 +00:00
parent ffcaf36b2c
commit 3d8f797ac1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99797
12 changed files with 113 additions and 118 deletions

View File

@ -125,11 +125,11 @@ struct mntopt mopts[] = {
struct nfs_args nfsdefargs = {
NFS_ARGSVERSION,
(struct sockaddr *)0,
NULL,
sizeof (struct sockaddr_in),
SOCK_DGRAM,
0,
(u_char *)0,
NULL,
0,
NFSMNT_RESVPORT,
NFS_WSIZE,
@ -141,7 +141,7 @@ struct nfs_args nfsdefargs = {
NFS_DEFRAHEAD,
0, /* was: NQ_DEFLEASE */
NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */
(char *)0,
NULL,
/* args version 4 */
NFS_MINATTRTIMO,
NFS_MAXATTRTIMO,

View File

@ -1025,9 +1025,9 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
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, td))
return ((struct buf *)0);
while (bp == NULL) {
if (nfs_sigintr(nmp, NULL, td))
return (NULL);
bp = getblk(vp, bn, size, 0, 2 * hz);
}
} else {
@ -1076,7 +1076,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
error = tsleep((caddr_t)&np->n_flag, PRIBIO + 2, "nfsvinval",
slptimeo);
if (error && intrflg &&
nfs_sigintr(nmp, (struct nfsreq *)0, td))
nfs_sigintr(nmp, NULL, td))
return (EINTR);
}
@ -1087,7 +1087,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
error = vinvalbuf(vp, flags, cred, td, slpflag, 0);
while (error) {
if (intrflg &&
nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
nfs_sigintr(nmp, NULL, td)) {
np->n_flag &= ~NFLUSHINPROG;
if (np->n_flag & NFLUSHWANT) {
np->n_flag &= ~NFLUSHWANT;
@ -1165,7 +1165,7 @@ nfs_asyncio(struct buf *bp, struct ucred *cred, struct thread *td)
*/
NFS_DPF(ASYNCIO, ("nfs_asyncio: waking iod %d for mount %p\n",
iod, nmp));
nfs_iodwant[iod] = (struct proc *)0;
nfs_iodwant[iod] = NULL;
nfs_iodmount[iod] = nmp;
nmp->nm_bufqiods++;
wakeup((caddr_t)&nfs_iodwant[iod]);

View File

@ -258,9 +258,9 @@ nfssvc_iod(void *instance)
wakeup(&nmp->nm_bufq);
}
if (bp->b_iocmd == BIO_READ)
(void) nfs_doio(bp, bp->b_rcred, (struct thread *)0);
(void) nfs_doio(bp, bp->b_rcred, NULL);
else
(void) nfs_doio(bp, bp->b_wcred, (struct thread *)0);
(void) nfs_doio(bp, bp->b_wcred, NULL);
/*
* If there are more than one iod on this mount, then defect
* so that the iods can be shared out fairly between the mounts

View File

@ -285,9 +285,9 @@ nfs_inactive(struct vop_inactive_args *ap)
vprint("nfs_inactive: pushing active", ap->a_vp);
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) {
/*
* We need a reference to keep the vnode from being
@ -354,6 +354,6 @@ nfs_reclaim(struct vop_reclaim_args *ap)
cache_purge(vp);
uma_zfree(nfsnode_zone, vp->v_data);
vp->v_data = (void *)0;
vp->v_data = NULL;
return (0);
}

View File

@ -160,7 +160,7 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
struct sockaddr_in *sin;
struct thread *td = &thread0; /* only used for socreate and sobind */
nmp->nm_so = (struct socket *)0;
nmp->nm_so = NULL;
saddr = nmp->nm_nam;
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
nmp->nm_soproto, nmp->nm_cred, td);
@ -367,7 +367,7 @@ nfs_disconnect(struct nfsmount *nmp)
if (nmp->nm_so) {
so = nmp->nm_so;
nmp->nm_so = (struct socket *)0;
nmp->nm_so = NULL;
soshutdown(so, 2);
soclose(so);
}
@ -414,7 +414,7 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top,
soflags = rep->r_nmp->nm_soflags;
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
sendnam = (struct sockaddr *)0;
sendnam = NULL;
else
sendnam = nam;
if (so->so_type == SOCK_SEQPACKET)
@ -475,8 +475,8 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
/*
* Set up arguments for soreceive()
*/
*mp = (struct mbuf *)0;
*aname = (struct sockaddr *)0;
*mp = NULL;
*aname = NULL;
sotype = rep->r_nmp->nm_sotype;
/*
@ -541,9 +541,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
do {
rcvflg = MSG_WAITALL;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, (struct sockaddr **)0, &auio,
(struct mbuf **)0, (struct mbuf **)0,
&rcvflg);
(so, NULL, &auio, NULL, NULL, &rcvflg);
if (error == EWOULDBLOCK && rep) {
if (rep->r_flags & R_SOFTTERM)
return (EINTR);
@ -583,8 +581,8 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
do {
rcvflg = MSG_WAITALL;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, (struct sockaddr **)0,
&auio, mp, (struct mbuf **)0, &rcvflg);
(so, NULL,
&auio, mp, NULL, &rcvflg);
} while (error == EWOULDBLOCK || error == EINTR ||
error == ERESTART);
if (!error && auio.uio_resid > 0) {
@ -609,7 +607,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
do {
rcvflg = 0;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, (struct sockaddr **)0,
(so, NULL,
&auio, mp, &control, &rcvflg);
if (control)
m_freem(control);
@ -628,7 +626,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
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",
@ -646,7 +644,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
if ((so = rep->r_nmp->nm_so) == NULL)
return (EACCES);
if (so->so_state & SS_ISCONNECTED)
getnam = (struct sockaddr **)0;
getnam = NULL;
else
getnam = aname;
auio.uio_resid = len = 1000000;
@ -655,7 +653,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
rcvflg = 0;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, getnam, &auio, mp,
(struct mbuf **)0, &rcvflg);
NULL, &rcvflg);
if (error == EWOULDBLOCK &&
(rep->r_flags & R_SOFTTERM))
return (EINTR);
@ -664,7 +662,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
}
if (error) {
m_freem(*mp);
*mp = (struct mbuf *)0;
*mp = NULL;
}
/*
* Search for any mbufs that are not a multiple of 4 bytes long
@ -1130,12 +1128,10 @@ nfs_timer(void *arg)
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, (struct sockaddr *)0,
(struct mbuf *)0, td);
(so, 0, m, NULL, NULL, td);
else
error = (*so->so_proto->pr_usrreqs->pru_send)
(so, 0, m, nmp->nm_nam, (struct mbuf *)0,
td);
(so, 0, m, nmp->nm_nam, NULL, td);
if (error) {
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
so->so_error = 0;
@ -1162,7 +1158,7 @@ nfs_timer(void *arg)
}
}
splx(s);
nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
nfs_timer_handle = timeout(nfs_timer, NULL, nfs_ticks);
}
/*
@ -1265,7 +1261,7 @@ nfs_sndlock(struct nfsreq *rep)
if (rep->r_nmp->nm_flag & NFSMNT_INT)
slpflag = PCATCH;
} else
td = (struct thread *)0;
td = NULL;
while (*statep & NFSSTA_SNDLOCK) {
if (nfs_sigintr(rep->r_nmp, rep, td))
return (EINTR);

View File

@ -233,7 +233,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
*tl = 0;
mb->m_next = mrest;
mreq->m_pkthdr.len = authsiz + 10 * NFSX_UNSIGNED + mrest_len;
mreq->m_pkthdr.rcvif = (struct ifnet *)0;
mreq->m_pkthdr.rcvif = NULL;
*mbp = mb;
return (mreq);
}
@ -406,8 +406,8 @@ nfs_init(struct vfsconf *vfsp)
nfs_ticks = 1;
/* Ensure async daemons disabled */
for (i = 0; i < NFS_MAXASYNCDAEMON; i++) {
nfs_iodwant[i] = (struct proc *)0;
nfs_iodmount[i] = (struct nfsmount *)0;
nfs_iodwant[i] = NULL;
nfs_iodmount[i] = NULL;
}
nfs_nhinit(); /* Init the nfsnode table */
@ -719,14 +719,14 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
dp->ndm_eocookie = 0;
LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
} else
return ((nfsuint64 *)0);
return (NULL);
}
while (pos >= NFSNUMCOOKIES) {
pos -= NFSNUMCOOKIES;
if (LIST_NEXT(dp, ndm_list)) {
if (!add && dp->ndm_eocookie < NFSNUMCOOKIES &&
pos >= dp->ndm_eocookie)
return ((nfsuint64 *)0);
return (NULL);
dp = LIST_NEXT(dp, ndm_list);
} else if (add) {
MALLOC(dp2, struct nfsdmap *, sizeof (struct nfsdmap),
@ -735,13 +735,13 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
LIST_INSERT_AFTER(dp, dp2, ndm_list);
dp = dp2;
} else
return ((nfsuint64 *)0);
return (NULL);
}
if (pos >= dp->ndm_eocookie) {
if (add)
dp->ndm_eocookie = pos + 1;
else
return ((nfsuint64 *)0);
return (NULL);
}
return (&dp->ndm_cookies[pos]);
}
@ -848,7 +848,7 @@ nfsm_mtofh_xx(struct vnode *d, struct vnode **v, int v3, int *f,
}
if (*f) {
ttvp = *v;
t1 = nfs_loadattrcache(&ttvp, md, dpos, (struct vattr *)0, 0);
t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 0);
if (t1)
return t1;
*v = ttvp;
@ -905,7 +905,7 @@ nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md,
return EBADRPC;
*f = fxdr_unsigned(int, *tl);
if (*f != 0) {
t1 = nfs_loadattrcache(&ttvp, md, dpos, (struct vattr *)0, 1);
t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 1);
if (t1 != 0) {
*f = 0;
return t1;

View File

@ -246,7 +246,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
u_quad_t tquad;
#ifndef nolint
sfp = (struct nfs_statfs *)0;
sfp = NULL;
#endif
error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np);
if (error)
@ -452,7 +452,7 @@ nfs_mountroot(struct mount *mp, struct thread *td)
error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
(struct sockaddr *)&nd->mygateway,
(struct sockaddr *)&mask,
RTF_UP | RTF_GATEWAY, (struct rtentry **)0);
RTF_UP | RTF_GATEWAY, NULL);
if (error)
panic("nfs_mountroot: RTM_ADD: %d", error);
}
@ -697,7 +697,7 @@ nfs_decode_args(struct nfsmount *nmp, struct nfs_args *argp)
if (nmp->nm_so && adjsock) {
nfs_safedisconnect(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);
@ -850,7 +850,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
* 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;
/*

View File

@ -727,7 +727,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
if (v3) {
nfsm_wcc_data(vp, wccflag);
} else
nfsm_loadattr(vp, (struct vattr *)0);
nfsm_loadattr(vp, NULL);
m_freem(mrep);
nfsmout:
return (error);
@ -865,7 +865,7 @@ nfs_lookup(struct vop_lookup_args *ap)
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;
@ -912,7 +912,7 @@ nfs_lookup(struct vop_lookup_args *ap)
nfsm_postop_attr(newvp, attrflag);
nfsm_postop_attr(dvp, attrflag);
} else
nfsm_loadattr(newvp, (struct vattr *)0);
nfsm_loadattr(newvp, NULL);
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
cnp->cn_flags |= SAVENAME;
if ((cnp->cn_flags & MAKEENTRY) &&
@ -1053,7 +1053,7 @@ nfs_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
tl = nfsm_dissect(u_int32_t *, 2 * NFSX_UNSIGNED);
eof = fxdr_unsigned(int, *(tl + 1));
} else
nfsm_loadattr(vp, (struct vattr *)0);
nfsm_loadattr(vp, NULL);
nfsm_strsiz(retlen, nmp->nm_rsize);
nfsm_mtouio(uiop, retlen);
m_freem(mrep);
@ -1164,7 +1164,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
}
}
} else
nfsm_loadattr(vp, (struct vattr *)0);
nfsm_loadattr(vp, NULL);
if (wccflag)
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
m_freem(mrep);
@ -1192,8 +1192,8 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
{
struct nfsv2_sattr *sp;
u_int32_t *tl;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = NULL;
struct nfsnode *np = NULL;
struct vattr vattr;
caddr_t bpos, dpos;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0;
@ -1242,7 +1242,7 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
if (!gotvp) {
if (newvp) {
vput(newvp);
newvp = (struct vnode *)0;
newvp = NULL;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
@ -1292,8 +1292,8 @@ nfs_create(struct vop_create_args *ap)
struct componentname *cnp = ap->a_cnp;
struct nfsv2_sattr *sp;
u_int32_t *tl;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np = NULL;
struct vnode *newvp = NULL;
caddr_t bpos, dpos;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0;
struct mbuf *mreq, *mrep, *md, *mb;
@ -1350,7 +1350,7 @@ nfs_create(struct vop_create_args *ap)
if (!gotvp) {
if (newvp) {
vput(newvp);
newvp = (struct vnode *)0;
newvp = NULL;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr,
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
@ -1466,7 +1466,7 @@ nfs_removeit(struct sillyrename *sp)
{
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred,
(struct thread *)0));
NULL));
}
/*
@ -1694,7 +1694,7 @@ nfs_symlink(struct vop_symlink_args *ap)
caddr_t bpos, dpos;
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]++;
@ -1784,8 +1784,8 @@ nfs_mkdir(struct vop_mkdir_args *ap)
struct componentname *cnp = ap->a_cnp;
struct nfsv2_sattr *sp;
int len;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np = NULL;
struct vnode *newvp = NULL;
caddr_t bpos, dpos;
int error = 0, wccflag = NFSV3_WCCRATTR;
int gotvp = 0;
@ -1832,7 +1832,7 @@ nfs_mkdir(struct vop_mkdir_args *ap)
if (error == EEXIST || (!error && !gotvp)) {
if (newvp) {
vrele(newvp);
newvp = (struct vnode *)0;
newvp = NULL;
}
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
cnp->cn_thread, &np);
@ -2138,7 +2138,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
int attrflag, fhsize;
#ifndef nolint
dp = (struct dirent *)0;
dp = NULL;
#endif
#ifndef DIAGNOSTIC
if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
@ -2274,7 +2274,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 =
@ -2377,7 +2377,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *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_thread, (struct nfsnode **)0) == 0) {
cnp->cn_thread, NULL) == 0) {
sp->s_name[4]++;
if (sp->s_name[4] > 'z') {
error = EINVAL;
@ -2410,7 +2410,7 @@ static int
nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
struct thread *td, struct nfsnode **npp)
{
struct vnode *newvp = (struct vnode *)0;
struct vnode *newvp = NULL;
struct nfsnode *np, *dnp = VTONFS(dvp);
caddr_t bpos, dpos;
int error = 0, fhlen, attrflag;
@ -2460,7 +2460,7 @@ nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
return (ENOENT);
}
} else
nfsm_loadattr(newvp, (struct vattr *)0);
nfsm_loadattr(newvp, NULL);
}
m_freem(mrep);
nfsmout:
@ -2539,7 +2539,7 @@ nfs_strategy(struct vop_strategy_args *ap)
panic("nfs physio");
if (bp->b_flags & B_ASYNC)
td = (struct thread *)0;
td = NULL;
else
td = curthread; /* XXX */
@ -2776,7 +2776,7 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct thread *td,
panic("nfs_fsync: inconsistent lock");
if (error == ENOLCK)
goto loop;
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
if (nfs_sigintr(nmp, NULL, td)) {
error = EINTR;
goto done;
}
@ -2812,7 +2812,7 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct thread *td,
error = tsleep((caddr_t)&vp->v_numoutput,
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo);
if (error) {
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
if (nfs_sigintr(nmp, NULL, td)) {
error = EINTR;
goto done;
}

View File

@ -192,7 +192,7 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, TRUE);
if (error) {
nfsm_reply(NFSX_UNSIGNED);
nfsm_srvpostop_attr(1, (struct vattr *)0);
nfsm_srvpostop_attr(1, NULL);
error = 0;
goto nfsmout;
}
@ -648,7 +648,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
#ifndef nolint
mp = (struct mbuf *)0;
mp = NULL;
#endif
mp3 = NULL;
fhp = &nfh.fh_generic;
@ -681,12 +681,12 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
uiop->uio_resid = len;
uiop->uio_rw = UIO_READ;
uiop->uio_segflg = UIO_SYSSPACE;
uiop->uio_td = (struct thread *)0;
uiop->uio_td = NULL;
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, TRUE);
if (error) {
nfsm_reply(2 * NFSX_UNSIGNED);
if (v3)
nfsm_srvpostop_attr(1, (struct vattr *)0);
nfsm_srvpostop_attr(1, NULL);
error = 0;
goto nfsmout;
}
@ -780,7 +780,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
vp = NULL;
nfsm_reply(2 * NFSX_UNSIGNED);
if (v3)
nfsm_srvpostop_attr(1, (struct vattr *)0);
nfsm_srvpostop_attr(1, NULL);
error = 0;
goto nfsmout;
}
@ -1136,7 +1136,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
uiop->uio_resid = len;
uiop->uio_rw = UIO_WRITE;
uiop->uio_segflg = UIO_SYSSPACE;
uiop->uio_td = (struct thread *)0;
uiop->uio_td = NULL;
uiop->uio_offset = off;
error = VOP_WRITE(vp, uiop, ioflags, cred);
nfsrvstats.srvvop_writes++;
@ -1391,7 +1391,7 @@ nfsrv_writegather(struct nfsrv_descript **ndp, struct nfssvc_sock *slp,
ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
uiop->uio_rw = UIO_WRITE;
uiop->uio_segflg = UIO_SYSSPACE;
uiop->uio_td = (struct thread *)0;
uiop->uio_td = NULL;
uiop->uio_offset = nfsd->nd_off;
uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off;
if (uiop->uio_resid > 0) {
@ -1588,7 +1588,7 @@ nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
caddr_t cp;
struct mbuf *mb, *mreq;
struct vnode *dirp = (struct vnode *)0;
struct vnode *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
u_quad_t tempsize;
@ -1869,7 +1869,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
u_int32_t major, minor;
enum vtype vtyp;
struct mbuf *mb, *mreq;
struct vnode *vp, *dirp = (struct vnode *)0;
struct vnode *vp, *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
struct mount *mp = NULL;
@ -2155,8 +2155,8 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
int v3 = (nfsd->nd_flag & ND_NFSV3);
struct mbuf *mb, *mreq;
struct nameidata fromnd, tond;
struct vnode *fvp, *tvp, *tdvp, *fdirp = (struct vnode *)0;
struct vnode *tdirp = (struct vnode *)0;
struct vnode *fvp, *tvp, *tdvp, *fdirp = NULL;
struct vnode *tdirp = NULL;
struct vattr fdirfor, fdiraft, tdirfor, tdiraft;
nfsfh_t fnfh, tnfh;
fhandle_t *ffhp, *tfhp;
@ -2166,7 +2166,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
#ifndef nolint
fvp = (struct vnode *)0;
fvp = NULL;
#endif
ffhp = &fnfh.fh_generic;
tfhp = &tnfh.fh_generic;
@ -2381,7 +2381,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
int error = 0, rdonly, len, dirfor_ret = 1, diraft_ret = 1;
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
struct mbuf *mb, *mreq;
struct vnode *vp = NULL, *xp, *dirp = (struct vnode *)0;
struct vnode *vp = NULL, *xp, *dirp = NULL;
struct vattr dirfor, diraft, at;
nfsfh_t nfh, dnfh;
fhandle_t *fhp, *dfhp;
@ -2501,13 +2501,13 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
struct nameidata nd;
struct vattr *vap = &va;
struct nfsv2_sattr *sp;
char *bpos, *pathcp = (char *)0;
char *bpos, *pathcp = NULL;
struct uio io;
struct iovec iv;
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;
struct mount *mp = NULL;
@ -2560,7 +2560,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
io.uio_iovcnt = 1;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
io.uio_td = (struct thread *)0;
io.uio_td = NULL;
nfsm_mtouio(&io, len2);
if (!v3) {
sp = nfsm_dissect(struct nfsv2_sattr *, NFSX_V2SATTR);
@ -2831,7 +2831,7 @@ nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
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;
@ -3070,7 +3070,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
io.uio_resid = fullsiz;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
io.uio_td = (struct thread *)0;
io.uio_td = NULL;
eofflag = 0;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (cookies) {
@ -3348,7 +3348,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
io.uio_resid = fullsiz;
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_READ;
io.uio_td = (struct thread *)0;
io.uio_td = NULL;
eofflag = 0;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (cookies) {

View File

@ -437,8 +437,8 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag)
auio.uio_resid = 1000000000;
flags = MSG_DONTWAIT;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, &nam, &auio, &mp, (struct mbuf **)0, &flags);
if (error || mp == (struct mbuf *)0) {
(so, &nam, &auio, &mp, NULL, &flags);
if (error || mp == NULL) {
if (error == EWOULDBLOCK)
slp->ns_flag |= SLP_NEEDQ;
else
@ -472,8 +472,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag)
auio.uio_resid = 1000000000;
flags = MSG_DONTWAIT;
error = so->so_proto->pr_usrreqs->pru_soreceive
(so, &nam, &auio, &mp,
(struct mbuf **)0, &flags);
(so, &nam, &auio, &mp, NULL, &flags);
if (mp) {
struct nfsrv_rec *rec;
rec = malloc(sizeof(struct nfsrv_rec),
@ -568,12 +567,12 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag)
*/
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,
@ -596,7 +595,7 @@ nfsrv_getstream(struct nfssvc_sock *slp, int 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;
@ -625,11 +624,11 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag)
m_freem(slp->ns_frag);
} else {
nfs_realign(&slp->ns_frag, 10 * NFSX_UNSIGNED);
rec->nr_address = (struct sockaddr *)0;
rec->nr_address = NULL;
rec->nr_packet = slp->ns_frag;
STAILQ_INSERT_TAIL(&slp->ns_rec, rec, nr_link);
}
slp->ns_frag = (struct mbuf *)0;
slp->ns_frag = NULL;
}
}
}
@ -715,7 +714,7 @@ nfsrv_send(struct socket *so, struct sockaddr *nam, struct mbuf *top)
soflags = so->so_proto->pr_flags;
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
sendnam = (struct sockaddr *)0;
sendnam = NULL;
else
sendnam = nam;
if (so->so_type == SOCK_SEQPACKET)
@ -763,5 +762,5 @@ nfsrv_timer(void *arg)
nfsrv_wakenfsd(slp);
}
splx(s);
nfsrv_timer_handle = timeout(nfsrv_timer, (void *)0, nfsrv_ticks);
nfsrv_timer_handle = timeout(nfsrv_timer, NULL, nfsrv_ticks);
}

View File

@ -604,7 +604,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len,
int error, rdonly, linklen;
struct componentname *cnp = &ndp->ni_cnd;
*retdirp = (struct vnode *)0;
*retdirp = NULL;
cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
/*
@ -789,7 +789,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len,
auio.uio_offset = 0;
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_td = (struct thread *)0;
auio.uio_td = NULL;
auio.uio_resid = MAXPATHLEN;
error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred);
if (error) {
@ -881,7 +881,7 @@ nfsm_adj(struct mbuf *mp, int len, int 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;
}
@ -1031,7 +1031,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp,
struct sockaddr_int *saddr;
#endif
*vpp = (struct vnode *)0;
*vpp = NULL;
if (nfs_ispublicfh(fhp)) {
if (!pubflag || !nfs_pub.np_valid)

View File

@ -150,7 +150,7 @@ nfssvc(struct thread *td, struct nfssvc_args *uap)
* Get the client address for connected sockets.
*/
if (nfsdarg.name == NULL || nfsdarg.namelen == 0)
nam = (struct sockaddr *)0;
nam = NULL;
else {
error = getsockaddr(&nam, nfsdarg.name,
nfsdarg.namelen);
@ -189,7 +189,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td)
so = (struct socket *)fp->f_data;
#if 0
tslp = (struct nfssvc_sock *)0;
tslp = NULL;
/*
* Add it to the list, as required.
*/
@ -288,7 +288,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
cacherep = RC_DOIT;
writes_todo = 0;
#endif
if (nfsd == (struct nfsd *)0) {
if (nfsd == NULL) {
nsd->nsd_nfsd = nfsd = (struct nfsd *)
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
s = splnet();
@ -303,7 +303,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
*/
for (;;) {
if ((nfsd->nfsd_flag & NFSD_REQINPROG) == 0) {
while (nfsd->nfsd_slp == (struct nfssvc_sock *)0 &&
while (nfsd->nfsd_slp == NULL &&
(nfsd_head_flag & NFSD_CHECKSLP) == 0) {
nfsd->nfsd_flag |= NFSD_WAITING;
nfsd_waiting++;
@ -313,7 +313,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
if (error)
goto done;
}
if (nfsd->nfsd_slp == (struct nfssvc_sock *)0 &&
if (nfsd->nfsd_slp == NULL &&
(nfsd_head_flag & NFSD_CHECKSLP) != 0) {
TAILQ_FOREACH(slp, &nfssvc_sockhead, ns_chain) {
if ((slp->ns_flag & (SLP_VALID | SLP_DOREC))
@ -327,7 +327,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
if (slp == 0)
nfsd_head_flag &= ~NFSD_CHECKSLP;
}
if ((slp = nfsd->nfsd_slp) == (struct nfssvc_sock *)0)
if ((slp = nfsd->nfsd_slp) == NULL)
continue;
if (slp->ns_flag & SLP_VALID) {
if (slp->ns_flag & SLP_DISCONN)
@ -359,7 +359,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
free((caddr_t)nd, M_NFSRVDESC);
nd = NULL;
}
nfsd->nfsd_slp = (struct nfssvc_sock *)0;
nfsd->nfsd_slp = NULL;
nfsd->nfsd_flag &= ~NFSD_REQINPROG;
nfsrv_slpderef(slp);
continue;
@ -427,7 +427,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
}
nfsrvstats.srvrpccnt[nd->nd_procnum]++;
nfsrv_updatecache(nd, TRUE, mreq);
nd->nd_mrep = (struct mbuf *)0;
nd->nd_mrep = NULL;
case RC_REPLY:
m = mreq;
siz = 0;
@ -441,7 +441,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
}
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.
@ -509,7 +509,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
splx(s);
free((caddr_t)nfsd, M_NFSD);
nsd->nsd_nfsd = (struct nfsd *)0;
nsd->nsd_nfsd = NULL;
if (--nfs_numnfsd == 0)
nfsrv_init(TRUE); /* Reinitialize everything */
return (error);
@ -534,13 +534,13 @@ nfsrv_zapsock(struct nfssvc_sock *slp)
slp->ns_flag &= ~SLP_ALLFLAGS;
fp = slp->ns_fp;
if (fp) {
slp->ns_fp = (struct file *)0;
slp->ns_fp = NULL;
so = slp->ns_so;
so->so_rcv.sb_flags &= ~SB_UPCALL;
so->so_upcall = NULL;
so->so_upcallarg = NULL;
soshutdown(so, 2);
closef(fp, (struct thread *)0);
closef(fp, NULL);
if (slp->ns_nam)
FREE(slp->ns_nam, M_SONAME);
m_freem(slp->ns_raw);