diff options
author | dillon <dillon@FreeBSD.org> | 2002-07-11 17:54:58 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-07-11 17:54:58 +0000 |
commit | 0b74a2da00ab0a50d30ae736a1eb9cb5c5c5eb11 (patch) | |
tree | 29f0ae4a3379cc4eeac2dc5eafc5eafbb5188b48 /sys/nfsserver | |
parent | 9180aabc4ca6e999cde1883d5f2fa501c953cd36 (diff) | |
download | FreeBSD-src-0b74a2da00ab0a50d30ae736a1eb9cb5c5c5eb11.zip FreeBSD-src-0b74a2da00ab0a50d30ae736a1eb9cb5c5c5eb11.tar.gz |
Convert old style (type foo *)0 casts to NULLs
PR: kern/40360
Requested by: Hiten PAndya via direct email
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 38 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 21 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 8 | ||||
-rw-r--r-- | sys/nfsserver/nfs_syscalls.c | 24 |
4 files changed, 45 insertions, 46 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 131c0b4..47f9c1f 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -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 @@ loop1: 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 @@ again: 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 @@ again: 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) { diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 7091c82..2143544 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -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); } diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 169e810..5f37b1f 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -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) diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 5e9075b..fb60d36 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -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 @@ done: 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); |