Lines 239-245
nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T
Link Here
|
239 |
int error; |
239 |
int error; |
240 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
240 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
241 |
|
241 |
|
242 |
NFSCL_REQSTART(nd, NFSPROC_NULL, vp); |
242 |
NFSCL_REQSTART(nd, NFSPROC_NULL, vp, NULL); |
243 |
error = nfscl_request(nd, vp, p, cred, NULL); |
243 |
error = nfscl_request(nd, vp, p, cred, NULL); |
244 |
if (nd->nd_repstat && !error) |
244 |
if (nd->nd_repstat && !error) |
245 |
error = nd->nd_repstat; |
245 |
error = nd->nd_repstat; |
Lines 308-314
nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct uc
Link Here
|
308 |
|
308 |
|
309 |
*attrflagp = 0; |
309 |
*attrflagp = 0; |
310 |
supported = mode; |
310 |
supported = mode; |
311 |
NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp); |
311 |
NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp, cred); |
312 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
312 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
313 |
*tl = txdr_unsigned(mode); |
313 |
*tl = txdr_unsigned(mode); |
314 |
if (nd->nd_flag & ND_NFSV4) { |
314 |
if (nd->nd_flag & ND_NFSV4) { |
Lines 512-518
nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int
Link Here
|
512 |
|
512 |
|
513 |
dp = *dpp; |
513 |
dp = *dpp; |
514 |
*dpp = NULL; |
514 |
*dpp = NULL; |
515 |
nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0); |
515 |
nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0, |
|
|
516 |
cred); |
516 |
NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); |
517 |
NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); |
517 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
518 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
518 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
519 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
Lines 705-711
nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struc
Link Here
|
705 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
706 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
706 |
int error; |
707 |
int error; |
707 |
|
708 |
|
708 |
NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); |
709 |
NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp, cred); |
709 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); |
710 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); |
710 |
if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) |
711 |
if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) |
711 |
*tl++ = 0; |
712 |
*tl++ = 0; |
Lines 870-876
nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsm
Link Here
|
870 |
int error; |
871 |
int error; |
871 |
|
872 |
|
872 |
nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, |
873 |
nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, |
873 |
op->nfso_fhlen, NULL, NULL, 0, 0); |
874 |
op->nfso_fhlen, NULL, NULL, 0, 0, cred); |
874 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
875 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
875 |
if (NFSHASNFSV4N(nmp)) { |
876 |
if (NFSHASNFSV4N(nmp)) { |
876 |
*tl++ = 0; |
877 |
*tl++ = 0; |
Lines 916-922
nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhl
Link Here
|
916 |
if (NFSHASNFSV4N(nmp)) |
917 |
if (NFSHASNFSV4N(nmp)) |
917 |
return (0); /* No confirmation for NFSv4.1. */ |
918 |
return (0); /* No confirmation for NFSv4.1. */ |
918 |
nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, |
919 |
nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, |
919 |
0, 0); |
920 |
0, 0, NULL); |
920 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
921 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
921 |
*tl++ = op->nfso_stateid.seqid; |
922 |
*tl++ = op->nfso_stateid.seqid; |
922 |
*tl++ = op->nfso_stateid.other[0]; |
923 |
*tl++ = op->nfso_stateid.other[0]; |
Lines 987-993
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
987 |
dsp->nfsclds_sess.nfsess_clientid = |
988 |
dsp->nfsclds_sess.nfsess_clientid = |
988 |
odsp->nfsclds_sess.nfsess_clientid; |
989 |
odsp->nfsclds_sess.nfsess_clientid; |
989 |
dsp->nfsclds_sess.nfsess_sequenceid = |
990 |
dsp->nfsclds_sess.nfsess_sequenceid = |
990 |
odsp->nfsclds_sess.nfsess_sequenceid; |
991 |
odsp->nfsclds_sess.nfsess_sequenceid + 1; |
991 |
dsp->nfsclds_flags = odsp->nfsclds_flags; |
992 |
dsp->nfsclds_flags = odsp->nfsclds_flags; |
992 |
if (dsp->nfsclds_servownlen > 0) |
993 |
if (dsp->nfsclds_servownlen > 0) |
993 |
memcpy(dsp->nfsclds_serverown, |
994 |
memcpy(dsp->nfsclds_serverown, |
Lines 1061-1070
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
1061 |
*/ |
1062 |
*/ |
1062 |
tsep = NULL; |
1063 |
tsep = NULL; |
1063 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) { |
1064 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) { |
|
|
1065 |
/* |
1066 |
* Mark the old session defunct. Needed |
1067 |
* when called from nfscl_hasexpired(). |
1068 |
*/ |
1064 |
tsep = NFSMNT_MDSSESSION(nmp); |
1069 |
tsep = NFSMNT_MDSSESSION(nmp); |
1065 |
if (tsep->nfsess_defunct == 0) |
1070 |
tsep->nfsess_defunct = 1; |
1066 |
printf("nfsrpc_setclient: " |
|
|
1067 |
"nfsess_defunct not set\n"); |
1068 |
} |
1071 |
} |
1069 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
1072 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
1070 |
nfsclds_list); |
1073 |
nfsclds_list); |
Lines 1107-1113
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
1107 |
tsep = NFSMNT_MDSSESSION(nmp); |
1110 |
tsep = NFSMNT_MDSSESSION(nmp); |
1108 |
NFSUNLOCKMNT(nmp); |
1111 |
NFSUNLOCKMNT(nmp); |
1109 |
|
1112 |
|
1110 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0); |
1113 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0, |
|
|
1114 |
NULL); |
1111 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
1115 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
1112 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
1116 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
1113 |
*tl = txdr_unsigned(clp->nfsc_rev); |
1117 |
*tl = txdr_unsigned(clp->nfsc_rev); |
Lines 1177-1183
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
1177 |
* and confirm it. |
1181 |
* and confirm it. |
1178 |
*/ |
1182 |
*/ |
1179 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
1183 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
1180 |
NULL, 0, 0); |
1184 |
NULL, 0, 0, NULL); |
1181 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
1185 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
1182 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
1186 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
1183 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
1187 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
Lines 1208-1214
nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC
Link Here
|
1208 |
int error; |
1212 |
int error; |
1209 |
nfsattrbit_t attrbits; |
1213 |
nfsattrbit_t attrbits; |
1210 |
|
1214 |
|
1211 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
1215 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
1212 |
if (nd->nd_flag & ND_NFSV4) { |
1216 |
if (nd->nd_flag & ND_NFSV4) { |
1213 |
NFSGETATTR_ATTRBIT(&attrbits); |
1217 |
NFSGETATTR_ATTRBIT(&attrbits); |
1214 |
(void) nfsrv_putattrbit(nd, &attrbits); |
1218 |
(void) nfsrv_putattrbit(nd, &attrbits); |
Lines 1236-1242
nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp
Link Here
|
1236 |
int error, vers = NFS_VER2; |
1240 |
int error, vers = NFS_VER2; |
1237 |
nfsattrbit_t attrbits; |
1241 |
nfsattrbit_t attrbits; |
1238 |
|
1242 |
|
1239 |
nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0); |
1243 |
nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0, |
|
|
1244 |
cred); |
1240 |
if (nd->nd_flag & ND_NFSV4) { |
1245 |
if (nd->nd_flag & ND_NFSV4) { |
1241 |
vers = NFS_VER4; |
1246 |
vers = NFS_VER4; |
1242 |
NFSGETATTR_ATTRBIT(&attrbits); |
1247 |
NFSGETATTR_ATTRBIT(&attrbits); |
Lines 1334-1341
nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T
Link Here
|
1334 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1339 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1335 |
(void) nfs_catnap(PZERO, error, "nfs_setattr"); |
1340 |
(void) nfs_catnap(PZERO, error, "nfs_setattr"); |
1336 |
} else if ((error == NFSERR_EXPIRED || |
1341 |
} else if ((error == NFSERR_EXPIRED || |
1337 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
1342 |
((!NFSHASINT(nmp) || !NFSHASNFSV4N(nmp)) && |
|
|
1343 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
1338 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
1344 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
|
|
1345 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp) && |
1346 |
NFSHASNFSV4N(nmp)) { |
1347 |
error = EIO; |
1339 |
} |
1348 |
} |
1340 |
retrycnt++; |
1349 |
retrycnt++; |
1341 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
1350 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
Lines 1362-1368
nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap,
Link Here
|
1362 |
nfsattrbit_t attrbits; |
1371 |
nfsattrbit_t attrbits; |
1363 |
|
1372 |
|
1364 |
*attrflagp = 0; |
1373 |
*attrflagp = 0; |
1365 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); |
1374 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp, cred); |
1366 |
if (nd->nd_flag & ND_NFSV4) |
1375 |
if (nd->nd_flag & ND_NFSV4) |
1367 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1376 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1368 |
vap->va_type = vnode_vtype(vp); |
1377 |
vap->va_type = vnode_vtype(vp); |
Lines 1430-1438
nfsrpc_lookup(vnode_t dvp, char *name, int len, struct
Link Here
|
1430 |
if (NFSHASNFSV4(nmp) && len == 2 && |
1439 |
if (NFSHASNFSV4(nmp) && len == 2 && |
1431 |
name[0] == '.' && name[1] == '.') { |
1440 |
name[0] == '.' && name[1] == '.') { |
1432 |
lookupp = 1; |
1441 |
lookupp = 1; |
1433 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp); |
1442 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp, cred); |
1434 |
} else { |
1443 |
} else { |
1435 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp); |
1444 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp, cred); |
1436 |
(void) nfsm_strtom(nd, name, len); |
1445 |
(void) nfsm_strtom(nd, name, len); |
1437 |
} |
1446 |
} |
1438 |
if (nd->nd_flag & ND_NFSV4) { |
1447 |
if (nd->nd_flag & ND_NFSV4) { |
Lines 1508-1514
nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct u
Link Here
|
1508 |
int error, len, cangetattr = 1; |
1517 |
int error, len, cangetattr = 1; |
1509 |
|
1518 |
|
1510 |
*attrflagp = 0; |
1519 |
*attrflagp = 0; |
1511 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp); |
1520 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp, cred); |
1512 |
if (nd->nd_flag & ND_NFSV4) { |
1521 |
if (nd->nd_flag & ND_NFSV4) { |
1513 |
/* |
1522 |
/* |
1514 |
* And do a Getattr op. |
1523 |
* And do a Getattr op. |
Lines 1596-1603
nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred
Link Here
|
1596 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1605 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1597 |
(void) nfs_catnap(PZERO, error, "nfs_read"); |
1606 |
(void) nfs_catnap(PZERO, error, "nfs_read"); |
1598 |
} else if ((error == NFSERR_EXPIRED || |
1607 |
} else if ((error == NFSERR_EXPIRED || |
1599 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
1608 |
((!NFSHASINT(nmp) || !NFSHASNFSV4N(nmp)) && |
|
|
1609 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
1600 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
1610 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
|
|
1611 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp) && |
1612 |
NFSHASNFSV4N(nmp)) { |
1613 |
error = EIO; |
1601 |
} |
1614 |
} |
1602 |
retrycnt++; |
1615 |
retrycnt++; |
1603 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
1616 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
Lines 1644-1650
nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct uc
Link Here
|
1644 |
while (tsiz > 0) { |
1657 |
while (tsiz > 0) { |
1645 |
*attrflagp = 0; |
1658 |
*attrflagp = 0; |
1646 |
len = (tsiz > rsize) ? rsize : tsiz; |
1659 |
len = (tsiz > rsize) ? rsize : tsiz; |
1647 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp); |
1660 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp, cred); |
1648 |
if (nd->nd_flag & ND_NFSV4) |
1661 |
if (nd->nd_flag & ND_NFSV4) |
1649 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1662 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1650 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
1663 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
Lines 1768-1775
nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode
Link Here
|
1768 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1781 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
1769 |
(void) nfs_catnap(PZERO, error, "nfs_write"); |
1782 |
(void) nfs_catnap(PZERO, error, "nfs_write"); |
1770 |
} else if ((error == NFSERR_EXPIRED || |
1783 |
} else if ((error == NFSERR_EXPIRED || |
1771 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
1784 |
((!NFSHASINT(nmp) || !NFSHASNFSV4N(nmp)) && |
|
|
1785 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
1772 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
1786 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
|
|
1787 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp) && |
1788 |
NFSHASNFSV4N(nmp)) { |
1789 |
error = EIO; |
1773 |
} |
1790 |
} |
1774 |
retrycnt++; |
1791 |
retrycnt++; |
1775 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
1792 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
Lines 1828-1836
nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iom
Link Here
|
1828 |
*attrflagp = 0; |
1845 |
*attrflagp = 0; |
1829 |
len = (tsiz > wsize) ? wsize : tsiz; |
1846 |
len = (tsiz > wsize) ? wsize : tsiz; |
1830 |
if (do_append) |
1847 |
if (do_append) |
1831 |
NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp); |
1848 |
NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp, cred); |
1832 |
else |
1849 |
else |
1833 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp); |
1850 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp, cred); |
1834 |
if (nd->nd_flag & ND_NFSV4) { |
1851 |
if (nd->nd_flag & ND_NFSV4) { |
1835 |
if (do_append) { |
1852 |
if (do_append) { |
1836 |
NFSZERO_ATTRBIT(&attrbits); |
1853 |
NFSZERO_ATTRBIT(&attrbits); |
Lines 2035-2041
nfsrpc_mknod(vnode_t dvp, char *name, int namelen, str
Link Here
|
2035 |
*dattrflagp = 0; |
2052 |
*dattrflagp = 0; |
2036 |
if (namelen > NFS_MAXNAMLEN) |
2053 |
if (namelen > NFS_MAXNAMLEN) |
2037 |
return (ENAMETOOLONG); |
2054 |
return (ENAMETOOLONG); |
2038 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); |
2055 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp, cred); |
2039 |
if (nd->nd_flag & ND_NFSV4) { |
2056 |
if (nd->nd_flag & ND_NFSV4) { |
2040 |
if (vtyp == VBLK || vtyp == VCHR) { |
2057 |
if (vtyp == VBLK || vtyp == VCHR) { |
2041 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
2058 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
Lines 2185-2191
nfsrpc_createv23(vnode_t dvp, char *name, int namelen,
Link Here
|
2185 |
*dattrflagp = 0; |
2202 |
*dattrflagp = 0; |
2186 |
if (namelen > NFS_MAXNAMLEN) |
2203 |
if (namelen > NFS_MAXNAMLEN) |
2187 |
return (ENAMETOOLONG); |
2204 |
return (ENAMETOOLONG); |
2188 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2205 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
2189 |
(void) nfsm_strtom(nd, name, namelen); |
2206 |
(void) nfsm_strtom(nd, name, namelen); |
2190 |
if (nd->nd_flag & ND_NFSV3) { |
2207 |
if (nd->nd_flag & ND_NFSV3) { |
2191 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2208 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
Lines 2247-2253
nfsrpc_createv4(vnode_t dvp, char *name, int namelen,
Link Here
|
2247 |
*dattrflagp = 0; |
2264 |
*dattrflagp = 0; |
2248 |
if (namelen > NFS_MAXNAMLEN) |
2265 |
if (namelen > NFS_MAXNAMLEN) |
2249 |
return (ENAMETOOLONG); |
2266 |
return (ENAMETOOLONG); |
2250 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2267 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
2251 |
/* |
2268 |
/* |
2252 |
* For V4, this is actually an Open op. |
2269 |
* For V4, this is actually an Open op. |
2253 |
*/ |
2270 |
*/ |
Lines 2488-2494
tryagain:
Link Here
|
2488 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
2505 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
2489 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
2506 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
2490 |
if (ret == 1) { |
2507 |
if (ret == 1) { |
2491 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp); |
2508 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp, cred); |
2492 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
2509 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
2493 |
NFSX_UNSIGNED); |
2510 |
NFSX_UNSIGNED); |
2494 |
if (NFSHASNFSV4N(nmp)) |
2511 |
if (NFSHASNFSV4N(nmp)) |
Lines 2509-2515
tryagain:
Link Here
|
2509 |
ret = 0; |
2526 |
ret = 0; |
2510 |
} |
2527 |
} |
2511 |
if (ret == 0) |
2528 |
if (ret == 0) |
2512 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp); |
2529 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp, cred); |
2513 |
(void) nfsm_strtom(nd, name, namelen); |
2530 |
(void) nfsm_strtom(nd, name, namelen); |
2514 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2531 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2515 |
if (error) |
2532 |
if (error) |
Lines 2569-2579
tryagain:
Link Here
|
2569 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
2586 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
2570 |
&tdstateid, &gottd, p); |
2587 |
&tdstateid, &gottd, p); |
2571 |
if (gotfd && gottd) { |
2588 |
if (gotfd && gottd) { |
2572 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp); |
2589 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp, cred); |
2573 |
} else if (gotfd) { |
2590 |
} else if (gotfd) { |
2574 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp); |
2591 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp, cred); |
2575 |
} else if (gottd) { |
2592 |
} else if (gottd) { |
2576 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp); |
2593 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp, cred); |
2577 |
} |
2594 |
} |
2578 |
if (gotfd) { |
2595 |
if (gotfd) { |
2579 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
2596 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
Lines 2617-2623
tryagain:
Link Here
|
2617 |
ret = 0; |
2634 |
ret = 0; |
2618 |
} |
2635 |
} |
2619 |
if (ret == 0) |
2636 |
if (ret == 0) |
2620 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp); |
2637 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp, cred); |
2621 |
if (nd->nd_flag & ND_NFSV4) { |
2638 |
if (nd->nd_flag & ND_NFSV4) { |
2622 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2639 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2623 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
2640 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
Lines 2716-2722
nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int n
Link Here
|
2716 |
*dattrflagp = 0; |
2733 |
*dattrflagp = 0; |
2717 |
if (namelen > NFS_MAXNAMLEN) |
2734 |
if (namelen > NFS_MAXNAMLEN) |
2718 |
return (ENAMETOOLONG); |
2735 |
return (ENAMETOOLONG); |
2719 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp); |
2736 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp, cred); |
2720 |
if (nd->nd_flag & ND_NFSV4) { |
2737 |
if (nd->nd_flag & ND_NFSV4) { |
2721 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2738 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2722 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
2739 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
Lines 2783-2789
nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c
Link Here
|
2783 |
slen = strlen(target); |
2800 |
slen = strlen(target); |
2784 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
2801 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
2785 |
return (ENAMETOOLONG); |
2802 |
return (ENAMETOOLONG); |
2786 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp); |
2803 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp, cred); |
2787 |
if (nd->nd_flag & ND_NFSV4) { |
2804 |
if (nd->nd_flag & ND_NFSV4) { |
2788 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2805 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2789 |
*tl = txdr_unsigned(NFLNK); |
2806 |
*tl = txdr_unsigned(NFLNK); |
Lines 2846-2852
nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
2846 |
fhp = VTONFS(dvp)->n_fhp; |
2863 |
fhp = VTONFS(dvp)->n_fhp; |
2847 |
if (namelen > NFS_MAXNAMLEN) |
2864 |
if (namelen > NFS_MAXNAMLEN) |
2848 |
return (ENAMETOOLONG); |
2865 |
return (ENAMETOOLONG); |
2849 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); |
2866 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp, cred); |
2850 |
if (nd->nd_flag & ND_NFSV4) { |
2867 |
if (nd->nd_flag & ND_NFSV4) { |
2851 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2868 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2852 |
*tl = txdr_unsigned(NFDIR); |
2869 |
*tl = txdr_unsigned(NFDIR); |
Lines 2918-2924
nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
2918 |
*dattrflagp = 0; |
2935 |
*dattrflagp = 0; |
2919 |
if (namelen > NFS_MAXNAMLEN) |
2936 |
if (namelen > NFS_MAXNAMLEN) |
2920 |
return (ENAMETOOLONG); |
2937 |
return (ENAMETOOLONG); |
2921 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp); |
2938 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp, cred); |
2922 |
(void) nfsm_strtom(nd, name, namelen); |
2939 |
(void) nfsm_strtom(nd, name, namelen); |
2923 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2940 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2924 |
if (error) |
2941 |
if (error) |
Lines 3035-3041
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
3035 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3052 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3036 |
*/ |
3053 |
*/ |
3037 |
if (uiop->uio_offset == 0) { |
3054 |
if (uiop->uio_offset == 0) { |
3038 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
3055 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
3039 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3056 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3040 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3057 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3041 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3058 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
Lines 3152-3158
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
3152 |
*/ |
3169 |
*/ |
3153 |
while (more_dirs && bigenough) { |
3170 |
while (more_dirs && bigenough) { |
3154 |
*attrflagp = 0; |
3171 |
*attrflagp = 0; |
3155 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp); |
3172 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp, cred); |
3156 |
if (nd->nd_flag & ND_NFSV2) { |
3173 |
if (nd->nd_flag & ND_NFSV2) { |
3157 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3174 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3158 |
*tl++ = cookie.lval[1]; |
3175 |
*tl++ = cookie.lval[1]; |
Lines 3479-3485
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
3479 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3496 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3480 |
*/ |
3497 |
*/ |
3481 |
if (uiop->uio_offset == 0) { |
3498 |
if (uiop->uio_offset == 0) { |
3482 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
3499 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
3483 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3500 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3484 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3501 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3485 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3502 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
Lines 3601-3607
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
3601 |
*/ |
3618 |
*/ |
3602 |
while (more_dirs && bigenough) { |
3619 |
while (more_dirs && bigenough) { |
3603 |
*attrflagp = 0; |
3620 |
*attrflagp = 0; |
3604 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp); |
3621 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp, cred); |
3605 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
3622 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
3606 |
*tl++ = cookie.lval[0]; |
3623 |
*tl++ = cookie.lval[0]; |
3607 |
*tl++ = cookie.lval[1]; |
3624 |
*tl++ = cookie.lval[1]; |
Lines 3957-3963
nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, st
Link Here
|
3957 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
3974 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
3958 |
|
3975 |
|
3959 |
*attrflagp = 0; |
3976 |
*attrflagp = 0; |
3960 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); |
3977 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp, cred); |
3961 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
3978 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
3962 |
txdr_hyper(offset, tl); |
3979 |
txdr_hyper(offset, tl); |
3963 |
tl += 2; |
3980 |
tl += 2; |
Lines 4177-4183
nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp,
Link Here
|
4177 |
struct nfsclsession *tsep; |
4194 |
struct nfsclsession *tsep; |
4178 |
|
4195 |
|
4179 |
nmp = VFSTONFS(vp->v_mount); |
4196 |
nmp = VFSTONFS(vp->v_mount); |
4180 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp); |
4197 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp, cred); |
4181 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4198 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4182 |
if (fl->l_type == F_RDLCK) |
4199 |
if (fl->l_type == F_RDLCK) |
4183 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4200 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
Lines 4248-4254
nfsrpc_locku(struct nfsrv_descript *nd, struct nfsmoun
Link Here
|
4248 |
int error; |
4265 |
int error; |
4249 |
|
4266 |
|
4250 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
4267 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
4251 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0); |
4268 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0, cred); |
4252 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
4269 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
4253 |
*tl++ = txdr_unsigned(type); |
4270 |
*tl++ = txdr_unsigned(type); |
4254 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
4271 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
Lines 4300-4306
nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount
Link Here
|
4300 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
4317 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
4301 |
struct nfsclsession *tsep; |
4318 |
struct nfsclsession *tsep; |
4302 |
|
4319 |
|
4303 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0); |
4320 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0, |
|
|
4321 |
cred); |
4304 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4322 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4305 |
if (type == F_RDLCK) |
4323 |
if (type == F_RDLCK) |
4306 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4324 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
Lines 4395-4401
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
4395 |
/* |
4413 |
/* |
4396 |
* For V4, you actually do a getattr. |
4414 |
* For V4, you actually do a getattr. |
4397 |
*/ |
4415 |
*/ |
4398 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4416 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
4399 |
NFSSTATFS_GETATTRBIT(&attrbits); |
4417 |
NFSSTATFS_GETATTRBIT(&attrbits); |
4400 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4418 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4401 |
nd->nd_flag |= ND_USEGSSNAME; |
4419 |
nd->nd_flag |= ND_USEGSSNAME; |
Lines 4418-4424
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
4418 |
if (error) |
4436 |
if (error) |
4419 |
goto nfsmout; |
4437 |
goto nfsmout; |
4420 |
} else { |
4438 |
} else { |
4421 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp); |
4439 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp, NULL); |
4422 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4440 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4423 |
if (error) |
4441 |
if (error) |
4424 |
return (error); |
4442 |
return (error); |
Lines 4474-4480
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
4474 |
/* |
4492 |
/* |
4475 |
* For V4, you actually do a getattr. |
4493 |
* For V4, you actually do a getattr. |
4476 |
*/ |
4494 |
*/ |
4477 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4495 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
4478 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
4496 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
4479 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4497 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4480 |
nd->nd_flag |= ND_USEGSSNAME; |
4498 |
nd->nd_flag |= ND_USEGSSNAME; |
Lines 4491-4497
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
4491 |
error = nd->nd_repstat; |
4509 |
error = nd->nd_repstat; |
4492 |
} |
4510 |
} |
4493 |
} else { |
4511 |
} else { |
4494 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp); |
4512 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp, NULL); |
4495 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4513 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4496 |
if (error) |
4514 |
if (error) |
4497 |
return (error); |
4515 |
return (error); |
Lines 4527-4533
nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struc
Link Here
|
4527 |
int error; |
4545 |
int error; |
4528 |
|
4546 |
|
4529 |
*attrflagp = 0; |
4547 |
*attrflagp = 0; |
4530 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp); |
4548 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp, NULL); |
4531 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4549 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4532 |
if (error) |
4550 |
if (error) |
4533 |
return (error); |
4551 |
return (error); |
Lines 4574-4583
nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *
Link Here
|
4574 |
return (0); |
4592 |
return (0); |
4575 |
if (dsp == NULL) |
4593 |
if (dsp == NULL) |
4576 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
4594 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
4577 |
0); |
4595 |
0, cred); |
4578 |
else |
4596 |
else |
4579 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
4597 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
4580 |
&dsp->nfsclds_sess, 0, 0); |
4598 |
&dsp->nfsclds_sess, 0, 0, NULL); |
4581 |
if (!NFSHASNFSV4N(nmp)) { |
4599 |
if (!NFSHASNFSV4N(nmp)) { |
4582 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
4600 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
4583 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4601 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
Lines 4624-4634
nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo
Link Here
|
4624 |
if (NFSHASNFSV4N(nmp)) { |
4642 |
if (NFSHASNFSV4N(nmp)) { |
4625 |
/* For NFSv4.1, do a FreeStateID. */ |
4643 |
/* For NFSv4.1, do a FreeStateID. */ |
4626 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
4644 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
4627 |
NULL, 0, 0); |
4645 |
NULL, 0, 0, cred); |
4628 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
4646 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
4629 |
} else { |
4647 |
} else { |
4630 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
4648 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
4631 |
NULL, 0, 0); |
4649 |
NULL, 0, 0, NULL); |
4632 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4650 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4633 |
tsep = nfsmnt_mdssession(nmp); |
4651 |
tsep = nfsmnt_mdssession(nmp); |
4634 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
4652 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
Lines 4662-4668
nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpat
Link Here
|
4662 |
u_int32_t *opcntp; |
4680 |
u_int32_t *opcntp; |
4663 |
|
4681 |
|
4664 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
4682 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
4665 |
0); |
4683 |
0, NULL); |
4666 |
cp = dirpath; |
4684 |
cp = dirpath; |
4667 |
cnt = 0; |
4685 |
cnt = 0; |
4668 |
do { |
4686 |
do { |
Lines 4729-4735
nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred
Link Here
|
4729 |
int error; |
4747 |
int error; |
4730 |
|
4748 |
|
4731 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
4749 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
4732 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0); |
4750 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0, cred); |
4733 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
4751 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
4734 |
if (NFSHASNFSV4N(nmp)) |
4752 |
if (NFSHASNFSV4N(nmp)) |
4735 |
*tl++ = 0; |
4753 |
*tl++ = 0; |
Lines 4763-4769
nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_
Link Here
|
4763 |
|
4781 |
|
4764 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
4782 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
4765 |
return (EOPNOTSUPP); |
4783 |
return (EOPNOTSUPP); |
4766 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp); |
4784 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp, cred); |
4767 |
NFSZERO_ATTRBIT(&attrbits); |
4785 |
NFSZERO_ATTRBIT(&attrbits); |
4768 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
4786 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
4769 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4787 |
(void) nfsrv_putattrbit(nd, &attrbits); |
Lines 4809-4815
nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR
Link Here
|
4809 |
|
4827 |
|
4810 |
if (!NFSHASNFSV4(nmp)) |
4828 |
if (!NFSHASNFSV4(nmp)) |
4811 |
return (EOPNOTSUPP); |
4829 |
return (EOPNOTSUPP); |
4812 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp); |
4830 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp, cred); |
4813 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
4831 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
4814 |
NFSZERO_ATTRBIT(&attrbits); |
4832 |
NFSZERO_ATTRBIT(&attrbits); |
4815 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
4833 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
Lines 4842-4848
nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl
Link Here
|
4842 |
if (minorvers == 0) |
4860 |
if (minorvers == 0) |
4843 |
minorvers = nmp->nm_minorvers; |
4861 |
minorvers = nmp->nm_minorvers; |
4844 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
4862 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
4845 |
NFS_VER4, minorvers); |
4863 |
NFS_VER4, minorvers, NULL); |
4846 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
4864 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
4847 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
4865 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
4848 |
*tl = txdr_unsigned(clp->nfsc_rev); |
4866 |
*tl = txdr_unsigned(clp->nfsc_rev); |
Lines 4938-4944
nfsrpc_createsession(struct nfsmount *nmp, struct nfsc
Link Here
|
4938 |
else |
4956 |
else |
4939 |
minorvers = NFSV41_MINORVERSION; |
4957 |
minorvers = NFSV41_MINORVERSION; |
4940 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
4958 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
4941 |
NFS_VER4, minorvers); |
4959 |
NFS_VER4, minorvers, NULL); |
4942 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
4960 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
4943 |
*tl++ = sep->nfsess_clientid.lval[0]; |
4961 |
*tl++ = sep->nfsess_clientid.lval[0]; |
4944 |
*tl++ = sep->nfsess_clientid.lval[1]; |
4962 |
*tl++ = sep->nfsess_clientid.lval[1]; |
Lines 5056-5089
nfsmout:
Link Here
|
5056 |
} |
5074 |
} |
5057 |
|
5075 |
|
5058 |
/* |
5076 |
/* |
5059 |
* Do the NFSv4.1 Destroy Session. |
|
|
5060 |
*/ |
5061 |
int |
5062 |
nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp, |
5063 |
struct ucred *cred, NFSPROC_T *p) |
5064 |
{ |
5065 |
uint32_t *tl; |
5066 |
struct nfsrv_descript nfsd; |
5067 |
struct nfsrv_descript *nd = &nfsd; |
5068 |
int error; |
5069 |
struct nfsclsession *tsep; |
5070 |
|
5071 |
nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, |
5072 |
0); |
5073 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); |
5074 |
tsep = nfsmnt_mdssession(nmp); |
5075 |
bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); |
5076 |
nd->nd_flag |= ND_USEGSSNAME; |
5077 |
error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, |
5078 |
NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); |
5079 |
if (error != 0) |
5080 |
return (error); |
5081 |
error = nd->nd_repstat; |
5082 |
m_freem(nd->nd_mrep); |
5083 |
return (error); |
5084 |
} |
5085 |
|
5086 |
/* |
5087 |
* Do the NFSv4.1 Destroy Client. |
5077 |
* Do the NFSv4.1 Destroy Client. |
5088 |
*/ |
5078 |
*/ |
5089 |
int |
5079 |
int |
Lines 5097-5103
nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc
Link Here
|
5097 |
struct nfsclsession *tsep; |
5087 |
struct nfsclsession *tsep; |
5098 |
|
5088 |
|
5099 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
5089 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
5100 |
0); |
5090 |
0, NULL); |
5101 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
5091 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
5102 |
tsep = nfsmnt_mdssession(nmp); |
5092 |
tsep = nfsmnt_mdssession(nmp); |
5103 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
5093 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
Lines 5126-5132
nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i
Link Here
|
5126 |
int error; |
5116 |
int error; |
5127 |
|
5117 |
|
5128 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
5118 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
5129 |
0); |
5119 |
0, cred); |
5130 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
5120 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
5131 |
layouttype, layoutlen, 0); |
5121 |
layouttype, layoutlen, 0); |
5132 |
nd->nd_flag |= ND_USEGSSNAME; |
5122 |
nd->nd_flag |= ND_USEGSSNAME; |
Lines 5170-5176
nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de
Link Here
|
5170 |
ndi = NULL; |
5160 |
ndi = NULL; |
5171 |
gotdspp = NULL; |
5161 |
gotdspp = NULL; |
5172 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
5162 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
5173 |
0); |
5163 |
0, cred); |
5174 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5164 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5175 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
5165 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
5176 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
5166 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
Lines 5391-5397
nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
5391 |
int error; |
5381 |
int error; |
5392 |
|
5382 |
|
5393 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
5383 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
5394 |
0, 0); |
5384 |
0, 0, cred); |
5395 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
5385 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
5396 |
NFSX_STATEID); |
5386 |
NFSX_STATEID); |
5397 |
txdr_hyper(off, tl); |
5387 |
txdr_hyper(off, tl); |
Lines 5442-5448
nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
5442 |
int error; |
5432 |
int error; |
5443 |
|
5433 |
|
5444 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
5434 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
5445 |
0, 0); |
5435 |
0, 0, cred); |
5446 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
5436 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
5447 |
if (reclaim != 0) |
5437 |
if (reclaim != 0) |
5448 |
*tl++ = newnfs_true; |
5438 |
*tl++ = newnfs_true; |
Lines 5528-5534
nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
5528 |
int error; |
5518 |
int error; |
5529 |
|
5519 |
|
5530 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
5520 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
5531 |
0, 0); |
5521 |
0, 0, cred); |
5532 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
5522 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
5533 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5523 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5534 |
txdr_hyper(offset, tl); tl += 2; |
5524 |
txdr_hyper(offset, tl); tl += 2; |
Lines 5837-5843
nfsrpc_reclaimcomplete(struct nfsmount *nmp, struct uc
Link Here
|
5837 |
int error; |
5827 |
int error; |
5838 |
|
5828 |
|
5839 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
5829 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
5840 |
0); |
5830 |
0, cred); |
5841 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
5831 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
5842 |
*tl = newnfs_false; |
5832 |
*tl = newnfs_false; |
5843 |
nd->nd_flag |= ND_USEGSSNAME; |
5833 |
nd->nd_flag |= ND_USEGSSNAME; |
Lines 5866-5871
nfscl_initsessionslots(struct nfsclsession *sep)
Link Here
|
5866 |
for (i = 0; i < 64; i++) |
5856 |
for (i = 0; i < 64; i++) |
5867 |
sep->nfsess_slotseq[i] = 0; |
5857 |
sep->nfsess_slotseq[i] = 0; |
5868 |
sep->nfsess_slots = 0; |
5858 |
sep->nfsess_slots = 0; |
|
|
5859 |
sep->nfsess_badslots = 0; |
5869 |
} |
5860 |
} |
5870 |
|
5861 |
|
5871 |
/* |
5862 |
/* |
Lines 6460-6466
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
6460 |
nd->nd_mrep = NULL; |
6451 |
nd->nd_mrep = NULL; |
6461 |
if (vers == 0 || vers == NFS_VER4) { |
6452 |
if (vers == 0 || vers == NFS_VER4) { |
6462 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
6453 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
6463 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6454 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6455 |
NULL); |
6464 |
vers = NFS_VER4; |
6456 |
vers = NFS_VER4; |
6465 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
6457 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
6466 |
if (flex != 0) |
6458 |
if (flex != 0) |
Lines 6469-6475
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
6469 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
6461 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
6470 |
} else { |
6462 |
} else { |
6471 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
6463 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
6472 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6464 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6465 |
NULL); |
6473 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
6466 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
6474 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
6467 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
6475 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
6468 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
Lines 6536-6542
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
6536 |
nd->nd_mrep = NULL; |
6529 |
nd->nd_mrep = NULL; |
6537 |
if (vers == 0 || vers == NFS_VER4) { |
6530 |
if (vers == 0 || vers == NFS_VER4) { |
6538 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6531 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6539 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6532 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6533 |
NULL); |
6540 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
6534 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
6541 |
vers = NFS_VER4; |
6535 |
vers = NFS_VER4; |
6542 |
if (flex != 0) |
6536 |
if (flex != 0) |
Lines 6546-6552
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
6546 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6540 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6547 |
} else { |
6541 |
} else { |
6548 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6542 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6549 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6543 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6544 |
NULL); |
6550 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6545 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6551 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6546 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6552 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
6547 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
Lines 6669-6675
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
6669 |
nd->nd_mrep = NULL; |
6664 |
nd->nd_mrep = NULL; |
6670 |
if (vers == 0 || vers == NFS_VER4) { |
6665 |
if (vers == 0 || vers == NFS_VER4) { |
6671 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6666 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6672 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6667 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6668 |
NULL); |
6673 |
vers = NFS_VER4; |
6669 |
vers = NFS_VER4; |
6674 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
6670 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
6675 |
minorvers); |
6671 |
minorvers); |
Lines 6677-6683
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
6677 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6673 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6678 |
} else { |
6674 |
} else { |
6679 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6675 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6680 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6676 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6677 |
NULL); |
6681 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6678 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6682 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6679 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6683 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
6680 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
Lines 6897-6907
nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
6897 |
nd->nd_mrep = NULL; |
6894 |
nd->nd_mrep = NULL; |
6898 |
if (vers == 0 || vers == NFS_VER4) { |
6895 |
if (vers == 0 || vers == NFS_VER4) { |
6899 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
6896 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
6900 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6897 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6898 |
NULL); |
6901 |
vers = NFS_VER4; |
6899 |
vers = NFS_VER4; |
6902 |
} else { |
6900 |
} else { |
6903 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
6901 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
6904 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6902 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6903 |
NULL); |
6905 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
6904 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
6906 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
6905 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
6907 |
} |
6906 |
} |
Lines 7016-7022
nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt,
Link Here
|
7016 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
7015 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
7017 |
else |
7016 |
else |
7018 |
return (0); |
7017 |
return (0); |
7019 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp); |
7018 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp, cred); |
7020 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
7019 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
7021 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
7020 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
7022 |
txdr_hyper(offset, tl); |
7021 |
txdr_hyper(offset, tl); |
Lines 7060-7066
nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
7060 |
return (0); |
7059 |
return (0); |
7061 |
nd->nd_mrep = NULL; |
7060 |
nd->nd_mrep = NULL; |
7062 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
7061 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
7063 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
7062 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, NULL); |
7064 |
vers = NFS_VER4; |
7063 |
vers = NFS_VER4; |
7065 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
7064 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
7066 |
minorvers); |
7065 |
minorvers); |
Lines 7199-7207
nfsrpc_allocate(vnode_t vp, off_t off, off_t len, stru
Link Here
|
7199 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
7198 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
7200 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
7199 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
7201 |
(void) nfs_catnap(PZERO, error, "nfs_allocate"); |
7200 |
(void) nfs_catnap(PZERO, error, "nfs_allocate"); |
7202 |
} else if ((error == NFSERR_EXPIRED || |
7201 |
} else if ((error == NFSERR_EXPIRED || (!NFSHASINT(nmp) && |
7203 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
7202 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
7204 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
7203 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, p); |
|
|
7204 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp)) { |
7205 |
error = EIO; |
7205 |
} |
7206 |
} |
7206 |
retrycnt++; |
7207 |
retrycnt++; |
7207 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
7208 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
Lines 7230-7236
nfsrpc_allocaterpc(vnode_t vp, off_t off, off_t len, n
Link Here
|
7230 |
nfsattrbit_t attrbits; |
7231 |
nfsattrbit_t attrbits; |
7231 |
|
7232 |
|
7232 |
*attrflagp = 0; |
7233 |
*attrflagp = 0; |
7233 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp); |
7234 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp, cred); |
7234 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
7235 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
7235 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
7236 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
7236 |
txdr_hyper(off, tl); tl += 2; |
7237 |
txdr_hyper(off, tl); tl += 2; |
Lines 7718-7724
nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp,
Link Here
|
7718 |
*dpp = NULL; |
7719 |
*dpp = NULL; |
7719 |
*laystatp = ENXIO; |
7720 |
*laystatp = ENXIO; |
7720 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
7721 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
7721 |
0, 0); |
7722 |
0, 0, cred); |
7722 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
7723 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
7723 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
7724 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
7724 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
7725 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
Lines 7903-7909
nfsrpc_createlayout(vnode_t dvp, char *name, int namel
Link Here
|
7903 |
*dattrflagp = 0; |
7904 |
*dattrflagp = 0; |
7904 |
if (namelen > NFS_MAXNAMLEN) |
7905 |
if (namelen > NFS_MAXNAMLEN) |
7905 |
return (ENAMETOOLONG); |
7906 |
return (ENAMETOOLONG); |
7906 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp); |
7907 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp, cred); |
7907 |
/* |
7908 |
/* |
7908 |
* For V4, this is actually an Open op. |
7909 |
* For V4, this is actually an Open op. |
7909 |
*/ |
7910 |
*/ |
Lines 8300-8309
nfsrpc_copy_file_range(vnode_t invp, off_t *inoffp, vn
Link Here
|
8300 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
8301 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
8301 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
8302 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
8302 |
(void) nfs_catnap(PZERO, error, "nfs_cfr"); |
8303 |
(void) nfs_catnap(PZERO, error, "nfs_cfr"); |
8303 |
} else if ((error == NFSERR_EXPIRED || |
8304 |
} else if ((error == NFSERR_EXPIRED || (!NFSHASINT(nmp) && |
8304 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
8305 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
8305 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, |
8306 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, |
8306 |
curthread); |
8307 |
curthread); |
|
|
8308 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp)) { |
8309 |
error = EIO; |
8307 |
} |
8310 |
} |
8308 |
retrycnt++; |
8311 |
retrycnt++; |
8309 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
8312 |
} while (error == NFSERR_GRACE || error == NFSERR_DELAY || |
Lines 8344-8350
nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outv
Link Here
|
8344 |
*lenp = 0; |
8347 |
*lenp = 0; |
8345 |
if (len > nfs_maxcopyrange) |
8348 |
if (len > nfs_maxcopyrange) |
8346 |
len = nfs_maxcopyrange; |
8349 |
len = nfs_maxcopyrange; |
8347 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp); |
8350 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp, cred); |
8348 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8351 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8349 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8352 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8350 |
NFSGETATTR_ATTRBIT(&attrbits); |
8353 |
NFSGETATTR_ATTRBIT(&attrbits); |
Lines 8477-8486
nfsrpc_seek(vnode_t vp, off_t *offp, bool *eofp, int c
Link Here
|
8477 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
8480 |
error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || |
8478 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
8481 |
error == NFSERR_OLDSTATEID || error == NFSERR_BADSESSION) { |
8479 |
(void) nfs_catnap(PZERO, error, "nfs_seek"); |
8482 |
(void) nfs_catnap(PZERO, error, "nfs_seek"); |
8480 |
} else if ((error == NFSERR_EXPIRED || |
8483 |
} else if ((error == NFSERR_EXPIRED || (!NFSHASINT(nmp) && |
8481 |
error == NFSERR_BADSTATEID) && clidrev != 0) { |
8484 |
error == NFSERR_BADSTATEID)) && clidrev != 0) { |
8482 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, |
8485 |
expireret = nfscl_hasexpired(nmp->nm_clp, clidrev, |
8483 |
curthread); |
8486 |
curthread); |
|
|
8487 |
} else if (error == NFSERR_BADSTATEID && NFSHASINT(nmp)) { |
8488 |
error = EIO; |
8484 |
} |
8489 |
} |
8485 |
retrycnt++; |
8490 |
retrycnt++; |
8486 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
8491 |
} while (error == NFSERR_GRACE || error == NFSERR_STALESTATEID || |
Lines 8509-8515
nfsrpc_seekrpc(vnode_t vp, off_t *offp, nfsv4stateid_t
Link Here
|
8509 |
nfsattrbit_t attrbits; |
8514 |
nfsattrbit_t attrbits; |
8510 |
|
8515 |
|
8511 |
*attrflagp = 0; |
8516 |
*attrflagp = 0; |
8512 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp); |
8517 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp, cred); |
8513 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
8518 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
8514 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8519 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8515 |
txdr_hyper(*offp, tl); tl += 2; |
8520 |
txdr_hyper(*offp, tl); tl += 2; |
Lines 8553-8559
nfsrpc_getextattr(vnode_t vp, const char *name, struct
Link Here
|
8553 |
uint32_t len, len2; |
8558 |
uint32_t len, len2; |
8554 |
|
8559 |
|
8555 |
*attrflagp = 0; |
8560 |
*attrflagp = 0; |
8556 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp); |
8561 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp, cred); |
8557 |
nfsm_strtom(nd, name, strlen(name)); |
8562 |
nfsm_strtom(nd, name, strlen(name)); |
8558 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8563 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8559 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8564 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
Lines 8623-8629
nfsrpc_setextattr(vnode_t vp, const char *name, struct
Link Here
|
8623 |
nfsattrbit_t attrbits; |
8628 |
nfsattrbit_t attrbits; |
8624 |
|
8629 |
|
8625 |
*attrflagp = 0; |
8630 |
*attrflagp = 0; |
8626 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp); |
8631 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp, cred); |
8627 |
if (uiop->uio_resid > nd->nd_maxreq) { |
8632 |
if (uiop->uio_resid > nd->nd_maxreq) { |
8628 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
8633 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
8629 |
m_freem(nd->nd_mreq); |
8634 |
m_freem(nd->nd_mreq); |
Lines 8671-8677
nfsrpc_rmextattr(vnode_t vp, const char *name, struct
Link Here
|
8671 |
nfsattrbit_t attrbits; |
8676 |
nfsattrbit_t attrbits; |
8672 |
|
8677 |
|
8673 |
*attrflagp = 0; |
8678 |
*attrflagp = 0; |
8674 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp); |
8679 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp, cred); |
8675 |
nfsm_strtom(nd, name, strlen(name)); |
8680 |
nfsm_strtom(nd, name, strlen(name)); |
8676 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8681 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8677 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8682 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
Lines 8711-8717
nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, stru
Link Here
|
8711 |
u_char c; |
8716 |
u_char c; |
8712 |
|
8717 |
|
8713 |
*attrflagp = 0; |
8718 |
*attrflagp = 0; |
8714 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp); |
8719 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp, cred); |
8715 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8720 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8716 |
txdr_hyper(*cookiep, tl); tl += 2; |
8721 |
txdr_hyper(*cookiep, tl); tl += 2; |
8717 |
*tl++ = txdr_unsigned(*lenp); |
8722 |
*tl++ = txdr_unsigned(*lenp); |
Lines 8885-8891
nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucre
Link Here
|
8885 |
int error; |
8890 |
int error; |
8886 |
|
8891 |
|
8887 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
8892 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
8888 |
NFS_VER4, rcp->minorvers); |
8893 |
NFS_VER4, rcp->minorvers, NULL); |
8889 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
8894 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
8890 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
8895 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
8891 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |
8896 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |