|
|
|
@ -294,7 +294,7 @@ nfs3_access_otw(struct vnode *vp, int wmode, struct thread *td,
|
|
|
|
|
struct nfsnode *np = VTONFS(vp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_ACCESS]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + NFSX_UNSIGNED);
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED, M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -714,7 +714,7 @@ nfs_getattr(struct vop_getattr_args *ap)
|
|
|
|
|
goto nfsmout;
|
|
|
|
|
}
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_GETATTR]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -873,7 +873,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred)
|
|
|
|
|
int v3 = NFS_ISV3(vp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_SETATTR]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + NFSX_SATTR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -1037,8 +1037,8 @@ nfs_lookup(struct vop_lookup_args *ap)
|
|
|
|
|
nfsstats.lookupcache_misses++;
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_LOOKUP]++;
|
|
|
|
|
len = cnp->cn_namelen;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len), M_WAITOK,
|
|
|
|
|
MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -1251,7 +1251,7 @@ nfs_readlinkrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
|
|
|
|
|
int v3 = NFS_ISV3(vp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_READLINK]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -1306,8 +1306,8 @@ nfs_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
|
|
|
|
|
while (tsiz > 0) {
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_READ]++;
|
|
|
|
|
len = (tsiz > rsize) ? rsize : tsiz;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED * 3);
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED * 3, M_WAITOK,
|
|
|
|
|
MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -1379,8 +1379,8 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
|
|
|
|
|
while (tsiz > 0) {
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_WRITE]++;
|
|
|
|
|
len = (tsiz > wsize) ? wsize : tsiz;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len),
|
|
|
|
|
M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -1502,8 +1502,8 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|
|
|
|
if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0)
|
|
|
|
|
return (error);
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_MKNOD]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 4 * NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + 4 * NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -1606,8 +1606,8 @@ nfs_create(struct vop_create_args *ap)
|
|
|
|
|
fmode |= O_EXCL;
|
|
|
|
|
again:
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_CREATE]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 2 * NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + 2 * NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -1788,8 +1788,8 @@ nfs_removerpc(struct vnode *dvp, const char *name, int namelen,
|
|
|
|
|
int v3 = NFS_ISV3(dvp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_REMOVE]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen),
|
|
|
|
|
M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -1924,8 +1924,8 @@ nfs_renamerpc(struct vnode *fdvp, const char *fnameptr, int fnamelen,
|
|
|
|
|
int v3 = NFS_ISV3(fdvp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_RENAME]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, (NFSX_FH(v3) + NFSX_UNSIGNED)*2 +
|
|
|
|
|
nfsm_rndup(fnamelen) + nfsm_rndup(tnamelen));
|
|
|
|
|
mreq = m_get2((NFSX_FH(v3) + NFSX_UNSIGNED)*2 + nfsm_rndup(fnamelen) +
|
|
|
|
|
nfsm_rndup(tnamelen), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(fdvp, v3);
|
|
|
|
@ -1983,8 +1983,8 @@ nfs_link(struct vop_link_args *ap)
|
|
|
|
|
|
|
|
|
|
v3 = NFS_ISV3(vp);
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_LINK]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3)*2 + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3)*2 + NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -2029,8 +2029,9 @@ nfs_symlink(struct vop_symlink_args *ap)
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_SYMLINK]++;
|
|
|
|
|
slen = strlen(ap->a_target);
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 2*NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + 2*NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3),
|
|
|
|
|
M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -2123,8 +2124,8 @@ nfs_mkdir(struct vop_mkdir_args *ap)
|
|
|
|
|
return (error);
|
|
|
|
|
len = cnp->cn_namelen;
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_MKDIR]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) + NFSX_SATTR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) +
|
|
|
|
|
NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -2188,8 +2189,8 @@ nfs_rmdir(struct vop_rmdir_args *ap)
|
|
|
|
|
if (dvp == vp)
|
|
|
|
|
return (EINVAL);
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_RMDIR]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED +
|
|
|
|
|
nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -2307,8 +2308,8 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
|
|
|
|
|
*/
|
|
|
|
|
while (more_dirs && bigenough) {
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_READDIR]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_READDIR(v3));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_READDIR(v3), M_WAITOK,
|
|
|
|
|
MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, v3);
|
|
|
|
@ -2513,8 +2514,8 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
|
|
|
|
|
*/
|
|
|
|
|
while (more_dirs && bigenough) {
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_READDIRPLUS]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(1) + 6 * NFSX_UNSIGNED);
|
|
|
|
|
mreq = m_get2(NFSX_FH(1) + 6 * NFSX_UNSIGNED, M_WAITOK,
|
|
|
|
|
MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, 1);
|
|
|
|
@ -2818,8 +2819,8 @@ nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
|
|
|
|
|
int v3 = NFS_ISV3(dvp);
|
|
|
|
|
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_LOOKUP]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0,
|
|
|
|
|
NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
|
|
|
|
|
mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len),
|
|
|
|
|
M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(dvp, v3);
|
|
|
|
@ -2897,7 +2898,7 @@ nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred,
|
|
|
|
|
}
|
|
|
|
|
mtx_unlock(&nmp->nm_mtx);
|
|
|
|
|
nfsstats.rpccnt[NFSPROC_COMMIT]++;
|
|
|
|
|
mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(1));
|
|
|
|
|
mreq = m_get2(NFSX_FH(1), M_WAITOK, MT_DATA, 0);
|
|
|
|
|
mb = mreq;
|
|
|
|
|
bpos = mtod(mb, caddr_t);
|
|
|
|
|
nfsm_fhtom(vp, 1);
|
|
|
|
|