|
Lines 727-733
Link Here
|
| 727 |
if (v3) { |
727 |
if (v3) { |
| 728 |
nfsm_wcc_data(vp, wccflag); |
728 |
nfsm_wcc_data(vp, wccflag); |
| 729 |
} else |
729 |
} else |
| 730 |
nfsm_loadattr(vp, (struct vattr *)0); |
730 |
nfsm_loadattr(vp, NULL); |
| 731 |
m_freem(mrep); |
731 |
m_freem(mrep); |
| 732 |
nfsmout: |
732 |
nfsmout: |
| 733 |
return (error); |
733 |
return (error); |
|
Lines 865-871
Link Here
|
| 865 |
nfsm_postop_attr(newvp, attrflag); |
865 |
nfsm_postop_attr(newvp, attrflag); |
| 866 |
nfsm_postop_attr(dvp, attrflag); |
866 |
nfsm_postop_attr(dvp, attrflag); |
| 867 |
} else |
867 |
} else |
| 868 |
nfsm_loadattr(newvp, (struct vattr *)0); |
868 |
nfsm_loadattr(newvp, NULL); |
| 869 |
*vpp = newvp; |
869 |
*vpp = newvp; |
| 870 |
m_freem(mrep); |
870 |
m_freem(mrep); |
| 871 |
cnp->cn_flags |= SAVENAME; |
871 |
cnp->cn_flags |= SAVENAME; |
|
Lines 912-918
Link Here
|
| 912 |
nfsm_postop_attr(newvp, attrflag); |
912 |
nfsm_postop_attr(newvp, attrflag); |
| 913 |
nfsm_postop_attr(dvp, attrflag); |
913 |
nfsm_postop_attr(dvp, attrflag); |
| 914 |
} else |
914 |
} else |
| 915 |
nfsm_loadattr(newvp, (struct vattr *)0); |
915 |
nfsm_loadattr(newvp, NULL); |
| 916 |
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) |
916 |
if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) |
| 917 |
cnp->cn_flags |= SAVENAME; |
917 |
cnp->cn_flags |= SAVENAME; |
| 918 |
if ((cnp->cn_flags & MAKEENTRY) && |
918 |
if ((cnp->cn_flags & MAKEENTRY) && |
|
Lines 1053-1059
Link Here
|
| 1053 |
tl = nfsm_dissect(u_int32_t *, 2 * NFSX_UNSIGNED); |
1053 |
tl = nfsm_dissect(u_int32_t *, 2 * NFSX_UNSIGNED); |
| 1054 |
eof = fxdr_unsigned(int, *(tl + 1)); |
1054 |
eof = fxdr_unsigned(int, *(tl + 1)); |
| 1055 |
} else |
1055 |
} else |
| 1056 |
nfsm_loadattr(vp, (struct vattr *)0); |
1056 |
nfsm_loadattr(vp, NULL); |
| 1057 |
nfsm_strsiz(retlen, nmp->nm_rsize); |
1057 |
nfsm_strsiz(retlen, nmp->nm_rsize); |
| 1058 |
nfsm_mtouio(uiop, retlen); |
1058 |
nfsm_mtouio(uiop, retlen); |
| 1059 |
m_freem(mrep); |
1059 |
m_freem(mrep); |
|
Lines 1164-1170
Link Here
|
| 1164 |
} |
1164 |
} |
| 1165 |
} |
1165 |
} |
| 1166 |
} else |
1166 |
} else |
| 1167 |
nfsm_loadattr(vp, (struct vattr *)0); |
1167 |
nfsm_loadattr(vp, NULL); |
| 1168 |
if (wccflag) |
1168 |
if (wccflag) |
| 1169 |
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec; |
1169 |
VTONFS(vp)->n_mtime = VTONFS(vp)->n_vattr.va_mtime.tv_sec; |
| 1170 |
m_freem(mrep); |
1170 |
m_freem(mrep); |
|
Lines 1192-1199
Link Here
|
| 1192 |
{ |
1192 |
{ |
| 1193 |
struct nfsv2_sattr *sp; |
1193 |
struct nfsv2_sattr *sp; |
| 1194 |
u_int32_t *tl; |
1194 |
u_int32_t *tl; |
| 1195 |
struct vnode *newvp = (struct vnode *)0; |
1195 |
struct vnode *newvp = NULL; |
| 1196 |
struct nfsnode *np = (struct nfsnode *)0; |
1196 |
struct nfsnode *np = NULL; |
| 1197 |
struct vattr vattr; |
1197 |
struct vattr vattr; |
| 1198 |
caddr_t bpos, dpos; |
1198 |
caddr_t bpos, dpos; |
| 1199 |
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0; |
1199 |
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0; |
|
Lines 1242-1248
Link Here
|
| 1242 |
if (!gotvp) { |
1242 |
if (!gotvp) { |
| 1243 |
if (newvp) { |
1243 |
if (newvp) { |
| 1244 |
vput(newvp); |
1244 |
vput(newvp); |
| 1245 |
newvp = (struct vnode *)0; |
1245 |
newvp = NULL; |
| 1246 |
} |
1246 |
} |
| 1247 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, |
1247 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, |
| 1248 |
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np); |
1248 |
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np); |
|
Lines 1292-1299
Link Here
|
| 1292 |
struct componentname *cnp = ap->a_cnp; |
1292 |
struct componentname *cnp = ap->a_cnp; |
| 1293 |
struct nfsv2_sattr *sp; |
1293 |
struct nfsv2_sattr *sp; |
| 1294 |
u_int32_t *tl; |
1294 |
u_int32_t *tl; |
| 1295 |
struct nfsnode *np = (struct nfsnode *)0; |
1295 |
struct nfsnode *np = NULL; |
| 1296 |
struct vnode *newvp = (struct vnode *)0; |
1296 |
struct vnode *newvp = NULL; |
| 1297 |
caddr_t bpos, dpos; |
1297 |
caddr_t bpos, dpos; |
| 1298 |
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0; |
1298 |
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0; |
| 1299 |
struct mbuf *mreq, *mrep, *md, *mb; |
1299 |
struct mbuf *mreq, *mrep, *md, *mb; |
|
Lines 1350-1356
Link Here
|
| 1350 |
if (!gotvp) { |
1350 |
if (!gotvp) { |
| 1351 |
if (newvp) { |
1351 |
if (newvp) { |
| 1352 |
vput(newvp); |
1352 |
vput(newvp); |
| 1353 |
newvp = (struct vnode *)0; |
1353 |
newvp = NULL; |
| 1354 |
} |
1354 |
} |
| 1355 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, |
1355 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, |
| 1356 |
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np); |
1356 |
cnp->cn_namelen, cnp->cn_cred, cnp->cn_thread, &np); |
|
Lines 1466-1472
Link Here
|
| 1466 |
{ |
1466 |
{ |
| 1467 |
|
1467 |
|
| 1468 |
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred, |
1468 |
return (nfs_removerpc(sp->s_dvp, sp->s_name, sp->s_namlen, sp->s_cred, |
| 1469 |
(struct thread *)0)); |
1469 |
NULL)); |
| 1470 |
} |
1470 |
} |
| 1471 |
|
1471 |
|
| 1472 |
/* |
1472 |
/* |
|
Lines 1694-1700
Link Here
|
| 1694 |
caddr_t bpos, dpos; |
1694 |
caddr_t bpos, dpos; |
| 1695 |
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp; |
1695 |
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp; |
| 1696 |
struct mbuf *mreq, *mrep, *md, *mb; |
1696 |
struct mbuf *mreq, *mrep, *md, *mb; |
| 1697 |
struct vnode *newvp = (struct vnode *)0; |
1697 |
struct vnode *newvp = NULL; |
| 1698 |
int v3 = NFS_ISV3(dvp); |
1698 |
int v3 = NFS_ISV3(dvp); |
| 1699 |
|
1699 |
|
| 1700 |
nfsstats.rpccnt[NFSPROC_SYMLINK]++; |
1700 |
nfsstats.rpccnt[NFSPROC_SYMLINK]++; |
|
Lines 1784-1791
Link Here
|
| 1784 |
struct componentname *cnp = ap->a_cnp; |
1784 |
struct componentname *cnp = ap->a_cnp; |
| 1785 |
struct nfsv2_sattr *sp; |
1785 |
struct nfsv2_sattr *sp; |
| 1786 |
int len; |
1786 |
int len; |
| 1787 |
struct nfsnode *np = (struct nfsnode *)0; |
1787 |
struct nfsnode *np = NULL; |
| 1788 |
struct vnode *newvp = (struct vnode *)0; |
1788 |
struct vnode *newvp = NULL; |
| 1789 |
caddr_t bpos, dpos; |
1789 |
caddr_t bpos, dpos; |
| 1790 |
int error = 0, wccflag = NFSV3_WCCRATTR; |
1790 |
int error = 0, wccflag = NFSV3_WCCRATTR; |
| 1791 |
int gotvp = 0; |
1791 |
int gotvp = 0; |
|
Lines 1832-1838
Link Here
|
| 1832 |
if (error == EEXIST || (!error && !gotvp)) { |
1832 |
if (error == EEXIST || (!error && !gotvp)) { |
| 1833 |
if (newvp) { |
1833 |
if (newvp) { |
| 1834 |
vrele(newvp); |
1834 |
vrele(newvp); |
| 1835 |
newvp = (struct vnode *)0; |
1835 |
newvp = NULL; |
| 1836 |
} |
1836 |
} |
| 1837 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred, |
1837 |
error = nfs_lookitup(dvp, cnp->cn_nameptr, len, cnp->cn_cred, |
| 1838 |
cnp->cn_thread, &np); |
1838 |
cnp->cn_thread, &np); |
|
Lines 2138-2144
Link Here
|
| 2138 |
int attrflag, fhsize; |
2138 |
int attrflag, fhsize; |
| 2139 |
|
2139 |
|
| 2140 |
#ifndef nolint |
2140 |
#ifndef nolint |
| 2141 |
dp = (struct dirent *)0; |
2141 |
dp = NULL; |
| 2142 |
#endif |
2142 |
#endif |
| 2143 |
#ifndef DIAGNOSTIC |
2143 |
#ifndef DIAGNOSTIC |
| 2144 |
if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || |
2144 |
if (uiop->uio_iovcnt != 1 || (uiop->uio_offset & (DIRBLKSIZ - 1)) || |
|
Lines 2274-2280
Link Here
|
| 2274 |
dpos = dpossav1; |
2274 |
dpos = dpossav1; |
| 2275 |
mdsav2 = md; |
2275 |
mdsav2 = md; |
| 2276 |
md = mdsav1; |
2276 |
md = mdsav1; |
| 2277 |
nfsm_loadattr(newvp, (struct vattr *)0); |
2277 |
nfsm_loadattr(newvp, NULL); |
| 2278 |
dpos = dpossav2; |
2278 |
dpos = dpossav2; |
| 2279 |
md = mdsav2; |
2279 |
md = mdsav2; |
| 2280 |
dp->d_type = |
2280 |
dp->d_type = |
|
Lines 2377-2383
Link Here
|
| 2377 |
|
2377 |
|
| 2378 |
/* Try lookitups until we get one that isn't there */ |
2378 |
/* Try lookitups until we get one that isn't there */ |
| 2379 |
while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred, |
2379 |
while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred, |
| 2380 |
cnp->cn_thread, (struct nfsnode **)0) == 0) { |
2380 |
cnp->cn_thread, NULL) == 0) { |
| 2381 |
sp->s_name[4]++; |
2381 |
sp->s_name[4]++; |
| 2382 |
if (sp->s_name[4] > 'z') { |
2382 |
if (sp->s_name[4] > 'z') { |
| 2383 |
error = EINVAL; |
2383 |
error = EINVAL; |
|
Lines 2410-2416
Link Here
|
| 2410 |
nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred, |
2410 |
nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred, |
| 2411 |
struct thread *td, struct nfsnode **npp) |
2411 |
struct thread *td, struct nfsnode **npp) |
| 2412 |
{ |
2412 |
{ |
| 2413 |
struct vnode *newvp = (struct vnode *)0; |
2413 |
struct vnode *newvp = NULL; |
| 2414 |
struct nfsnode *np, *dnp = VTONFS(dvp); |
2414 |
struct nfsnode *np, *dnp = VTONFS(dvp); |
| 2415 |
caddr_t bpos, dpos; |
2415 |
caddr_t bpos, dpos; |
| 2416 |
int error = 0, fhlen, attrflag; |
2416 |
int error = 0, fhlen, attrflag; |
|
Lines 2460-2466
Link Here
|
| 2460 |
return (ENOENT); |
2460 |
return (ENOENT); |
| 2461 |
} |
2461 |
} |
| 2462 |
} else |
2462 |
} else |
| 2463 |
nfsm_loadattr(newvp, (struct vattr *)0); |
2463 |
nfsm_loadattr(newvp, NULL); |
| 2464 |
} |
2464 |
} |
| 2465 |
m_freem(mrep); |
2465 |
m_freem(mrep); |
| 2466 |
nfsmout: |
2466 |
nfsmout: |
|
Lines 2539-2545
Link Here
|
| 2539 |
panic("nfs physio"); |
2539 |
panic("nfs physio"); |
| 2540 |
|
2540 |
|
| 2541 |
if (bp->b_flags & B_ASYNC) |
2541 |
if (bp->b_flags & B_ASYNC) |
| 2542 |
td = (struct thread *)0; |
2542 |
td = NULL; |
| 2543 |
else |
2543 |
else |
| 2544 |
td = curthread; /* XXX */ |
2544 |
td = curthread; /* XXX */ |
| 2545 |
|
2545 |
|
|
Lines 2776-2782
Link Here
|
| 2776 |
panic("nfs_fsync: inconsistent lock"); |
2776 |
panic("nfs_fsync: inconsistent lock"); |
| 2777 |
if (error == ENOLCK) |
2777 |
if (error == ENOLCK) |
| 2778 |
goto loop; |
2778 |
goto loop; |
| 2779 |
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) { |
2779 |
if (nfs_sigintr(nmp, NULL, td)) { |
| 2780 |
error = EINTR; |
2780 |
error = EINTR; |
| 2781 |
goto done; |
2781 |
goto done; |
| 2782 |
} |
2782 |
} |
|
Lines 2812-2818
Link Here
|
| 2812 |
error = tsleep((caddr_t)&vp->v_numoutput, |
2812 |
error = tsleep((caddr_t)&vp->v_numoutput, |
| 2813 |
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo); |
2813 |
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo); |
| 2814 |
if (error) { |
2814 |
if (error) { |
| 2815 |
if (nfs_sigintr(nmp, (struct nfsreq *)0, td)) { |
2815 |
if (nfs_sigintr(nmp, NULL, td)) { |
| 2816 |
error = EINTR; |
2816 |
error = EINTR; |
| 2817 |
goto done; |
2817 |
goto done; |
| 2818 |
} |
2818 |
} |