Convert old style (type foo *)0 casts to NULLs
PR: kern/40360 Requested by: Hiten PAndya via direct email
This commit is contained in:
parent
ffcaf36b2c
commit
3d8f797ac1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99797
@ -125,11 +125,11 @@ struct mntopt mopts[] = {
|
|||||||
|
|
||||||
struct nfs_args nfsdefargs = {
|
struct nfs_args nfsdefargs = {
|
||||||
NFS_ARGSVERSION,
|
NFS_ARGSVERSION,
|
||||||
(struct sockaddr *)0,
|
NULL,
|
||||||
sizeof (struct sockaddr_in),
|
sizeof (struct sockaddr_in),
|
||||||
SOCK_DGRAM,
|
SOCK_DGRAM,
|
||||||
0,
|
0,
|
||||||
(u_char *)0,
|
NULL,
|
||||||
0,
|
0,
|
||||||
NFSMNT_RESVPORT,
|
NFSMNT_RESVPORT,
|
||||||
NFS_WSIZE,
|
NFS_WSIZE,
|
||||||
@ -141,7 +141,7 @@ struct nfs_args nfsdefargs = {
|
|||||||
NFS_DEFRAHEAD,
|
NFS_DEFRAHEAD,
|
||||||
0, /* was: NQ_DEFLEASE */
|
0, /* was: NQ_DEFLEASE */
|
||||||
NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */
|
NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */
|
||||||
(char *)0,
|
NULL,
|
||||||
/* args version 4 */
|
/* args version 4 */
|
||||||
NFS_MINATTRTIMO,
|
NFS_MINATTRTIMO,
|
||||||
NFS_MAXATTRTIMO,
|
NFS_MAXATTRTIMO,
|
||||||
|
@ -1025,9 +1025,9 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
|
|||||||
|
|
||||||
if (nmp->nm_flag & NFSMNT_INT) {
|
if (nmp->nm_flag & NFSMNT_INT) {
|
||||||
bp = getblk(vp, bn, size, PCATCH, 0);
|
bp = getblk(vp, bn, size, PCATCH, 0);
|
||||||
while (bp == (struct buf *)0) {
|
while (bp == NULL) {
|
||||||
if (nfs_sigintr(nmp, (struct nfsreq *)0, td))
|
if (nfs_sigintr(nmp, NULL, td))
|
||||||
return ((struct buf *)0);
|
return (NULL);
|
||||||
bp = getblk(vp, bn, size, 0, 2 * hz);
|
bp = getblk(vp, bn, size, 0, 2 * hz);
|
||||||
}
|
}
|
||||||
} else {
|
} 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",
|
error = tsleep((caddr_t)&np->n_flag, PRIBIO + 2, "nfsvinval",
|
||||||
slptimeo);
|
slptimeo);
|
||||||
if (error && intrflg &&
|
if (error && intrflg &&
|
||||||
nfs_sigintr(nmp, (struct nfsreq *)0, td))
|
nfs_sigintr(nmp, NULL, td))
|
||||||
return (EINTR);
|
return (EINTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1087,7 +1087,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
|
|||||||
error = vinvalbuf(vp, flags, cred, td, slpflag, 0);
|
error = vinvalbuf(vp, flags, cred, td, slpflag, 0);
|
||||||
while (error) {
|
while (error) {
|
||||||
if (intrflg &&
|
if (intrflg &&
|
||||||
nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
|
nfs_sigintr(nmp, NULL, td)) {
|
||||||
np->n_flag &= ~NFLUSHINPROG;
|
np->n_flag &= ~NFLUSHINPROG;
|
||||||
if (np->n_flag & NFLUSHWANT) {
|
if (np->n_flag & NFLUSHWANT) {
|
||||||
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",
|
NFS_DPF(ASYNCIO, ("nfs_asyncio: waking iod %d for mount %p\n",
|
||||||
iod, nmp));
|
iod, nmp));
|
||||||
nfs_iodwant[iod] = (struct proc *)0;
|
nfs_iodwant[iod] = NULL;
|
||||||
nfs_iodmount[iod] = nmp;
|
nfs_iodmount[iod] = nmp;
|
||||||
nmp->nm_bufqiods++;
|
nmp->nm_bufqiods++;
|
||||||
wakeup((caddr_t)&nfs_iodwant[iod]);
|
wakeup((caddr_t)&nfs_iodwant[iod]);
|
||||||
|
@ -258,9 +258,9 @@ nfssvc_iod(void *instance)
|
|||||||
wakeup(&nmp->nm_bufq);
|
wakeup(&nmp->nm_bufq);
|
||||||
}
|
}
|
||||||
if (bp->b_iocmd == BIO_READ)
|
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
|
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
|
* If there are more than one iod on this mount, then defect
|
||||||
* so that the iods can be shared out fairly between the mounts
|
* so that the iods can be shared out fairly between the mounts
|
||||||
|
@ -285,9 +285,9 @@ nfs_inactive(struct vop_inactive_args *ap)
|
|||||||
vprint("nfs_inactive: pushing active", ap->a_vp);
|
vprint("nfs_inactive: pushing active", ap->a_vp);
|
||||||
if (ap->a_vp->v_type != VDIR) {
|
if (ap->a_vp->v_type != VDIR) {
|
||||||
sp = np->n_sillyrename;
|
sp = np->n_sillyrename;
|
||||||
np->n_sillyrename = (struct sillyrename *)0;
|
np->n_sillyrename = NULL;
|
||||||
} else
|
} else
|
||||||
sp = (struct sillyrename *)0;
|
sp = NULL;
|
||||||
if (sp) {
|
if (sp) {
|
||||||
/*
|
/*
|
||||||
* We need a reference to keep the vnode from being
|
* We need a reference to keep the vnode from being
|
||||||
@ -354,6 +354,6 @@ nfs_reclaim(struct vop_reclaim_args *ap)
|
|||||||
|
|
||||||
cache_purge(vp);
|
cache_purge(vp);
|
||||||
uma_zfree(nfsnode_zone, vp->v_data);
|
uma_zfree(nfsnode_zone, vp->v_data);
|
||||||
vp->v_data = (void *)0;
|
vp->v_data = NULL;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
|
|||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
struct thread *td = &thread0; /* only used for socreate and sobind */
|
struct thread *td = &thread0; /* only used for socreate and sobind */
|
||||||
|
|
||||||
nmp->nm_so = (struct socket *)0;
|
nmp->nm_so = NULL;
|
||||||
saddr = nmp->nm_nam;
|
saddr = nmp->nm_nam;
|
||||||
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
|
error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype,
|
||||||
nmp->nm_soproto, nmp->nm_cred, td);
|
nmp->nm_soproto, nmp->nm_cred, td);
|
||||||
@ -367,7 +367,7 @@ nfs_disconnect(struct nfsmount *nmp)
|
|||||||
|
|
||||||
if (nmp->nm_so) {
|
if (nmp->nm_so) {
|
||||||
so = nmp->nm_so;
|
so = nmp->nm_so;
|
||||||
nmp->nm_so = (struct socket *)0;
|
nmp->nm_so = NULL;
|
||||||
soshutdown(so, 2);
|
soshutdown(so, 2);
|
||||||
soclose(so);
|
soclose(so);
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top,
|
|||||||
soflags = rep->r_nmp->nm_soflags;
|
soflags = rep->r_nmp->nm_soflags;
|
||||||
|
|
||||||
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
|
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
|
||||||
sendnam = (struct sockaddr *)0;
|
sendnam = NULL;
|
||||||
else
|
else
|
||||||
sendnam = nam;
|
sendnam = nam;
|
||||||
if (so->so_type == SOCK_SEQPACKET)
|
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()
|
* Set up arguments for soreceive()
|
||||||
*/
|
*/
|
||||||
*mp = (struct mbuf *)0;
|
*mp = NULL;
|
||||||
*aname = (struct sockaddr *)0;
|
*aname = NULL;
|
||||||
sotype = rep->r_nmp->nm_sotype;
|
sotype = rep->r_nmp->nm_sotype;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -541,9 +541,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
do {
|
do {
|
||||||
rcvflg = MSG_WAITALL;
|
rcvflg = MSG_WAITALL;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, (struct sockaddr **)0, &auio,
|
(so, NULL, &auio, NULL, NULL, &rcvflg);
|
||||||
(struct mbuf **)0, (struct mbuf **)0,
|
|
||||||
&rcvflg);
|
|
||||||
if (error == EWOULDBLOCK && rep) {
|
if (error == EWOULDBLOCK && rep) {
|
||||||
if (rep->r_flags & R_SOFTTERM)
|
if (rep->r_flags & R_SOFTTERM)
|
||||||
return (EINTR);
|
return (EINTR);
|
||||||
@ -583,8 +581,8 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
do {
|
do {
|
||||||
rcvflg = MSG_WAITALL;
|
rcvflg = MSG_WAITALL;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, (struct sockaddr **)0,
|
(so, NULL,
|
||||||
&auio, mp, (struct mbuf **)0, &rcvflg);
|
&auio, mp, NULL, &rcvflg);
|
||||||
} while (error == EWOULDBLOCK || error == EINTR ||
|
} while (error == EWOULDBLOCK || error == EINTR ||
|
||||||
error == ERESTART);
|
error == ERESTART);
|
||||||
if (!error && auio.uio_resid > 0) {
|
if (!error && auio.uio_resid > 0) {
|
||||||
@ -609,7 +607,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
do {
|
do {
|
||||||
rcvflg = 0;
|
rcvflg = 0;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, (struct sockaddr **)0,
|
(so, NULL,
|
||||||
&auio, mp, &control, &rcvflg);
|
&auio, mp, &control, &rcvflg);
|
||||||
if (control)
|
if (control)
|
||||||
m_freem(control);
|
m_freem(control);
|
||||||
@ -628,7 +626,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
errout:
|
errout:
|
||||||
if (error && error != EINTR && error != ERESTART) {
|
if (error && error != EINTR && error != ERESTART) {
|
||||||
m_freem(*mp);
|
m_freem(*mp);
|
||||||
*mp = (struct mbuf *)0;
|
*mp = NULL;
|
||||||
if (error != EPIPE)
|
if (error != EPIPE)
|
||||||
log(LOG_INFO,
|
log(LOG_INFO,
|
||||||
"receive error %d from nfs server %s\n",
|
"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)
|
if ((so = rep->r_nmp->nm_so) == NULL)
|
||||||
return (EACCES);
|
return (EACCES);
|
||||||
if (so->so_state & SS_ISCONNECTED)
|
if (so->so_state & SS_ISCONNECTED)
|
||||||
getnam = (struct sockaddr **)0;
|
getnam = NULL;
|
||||||
else
|
else
|
||||||
getnam = aname;
|
getnam = aname;
|
||||||
auio.uio_resid = len = 1000000;
|
auio.uio_resid = len = 1000000;
|
||||||
@ -655,7 +653,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
rcvflg = 0;
|
rcvflg = 0;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, getnam, &auio, mp,
|
(so, getnam, &auio, mp,
|
||||||
(struct mbuf **)0, &rcvflg);
|
NULL, &rcvflg);
|
||||||
if (error == EWOULDBLOCK &&
|
if (error == EWOULDBLOCK &&
|
||||||
(rep->r_flags & R_SOFTTERM))
|
(rep->r_flags & R_SOFTTERM))
|
||||||
return (EINTR);
|
return (EINTR);
|
||||||
@ -664,7 +662,7 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp)
|
|||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
m_freem(*mp);
|
m_freem(*mp);
|
||||||
*mp = (struct mbuf *)0;
|
*mp = NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Search for any mbufs that are not a multiple of 4 bytes long
|
* 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))){
|
(m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
|
||||||
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
|
if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
|
||||||
error = (*so->so_proto->pr_usrreqs->pru_send)
|
error = (*so->so_proto->pr_usrreqs->pru_send)
|
||||||
(so, 0, m, (struct sockaddr *)0,
|
(so, 0, m, NULL, NULL, td);
|
||||||
(struct mbuf *)0, td);
|
|
||||||
else
|
else
|
||||||
error = (*so->so_proto->pr_usrreqs->pru_send)
|
error = (*so->so_proto->pr_usrreqs->pru_send)
|
||||||
(so, 0, m, nmp->nm_nam, (struct mbuf *)0,
|
(so, 0, m, nmp->nm_nam, NULL, td);
|
||||||
td);
|
|
||||||
if (error) {
|
if (error) {
|
||||||
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
|
if (NFSIGNORE_SOERROR(nmp->nm_soflags, error))
|
||||||
so->so_error = 0;
|
so->so_error = 0;
|
||||||
@ -1162,7 +1158,7 @@ nfs_timer(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
splx(s);
|
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)
|
if (rep->r_nmp->nm_flag & NFSMNT_INT)
|
||||||
slpflag = PCATCH;
|
slpflag = PCATCH;
|
||||||
} else
|
} else
|
||||||
td = (struct thread *)0;
|
td = NULL;
|
||||||
while (*statep & NFSSTA_SNDLOCK) {
|
while (*statep & NFSSTA_SNDLOCK) {
|
||||||
if (nfs_sigintr(rep->r_nmp, rep, td))
|
if (nfs_sigintr(rep->r_nmp, rep, td))
|
||||||
return (EINTR);
|
return (EINTR);
|
||||||
|
@ -233,7 +233,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
|
|||||||
*tl = 0;
|
*tl = 0;
|
||||||
mb->m_next = mrest;
|
mb->m_next = mrest;
|
||||||
mreq->m_pkthdr.len = authsiz + 10 * NFSX_UNSIGNED + mrest_len;
|
mreq->m_pkthdr.len = authsiz + 10 * NFSX_UNSIGNED + mrest_len;
|
||||||
mreq->m_pkthdr.rcvif = (struct ifnet *)0;
|
mreq->m_pkthdr.rcvif = NULL;
|
||||||
*mbp = mb;
|
*mbp = mb;
|
||||||
return (mreq);
|
return (mreq);
|
||||||
}
|
}
|
||||||
@ -406,8 +406,8 @@ nfs_init(struct vfsconf *vfsp)
|
|||||||
nfs_ticks = 1;
|
nfs_ticks = 1;
|
||||||
/* Ensure async daemons disabled */
|
/* Ensure async daemons disabled */
|
||||||
for (i = 0; i < NFS_MAXASYNCDAEMON; i++) {
|
for (i = 0; i < NFS_MAXASYNCDAEMON; i++) {
|
||||||
nfs_iodwant[i] = (struct proc *)0;
|
nfs_iodwant[i] = NULL;
|
||||||
nfs_iodmount[i] = (struct nfsmount *)0;
|
nfs_iodmount[i] = NULL;
|
||||||
}
|
}
|
||||||
nfs_nhinit(); /* Init the nfsnode table */
|
nfs_nhinit(); /* Init the nfsnode table */
|
||||||
|
|
||||||
@ -719,14 +719,14 @@ nfs_getcookie(struct nfsnode *np, off_t off, int add)
|
|||||||
dp->ndm_eocookie = 0;
|
dp->ndm_eocookie = 0;
|
||||||
LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
|
LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list);
|
||||||
} else
|
} else
|
||||||
return ((nfsuint64 *)0);
|
return (NULL);
|
||||||
}
|
}
|
||||||
while (pos >= NFSNUMCOOKIES) {
|
while (pos >= NFSNUMCOOKIES) {
|
||||||
pos -= NFSNUMCOOKIES;
|
pos -= NFSNUMCOOKIES;
|
||||||
if (LIST_NEXT(dp, ndm_list)) {
|
if (LIST_NEXT(dp, ndm_list)) {
|
||||||
if (!add && dp->ndm_eocookie < NFSNUMCOOKIES &&
|
if (!add && dp->ndm_eocookie < NFSNUMCOOKIES &&
|
||||||
pos >= dp->ndm_eocookie)
|
pos >= dp->ndm_eocookie)
|
||||||
return ((nfsuint64 *)0);
|
return (NULL);
|
||||||
dp = LIST_NEXT(dp, ndm_list);
|
dp = LIST_NEXT(dp, ndm_list);
|
||||||
} else if (add) {
|
} else if (add) {
|
||||||
MALLOC(dp2, struct nfsdmap *, sizeof (struct nfsdmap),
|
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);
|
LIST_INSERT_AFTER(dp, dp2, ndm_list);
|
||||||
dp = dp2;
|
dp = dp2;
|
||||||
} else
|
} else
|
||||||
return ((nfsuint64 *)0);
|
return (NULL);
|
||||||
}
|
}
|
||||||
if (pos >= dp->ndm_eocookie) {
|
if (pos >= dp->ndm_eocookie) {
|
||||||
if (add)
|
if (add)
|
||||||
dp->ndm_eocookie = pos + 1;
|
dp->ndm_eocookie = pos + 1;
|
||||||
else
|
else
|
||||||
return ((nfsuint64 *)0);
|
return (NULL);
|
||||||
}
|
}
|
||||||
return (&dp->ndm_cookies[pos]);
|
return (&dp->ndm_cookies[pos]);
|
||||||
}
|
}
|
||||||
@ -848,7 +848,7 @@ nfsm_mtofh_xx(struct vnode *d, struct vnode **v, int v3, int *f,
|
|||||||
}
|
}
|
||||||
if (*f) {
|
if (*f) {
|
||||||
ttvp = *v;
|
ttvp = *v;
|
||||||
t1 = nfs_loadattrcache(&ttvp, md, dpos, (struct vattr *)0, 0);
|
t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 0);
|
||||||
if (t1)
|
if (t1)
|
||||||
return t1;
|
return t1;
|
||||||
*v = ttvp;
|
*v = ttvp;
|
||||||
@ -905,7 +905,7 @@ nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md,
|
|||||||
return EBADRPC;
|
return EBADRPC;
|
||||||
*f = fxdr_unsigned(int, *tl);
|
*f = fxdr_unsigned(int, *tl);
|
||||||
if (*f != 0) {
|
if (*f != 0) {
|
||||||
t1 = nfs_loadattrcache(&ttvp, md, dpos, (struct vattr *)0, 1);
|
t1 = nfs_loadattrcache(&ttvp, md, dpos, NULL, 1);
|
||||||
if (t1 != 0) {
|
if (t1 != 0) {
|
||||||
*f = 0;
|
*f = 0;
|
||||||
return t1;
|
return t1;
|
||||||
|
@ -246,7 +246,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
|
|||||||
u_quad_t tquad;
|
u_quad_t tquad;
|
||||||
|
|
||||||
#ifndef nolint
|
#ifndef nolint
|
||||||
sfp = (struct nfs_statfs *)0;
|
sfp = NULL;
|
||||||
#endif
|
#endif
|
||||||
error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np);
|
error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np);
|
||||||
if (error)
|
if (error)
|
||||||
@ -452,7 +452,7 @@ nfs_mountroot(struct mount *mp, struct thread *td)
|
|||||||
error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
|
error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
|
||||||
(struct sockaddr *)&nd->mygateway,
|
(struct sockaddr *)&nd->mygateway,
|
||||||
(struct sockaddr *)&mask,
|
(struct sockaddr *)&mask,
|
||||||
RTF_UP | RTF_GATEWAY, (struct rtentry **)0);
|
RTF_UP | RTF_GATEWAY, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
panic("nfs_mountroot: RTM_ADD: %d", 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) {
|
if (nmp->nm_so && adjsock) {
|
||||||
nfs_safedisconnect(nmp);
|
nfs_safedisconnect(nmp);
|
||||||
if (nmp->nm_sotype == SOCK_DGRAM)
|
if (nmp->nm_sotype == SOCK_DGRAM)
|
||||||
while (nfs_connect(nmp, (struct nfsreq *)0)) {
|
while (nfs_connect(nmp, NULL)) {
|
||||||
printf("nfs_args: retrying connect\n");
|
printf("nfs_args: retrying connect\n");
|
||||||
(void) tsleep((caddr_t)&lbolt,
|
(void) tsleep((caddr_t)&lbolt,
|
||||||
PSOCK, "nfscon", 0);
|
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.
|
* the first request, in case the server is not responding.
|
||||||
*/
|
*/
|
||||||
if (nmp->nm_sotype == SOCK_DGRAM &&
|
if (nmp->nm_sotype == SOCK_DGRAM &&
|
||||||
(error = nfs_connect(nmp, (struct nfsreq *)0)))
|
(error = nfs_connect(nmp, NULL)))
|
||||||
goto bad;
|
goto bad;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -727,7 +727,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
|
|||||||
if (v3) {
|
if (v3) {
|
||||||
nfsm_wcc_data(vp, wccflag);
|
nfsm_wcc_data(vp, wccflag);
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(vp, (struct vattr *)0);
|
nfsm_loadattr(vp, NULL);
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
nfsmout:
|
nfsmout:
|
||||||
return (error);
|
return (error);
|
||||||
@ -865,7 +865,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
|||||||
nfsm_postop_attr(newvp, attrflag);
|
nfsm_postop_attr(newvp, attrflag);
|
||||||
nfsm_postop_attr(dvp, attrflag);
|
nfsm_postop_attr(dvp, attrflag);
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(newvp, (struct vattr *)0);
|
nfsm_loadattr(newvp, NULL);
|
||||||
*vpp = newvp;
|
*vpp = newvp;
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
cnp->cn_flags |= SAVENAME;
|
cnp->cn_flags |= SAVENAME;
|
||||||
@ -912,7 +912,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
|||||||
nfsm_postop_attr(newvp, attrflag);
|
nfsm_postop_attr(newvp, attrflag);
|
||||||
nfsm_postop_attr(dvp, attrflag);
|
nfsm_postop_attr(dvp, attrflag);
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(newvp, (struct vattr *)0);
|
nfsm_loadattr(newvp, NULL);
|
||||||
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
|
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
|
||||||
cnp->cn_flags |= SAVENAME;
|
cnp->cn_flags |= SAVENAME;
|
||||||
if ((cnp->cn_flags & MAKEENTRY) &&
|
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);
|
tl = nfsm_dissect(u_int32_t *, 2 * NFSX_UNSIGNED);
|
||||||
eof = fxdr_unsigned(int, *(tl + 1));
|
eof = fxdr_unsigned(int, *(tl + 1));
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(vp, (struct vattr *)0);
|
nfsm_loadattr(vp, NULL);
|
||||||
nfsm_strsiz(retlen, nmp->nm_rsize);
|
nfsm_strsiz(retlen, nmp->nm_rsize);
|
||||||
nfsm_mtouio(uiop, retlen);
|
nfsm_mtouio(uiop, retlen);
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
@ -1164,7 +1164,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(vp, (struct vattr *)0);
|
nfsm_loadattr(vp, NULL);
|
||||||
if (wccflag)
|
if (wccflag)
|
||||||
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
|
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec;
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
@ -1192,8 +1192,8 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
{
|
{
|
||||||
struct nfsv2_sattr *sp;
|
struct nfsv2_sattr *sp;
|
||||||
u_int32_t *tl;
|
u_int32_t *tl;
|
||||||
struct vnode *newvp = (struct vnode *)0;
|
struct vnode *newvp = NULL;
|
||||||
struct nfsnode *np = (struct nfsnode *)0;
|
struct nfsnode *np = NULL;
|
||||||
struct vattr vattr;
|
struct vattr vattr;
|
||||||
caddr_t bpos, dpos;
|
caddr_t bpos, dpos;
|
||||||
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0;
|
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 (!gotvp) {
|
||||||
if (newvp) {
|
if (newvp) {
|
||||||
vput(newvp);
|
vput(newvp);
|
||||||
newvp = (struct vnode *)0;
|
newvp = NULL;
|
||||||
}
|
}
|
||||||
error = nfs_lookitup(dvp, cnp->cn_nameptr,
|
error = nfs_lookitup(dvp, cnp->cn_nameptr,
|
||||||
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
|
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 componentname *cnp = ap->a_cnp;
|
||||||
struct nfsv2_sattr *sp;
|
struct nfsv2_sattr *sp;
|
||||||
u_int32_t *tl;
|
u_int32_t *tl;
|
||||||
struct nfsnode *np = (struct nfsnode *)0;
|
struct nfsnode *np = NULL;
|
||||||
struct vnode *newvp = (struct vnode *)0;
|
struct vnode *newvp = NULL;
|
||||||
caddr_t bpos, dpos;
|
caddr_t bpos, dpos;
|
||||||
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0;
|
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0;
|
||||||
struct mbuf *mreq, *mrep, *md, *mb;
|
struct mbuf *mreq, *mrep, *md, *mb;
|
||||||
@ -1350,7 +1350,7 @@ nfs_create(struct vop_create_args *ap)
|
|||||||
if (!gotvp) {
|
if (!gotvp) {
|
||||||
if (newvp) {
|
if (newvp) {
|
||||||
vput(newvp);
|
vput(newvp);
|
||||||
newvp = (struct vnode *)0;
|
newvp = NULL;
|
||||||
}
|
}
|
||||||
error = nfs_lookitup(dvp, cnp->cn_nameptr,
|
error = nfs_lookitup(dvp, cnp->cn_nameptr,
|
||||||
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np);
|
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,
|
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;
|
caddr_t bpos, dpos;
|
||||||
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
|
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
|
||||||
struct mbuf *mreq, *mrep, *md, *mb;
|
struct mbuf *mreq, *mrep, *md, *mb;
|
||||||
struct vnode *newvp = (struct vnode *)0;
|
struct vnode *newvp = NULL;
|
||||||
int v3 = NFS_ISV3(dvp);
|
int v3 = NFS_ISV3(dvp);
|
||||||
|
|
||||||
nfsstats.rpccnt[NFSPROC_SYMLINK]++;
|
nfsstats.rpccnt[NFSPROC_SYMLINK]++;
|
||||||
@ -1784,8 +1784,8 @@ nfs_mkdir(struct vop_mkdir_args *ap)
|
|||||||
struct componentname *cnp = ap->a_cnp;
|
struct componentname *cnp = ap->a_cnp;
|
||||||
struct nfsv2_sattr *sp;
|
struct nfsv2_sattr *sp;
|
||||||
int len;
|
int len;
|
||||||
struct nfsnode *np = (struct nfsnode *)0;
|
struct nfsnode *np = NULL;
|
||||||
struct vnode *newvp = (struct vnode *)0;
|
struct vnode *newvp = NULL;
|
||||||
caddr_t bpos, dpos;
|
caddr_t bpos, dpos;
|
||||||
int error = 0, wccflag = NFSV3_WCCRATTR;
|
int error = 0, wccflag = NFSV3_WCCRATTR;
|
||||||
int gotvp = 0;
|
int gotvp = 0;
|
||||||
@ -1832,7 +1832,7 @@ nfs_mkdir(struct vop_mkdir_args *ap)
|
|||||||
if (error == EEXIST || (!error && !gotvp)) {
|
if (error == EEXIST || (!error && !gotvp)) {
|
||||||
if (newvp) {
|
if (newvp) {
|
||||||
vrele(newvp);
|
vrele(newvp);
|
||||||
newvp = (struct vnode *)0;
|
newvp = NULL;
|
||||||
}
|
}
|
||||||
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
|
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred,
|
||||||
cnp->cn_thread, &np);
|
cnp->cn_thread, &np);
|
||||||
@ -2138,7 +2138,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
|
|||||||
int attrflag, fhsize;
|
int attrflag, fhsize;
|
||||||
|
|
||||||
#ifndef nolint
|
#ifndef nolint
|
||||||
dp = (struct dirent *)0;
|
dp = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DIAGNOSTIC
|
#ifndef DIAGNOSTIC
|
||||||
if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) ||
|
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;
|
dpos = dpossav1;
|
||||||
mdsav2 = md;
|
mdsav2 = md;
|
||||||
md = mdsav1;
|
md = mdsav1;
|
||||||
nfsm_loadattr(newvp, (struct vattr *)0);
|
nfsm_loadattr(newvp, NULL);
|
||||||
dpos = dpossav2;
|
dpos = dpossav2;
|
||||||
md = mdsav2;
|
md = mdsav2;
|
||||||
dp->d_type =
|
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 */
|
/* Try lookitups until we get one that isn't there */
|
||||||
while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred,
|
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]++;
|
sp->s_name[4]++;
|
||||||
if (sp->s_name[4] > 'z') {
|
if (sp->s_name[4] > 'z') {
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
@ -2410,7 +2410,7 @@ static int
|
|||||||
nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
|
nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
|
||||||
struct thread *td, struct nfsnode **npp)
|
struct thread *td, struct nfsnode **npp)
|
||||||
{
|
{
|
||||||
struct vnode *newvp = (struct vnode *)0;
|
struct vnode *newvp = NULL;
|
||||||
struct nfsnode *np, *dnp = VTONFS(dvp);
|
struct nfsnode *np, *dnp = VTONFS(dvp);
|
||||||
caddr_t bpos, dpos;
|
caddr_t bpos, dpos;
|
||||||
int error = 0, fhlen, attrflag;
|
int error = 0, fhlen, attrflag;
|
||||||
@ -2460,7 +2460,7 @@ nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
|
|||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
nfsm_loadattr(newvp, (struct vattr *)0);
|
nfsm_loadattr(newvp, NULL);
|
||||||
}
|
}
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
nfsmout:
|
nfsmout:
|
||||||
@ -2539,7 +2539,7 @@ nfs_strategy(struct vop_strategy_args *ap)
|
|||||||
panic("nfs physio");
|
panic("nfs physio");
|
||||||
|
|
||||||
if (bp->b_flags & B_ASYNC)
|
if (bp->b_flags & B_ASYNC)
|
||||||
td = (struct thread *)0;
|
td = NULL;
|
||||||
else
|
else
|
||||||
td = curthread; /* XXX */
|
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");
|
panic("nfs_fsync: inconsistent lock");
|
||||||
if (error == ENOLCK)
|
if (error == ENOLCK)
|
||||||
goto loop;
|
goto loop;
|
||||||
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
|
if (nfs_sigintr(nmp, NULL, td)) {
|
||||||
error = EINTR;
|
error = EINTR;
|
||||||
goto done;
|
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,
|
error = tsleep((caddr_t)&vp->v_numoutput,
|
||||||
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo);
|
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo);
|
||||||
if (error) {
|
if (error) {
|
||||||
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) {
|
if (nfs_sigintr(nmp, NULL, td)) {
|
||||||
error = EINTR;
|
error = EINTR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, TRUE);
|
||||||
if (error) {
|
if (error) {
|
||||||
nfsm_reply(NFSX_UNSIGNED);
|
nfsm_reply(NFSX_UNSIGNED);
|
||||||
nfsm_srvpostop_attr(1, (struct vattr *)0);
|
nfsm_srvpostop_attr(1, NULL);
|
||||||
error = 0;
|
error = 0;
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
|
|
||||||
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
|
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
|
||||||
#ifndef nolint
|
#ifndef nolint
|
||||||
mp = (struct mbuf *)0;
|
mp = NULL;
|
||||||
#endif
|
#endif
|
||||||
mp3 = NULL;
|
mp3 = NULL;
|
||||||
fhp = &nfh.fh_generic;
|
fhp = &nfh.fh_generic;
|
||||||
@ -681,12 +681,12 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
uiop->uio_resid = len;
|
uiop->uio_resid = len;
|
||||||
uiop->uio_rw = UIO_READ;
|
uiop->uio_rw = UIO_READ;
|
||||||
uiop->uio_segflg = UIO_SYSSPACE;
|
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);
|
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, TRUE);
|
||||||
if (error) {
|
if (error) {
|
||||||
nfsm_reply(2 * NFSX_UNSIGNED);
|
nfsm_reply(2 * NFSX_UNSIGNED);
|
||||||
if (v3)
|
if (v3)
|
||||||
nfsm_srvpostop_attr(1, (struct vattr *)0);
|
nfsm_srvpostop_attr(1, NULL);
|
||||||
error = 0;
|
error = 0;
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
}
|
}
|
||||||
@ -780,7 +780,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
vp = NULL;
|
vp = NULL;
|
||||||
nfsm_reply(2 * NFSX_UNSIGNED);
|
nfsm_reply(2 * NFSX_UNSIGNED);
|
||||||
if (v3)
|
if (v3)
|
||||||
nfsm_srvpostop_attr(1, (struct vattr *)0);
|
nfsm_srvpostop_attr(1, NULL);
|
||||||
error = 0;
|
error = 0;
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
}
|
}
|
||||||
@ -1136,7 +1136,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
uiop->uio_resid = len;
|
uiop->uio_resid = len;
|
||||||
uiop->uio_rw = UIO_WRITE;
|
uiop->uio_rw = UIO_WRITE;
|
||||||
uiop->uio_segflg = UIO_SYSSPACE;
|
uiop->uio_segflg = UIO_SYSSPACE;
|
||||||
uiop->uio_td = (struct thread *)0;
|
uiop->uio_td = NULL;
|
||||||
uiop->uio_offset = off;
|
uiop->uio_offset = off;
|
||||||
error = VOP_WRITE(vp, uiop, ioflags, cred);
|
error = VOP_WRITE(vp, uiop, ioflags, cred);
|
||||||
nfsrvstats.srvvop_writes++;
|
nfsrvstats.srvvop_writes++;
|
||||||
@ -1391,7 +1391,7 @@ nfsrv_writegather(struct nfsrv_descript **ndp, struct nfssvc_sock *slp,
|
|||||||
ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
|
ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
|
||||||
uiop->uio_rw = UIO_WRITE;
|
uiop->uio_rw = UIO_WRITE;
|
||||||
uiop->uio_segflg = UIO_SYSSPACE;
|
uiop->uio_segflg = UIO_SYSSPACE;
|
||||||
uiop->uio_td = (struct thread *)0;
|
uiop->uio_td = NULL;
|
||||||
uiop->uio_offset = nfsd->nd_off;
|
uiop->uio_offset = nfsd->nd_off;
|
||||||
uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off;
|
uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off;
|
||||||
if (uiop->uio_resid > 0) {
|
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;
|
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
|
||||||
caddr_t cp;
|
caddr_t cp;
|
||||||
struct mbuf *mb, *mreq;
|
struct mbuf *mb, *mreq;
|
||||||
struct vnode *dirp = (struct vnode *)0;
|
struct vnode *dirp = NULL;
|
||||||
nfsfh_t nfh;
|
nfsfh_t nfh;
|
||||||
fhandle_t *fhp;
|
fhandle_t *fhp;
|
||||||
u_quad_t tempsize;
|
u_quad_t tempsize;
|
||||||
@ -1869,7 +1869,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
u_int32_t major, minor;
|
u_int32_t major, minor;
|
||||||
enum vtype vtyp;
|
enum vtype vtyp;
|
||||||
struct mbuf *mb, *mreq;
|
struct mbuf *mb, *mreq;
|
||||||
struct vnode *vp, *dirp = (struct vnode *)0;
|
struct vnode *vp, *dirp = NULL;
|
||||||
nfsfh_t nfh;
|
nfsfh_t nfh;
|
||||||
fhandle_t *fhp;
|
fhandle_t *fhp;
|
||||||
struct mount *mp = NULL;
|
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);
|
int v3 = (nfsd->nd_flag & ND_NFSV3);
|
||||||
struct mbuf *mb, *mreq;
|
struct mbuf *mb, *mreq;
|
||||||
struct nameidata fromnd, tond;
|
struct nameidata fromnd, tond;
|
||||||
struct vnode *fvp, *tvp, *tdvp, *fdirp = (struct vnode *)0;
|
struct vnode *fvp, *tvp, *tdvp, *fdirp = NULL;
|
||||||
struct vnode *tdirp = (struct vnode *)0;
|
struct vnode *tdirp = NULL;
|
||||||
struct vattr fdirfor, fdiraft, tdirfor, tdiraft;
|
struct vattr fdirfor, fdiraft, tdirfor, tdiraft;
|
||||||
nfsfh_t fnfh, tnfh;
|
nfsfh_t fnfh, tnfh;
|
||||||
fhandle_t *ffhp, *tfhp;
|
fhandle_t *ffhp, *tfhp;
|
||||||
@ -2166,7 +2166,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
|
|
||||||
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
|
nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
|
||||||
#ifndef nolint
|
#ifndef nolint
|
||||||
fvp = (struct vnode *)0;
|
fvp = NULL;
|
||||||
#endif
|
#endif
|
||||||
ffhp = &fnfh.fh_generic;
|
ffhp = &fnfh.fh_generic;
|
||||||
tfhp = &tnfh.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 error = 0, rdonly, len, dirfor_ret = 1, diraft_ret = 1;
|
||||||
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
|
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
|
||||||
struct mbuf *mb, *mreq;
|
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;
|
struct vattr dirfor, diraft, at;
|
||||||
nfsfh_t nfh, dnfh;
|
nfsfh_t nfh, dnfh;
|
||||||
fhandle_t *fhp, *dfhp;
|
fhandle_t *fhp, *dfhp;
|
||||||
@ -2501,13 +2501,13 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
struct nameidata nd;
|
struct nameidata nd;
|
||||||
struct vattr *vap = &va;
|
struct vattr *vap = &va;
|
||||||
struct nfsv2_sattr *sp;
|
struct nfsv2_sattr *sp;
|
||||||
char *bpos, *pathcp = (char *)0;
|
char *bpos, *pathcp = NULL;
|
||||||
struct uio io;
|
struct uio io;
|
||||||
struct iovec iv;
|
struct iovec iv;
|
||||||
int error = 0, len, len2, dirfor_ret = 1, diraft_ret = 1;
|
int error = 0, len, len2, dirfor_ret = 1, diraft_ret = 1;
|
||||||
int v3 = (nfsd->nd_flag & ND_NFSV3);
|
int v3 = (nfsd->nd_flag & ND_NFSV3);
|
||||||
struct mbuf *mb, *mreq;
|
struct mbuf *mb, *mreq;
|
||||||
struct vnode *dirp = (struct vnode *)0;
|
struct vnode *dirp = NULL;
|
||||||
nfsfh_t nfh;
|
nfsfh_t nfh;
|
||||||
fhandle_t *fhp;
|
fhandle_t *fhp;
|
||||||
struct mount *mp = NULL;
|
struct mount *mp = NULL;
|
||||||
@ -2560,7 +2560,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
io.uio_iovcnt = 1;
|
io.uio_iovcnt = 1;
|
||||||
io.uio_segflg = UIO_SYSSPACE;
|
io.uio_segflg = UIO_SYSSPACE;
|
||||||
io.uio_rw = UIO_READ;
|
io.uio_rw = UIO_READ;
|
||||||
io.uio_td = (struct thread *)0;
|
io.uio_td = NULL;
|
||||||
nfsm_mtouio(&io, len2);
|
nfsm_mtouio(&io, len2);
|
||||||
if (!v3) {
|
if (!v3) {
|
||||||
sp = nfsm_dissect(struct nfsv2_sattr *, NFSX_V2SATTR);
|
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 error = 0, len, dirfor_ret = 1, diraft_ret = 1;
|
||||||
int v3 = (nfsd->nd_flag & ND_NFSV3);
|
int v3 = (nfsd->nd_flag & ND_NFSV3);
|
||||||
struct mbuf *mb, *mreq;
|
struct mbuf *mb, *mreq;
|
||||||
struct vnode *vp, *dirp = (struct vnode *)0;
|
struct vnode *vp, *dirp = NULL;
|
||||||
struct vattr dirfor, diraft;
|
struct vattr dirfor, diraft;
|
||||||
nfsfh_t nfh;
|
nfsfh_t nfh;
|
||||||
fhandle_t *fhp;
|
fhandle_t *fhp;
|
||||||
@ -3070,7 +3070,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
io.uio_resid = fullsiz;
|
io.uio_resid = fullsiz;
|
||||||
io.uio_segflg = UIO_SYSSPACE;
|
io.uio_segflg = UIO_SYSSPACE;
|
||||||
io.uio_rw = UIO_READ;
|
io.uio_rw = UIO_READ;
|
||||||
io.uio_td = (struct thread *)0;
|
io.uio_td = NULL;
|
||||||
eofflag = 0;
|
eofflag = 0;
|
||||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||||
if (cookies) {
|
if (cookies) {
|
||||||
@ -3348,7 +3348,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|||||||
io.uio_resid = fullsiz;
|
io.uio_resid = fullsiz;
|
||||||
io.uio_segflg = UIO_SYSSPACE;
|
io.uio_segflg = UIO_SYSSPACE;
|
||||||
io.uio_rw = UIO_READ;
|
io.uio_rw = UIO_READ;
|
||||||
io.uio_td = (struct thread *)0;
|
io.uio_td = NULL;
|
||||||
eofflag = 0;
|
eofflag = 0;
|
||||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||||
if (cookies) {
|
if (cookies) {
|
||||||
|
@ -437,8 +437,8 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag)
|
|||||||
auio.uio_resid = 1000000000;
|
auio.uio_resid = 1000000000;
|
||||||
flags = MSG_DONTWAIT;
|
flags = MSG_DONTWAIT;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, &nam, &auio, &mp, (struct mbuf **)0, &flags);
|
(so, &nam, &auio, &mp, NULL, &flags);
|
||||||
if (error || mp == (struct mbuf *)0) {
|
if (error || mp == NULL) {
|
||||||
if (error == EWOULDBLOCK)
|
if (error == EWOULDBLOCK)
|
||||||
slp->ns_flag |= SLP_NEEDQ;
|
slp->ns_flag |= SLP_NEEDQ;
|
||||||
else
|
else
|
||||||
@ -472,8 +472,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag)
|
|||||||
auio.uio_resid = 1000000000;
|
auio.uio_resid = 1000000000;
|
||||||
flags = MSG_DONTWAIT;
|
flags = MSG_DONTWAIT;
|
||||||
error = so->so_proto->pr_usrreqs->pru_soreceive
|
error = so->so_proto->pr_usrreqs->pru_soreceive
|
||||||
(so, &nam, &auio, &mp,
|
(so, &nam, &auio, &mp, NULL, &flags);
|
||||||
(struct mbuf **)0, &flags);
|
|
||||||
if (mp) {
|
if (mp) {
|
||||||
struct nfsrv_rec *rec;
|
struct nfsrv_rec *rec;
|
||||||
rec = malloc(sizeof(struct nfsrv_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) {
|
if (slp->ns_cc == slp->ns_reclen) {
|
||||||
recm = slp->ns_raw;
|
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;
|
slp->ns_cc = slp->ns_reclen = 0;
|
||||||
} else if (slp->ns_cc > slp->ns_reclen) {
|
} else if (slp->ns_cc > slp->ns_reclen) {
|
||||||
len = 0;
|
len = 0;
|
||||||
m = slp->ns_raw;
|
m = slp->ns_raw;
|
||||||
om = (struct mbuf *)0;
|
om = NULL;
|
||||||
while (len < slp->ns_reclen) {
|
while (len < slp->ns_reclen) {
|
||||||
if ((len + m->m_len) > slp->ns_reclen) {
|
if ((len + m->m_len) > slp->ns_reclen) {
|
||||||
m2 = m_copym(m, 0, slp->ns_reclen - len,
|
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;
|
len += m->m_len;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
recm = slp->ns_raw;
|
recm = slp->ns_raw;
|
||||||
om->m_next = (struct mbuf *)0;
|
om->m_next = NULL;
|
||||||
} else {
|
} else {
|
||||||
om = m;
|
om = m;
|
||||||
len += m->m_len;
|
len += m->m_len;
|
||||||
@ -625,11 +624,11 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag)
|
|||||||
m_freem(slp->ns_frag);
|
m_freem(slp->ns_frag);
|
||||||
} else {
|
} else {
|
||||||
nfs_realign(&slp->ns_frag, 10 * NFSX_UNSIGNED);
|
nfs_realign(&slp->ns_frag, 10 * NFSX_UNSIGNED);
|
||||||
rec->nr_address = (struct sockaddr *)0;
|
rec->nr_address = NULL;
|
||||||
rec->nr_packet = slp->ns_frag;
|
rec->nr_packet = slp->ns_frag;
|
||||||
STAILQ_INSERT_TAIL(&slp->ns_rec, rec, nr_link);
|
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;
|
soflags = so->so_proto->pr_flags;
|
||||||
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
|
if ((soflags & PR_CONNREQUIRED) || (so->so_state & SS_ISCONNECTED))
|
||||||
sendnam = (struct sockaddr *)0;
|
sendnam = NULL;
|
||||||
else
|
else
|
||||||
sendnam = nam;
|
sendnam = nam;
|
||||||
if (so->so_type == SOCK_SEQPACKET)
|
if (so->so_type == SOCK_SEQPACKET)
|
||||||
@ -763,5 +762,5 @@ nfsrv_timer(void *arg)
|
|||||||
nfsrv_wakenfsd(slp);
|
nfsrv_wakenfsd(slp);
|
||||||
}
|
}
|
||||||
splx(s);
|
splx(s);
|
||||||
nfsrv_timer_handle = timeout(nfsrv_timer, (void *)0, nfsrv_ticks);
|
nfsrv_timer_handle = timeout(nfsrv_timer, NULL, nfsrv_ticks);
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len,
|
|||||||
int error, rdonly, linklen;
|
int error, rdonly, linklen;
|
||||||
struct componentname *cnp = &ndp->ni_cnd;
|
struct componentname *cnp = &ndp->ni_cnd;
|
||||||
|
|
||||||
*retdirp = (struct vnode *)0;
|
*retdirp = NULL;
|
||||||
cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
|
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_offset = 0;
|
||||||
auio.uio_rw = UIO_READ;
|
auio.uio_rw = UIO_READ;
|
||||||
auio.uio_segflg = UIO_SYSSPACE;
|
auio.uio_segflg = UIO_SYSSPACE;
|
||||||
auio.uio_td = (struct thread *)0;
|
auio.uio_td = NULL;
|
||||||
auio.uio_resid = MAXPATHLEN;
|
auio.uio_resid = MAXPATHLEN;
|
||||||
error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred);
|
error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred);
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -881,7 +881,7 @@ nfsm_adj(struct mbuf *mp, int len, int nul)
|
|||||||
m = mp;
|
m = mp;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
count += m->m_len;
|
count += m->m_len;
|
||||||
if (m->m_next == (struct mbuf *)0)
|
if (m->m_next == NULL)
|
||||||
break;
|
break;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
}
|
}
|
||||||
@ -1031,7 +1031,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp,
|
|||||||
struct sockaddr_int *saddr;
|
struct sockaddr_int *saddr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*vpp = (struct vnode *)0;
|
*vpp = NULL;
|
||||||
|
|
||||||
if (nfs_ispublicfh(fhp)) {
|
if (nfs_ispublicfh(fhp)) {
|
||||||
if (!pubflag || !nfs_pub.np_valid)
|
if (!pubflag || !nfs_pub.np_valid)
|
||||||
|
@ -150,7 +150,7 @@ nfssvc(struct thread *td, struct nfssvc_args *uap)
|
|||||||
* Get the client address for connected sockets.
|
* Get the client address for connected sockets.
|
||||||
*/
|
*/
|
||||||
if (nfsdarg.name == NULL || nfsdarg.namelen == 0)
|
if (nfsdarg.name == NULL || nfsdarg.namelen == 0)
|
||||||
nam = (struct sockaddr *)0;
|
nam = NULL;
|
||||||
else {
|
else {
|
||||||
error = getsockaddr(&nam, nfsdarg.name,
|
error = getsockaddr(&nam, nfsdarg.name,
|
||||||
nfsdarg.namelen);
|
nfsdarg.namelen);
|
||||||
@ -189,7 +189,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td)
|
|||||||
|
|
||||||
so = (struct socket *)fp->f_data;
|
so = (struct socket *)fp->f_data;
|
||||||
#if 0
|
#if 0
|
||||||
tslp = (struct nfssvc_sock *)0;
|
tslp = NULL;
|
||||||
/*
|
/*
|
||||||
* Add it to the list, as required.
|
* 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;
|
cacherep = RC_DOIT;
|
||||||
writes_todo = 0;
|
writes_todo = 0;
|
||||||
#endif
|
#endif
|
||||||
if (nfsd == (struct nfsd *)0) {
|
if (nfsd == NULL) {
|
||||||
nsd->nsd_nfsd = nfsd = (struct nfsd *)
|
nsd->nsd_nfsd = nfsd = (struct nfsd *)
|
||||||
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
|
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
|
||||||
s = splnet();
|
s = splnet();
|
||||||
@ -303,7 +303,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
|||||||
*/
|
*/
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((nfsd->nfsd_flag & NFSD_REQINPROG) == 0) {
|
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_head_flag & NFSD_CHECKSLP) == 0) {
|
||||||
nfsd->nfsd_flag |= NFSD_WAITING;
|
nfsd->nfsd_flag |= NFSD_WAITING;
|
||||||
nfsd_waiting++;
|
nfsd_waiting++;
|
||||||
@ -313,7 +313,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
|||||||
if (error)
|
if (error)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (nfsd->nfsd_slp == (struct nfssvc_sock *)0 &&
|
if (nfsd->nfsd_slp == NULL &&
|
||||||
(nfsd_head_flag & NFSD_CHECKSLP) != 0) {
|
(nfsd_head_flag & NFSD_CHECKSLP) != 0) {
|
||||||
TAILQ_FOREACH(slp, &nfssvc_sockhead, ns_chain) {
|
TAILQ_FOREACH(slp, &nfssvc_sockhead, ns_chain) {
|
||||||
if ((slp->ns_flag & (SLP_VALID | SLP_DOREC))
|
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)
|
if (slp == 0)
|
||||||
nfsd_head_flag &= ~NFSD_CHECKSLP;
|
nfsd_head_flag &= ~NFSD_CHECKSLP;
|
||||||
}
|
}
|
||||||
if ((slp = nfsd->nfsd_slp) == (struct nfssvc_sock *)0)
|
if ((slp = nfsd->nfsd_slp) == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (slp->ns_flag & SLP_VALID) {
|
if (slp->ns_flag & SLP_VALID) {
|
||||||
if (slp->ns_flag & SLP_DISCONN)
|
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);
|
free((caddr_t)nd, M_NFSRVDESC);
|
||||||
nd = NULL;
|
nd = NULL;
|
||||||
}
|
}
|
||||||
nfsd->nfsd_slp = (struct nfssvc_sock *)0;
|
nfsd->nfsd_slp = NULL;
|
||||||
nfsd->nfsd_flag &= ~NFSD_REQINPROG;
|
nfsd->nfsd_flag &= ~NFSD_REQINPROG;
|
||||||
nfsrv_slpderef(slp);
|
nfsrv_slpderef(slp);
|
||||||
continue;
|
continue;
|
||||||
@ -427,7 +427,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
|||||||
}
|
}
|
||||||
nfsrvstats.srvrpccnt[nd->nd_procnum]++;
|
nfsrvstats.srvrpccnt[nd->nd_procnum]++;
|
||||||
nfsrv_updatecache(nd, TRUE, mreq);
|
nfsrv_updatecache(nd, TRUE, mreq);
|
||||||
nd->nd_mrep = (struct mbuf *)0;
|
nd->nd_mrep = NULL;
|
||||||
case RC_REPLY:
|
case RC_REPLY:
|
||||||
m = mreq;
|
m = mreq;
|
||||||
siz = 0;
|
siz = 0;
|
||||||
@ -441,7 +441,7 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
|||||||
}
|
}
|
||||||
m = mreq;
|
m = mreq;
|
||||||
m->m_pkthdr.len = siz;
|
m->m_pkthdr.len = siz;
|
||||||
m->m_pkthdr.rcvif = (struct ifnet *)0;
|
m->m_pkthdr.rcvif = NULL;
|
||||||
/*
|
/*
|
||||||
* For stream protocols, prepend a Sun RPC
|
* For stream protocols, prepend a Sun RPC
|
||||||
* Record Mark.
|
* 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);
|
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
|
||||||
splx(s);
|
splx(s);
|
||||||
free((caddr_t)nfsd, M_NFSD);
|
free((caddr_t)nfsd, M_NFSD);
|
||||||
nsd->nsd_nfsd = (struct nfsd *)0;
|
nsd->nsd_nfsd = NULL;
|
||||||
if (--nfs_numnfsd == 0)
|
if (--nfs_numnfsd == 0)
|
||||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||||
return (error);
|
return (error);
|
||||||
@ -534,13 +534,13 @@ nfsrv_zapsock(struct nfssvc_sock *slp)
|
|||||||
slp->ns_flag &= ~SLP_ALLFLAGS;
|
slp->ns_flag &= ~SLP_ALLFLAGS;
|
||||||
fp = slp->ns_fp;
|
fp = slp->ns_fp;
|
||||||
if (fp) {
|
if (fp) {
|
||||||
slp->ns_fp = (struct file *)0;
|
slp->ns_fp = NULL;
|
||||||
so = slp->ns_so;
|
so = slp->ns_so;
|
||||||
so->so_rcv.sb_flags &= ~SB_UPCALL;
|
so->so_rcv.sb_flags &= ~SB_UPCALL;
|
||||||
so->so_upcall = NULL;
|
so->so_upcall = NULL;
|
||||||
so->so_upcallarg = NULL;
|
so->so_upcallarg = NULL;
|
||||||
soshutdown(so, 2);
|
soshutdown(so, 2);
|
||||||
closef(fp, (struct thread *)0);
|
closef(fp, NULL);
|
||||||
if (slp->ns_nam)
|
if (slp->ns_nam)
|
||||||
FREE(slp->ns_nam, M_SONAME);
|
FREE(slp->ns_nam, M_SONAME);
|
||||||
m_freem(slp->ns_raw);
|
m_freem(slp->ns_raw);
|
||||||
|
Loading…
Reference in New Issue
Block a user