|
Lines 241-247
nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T
Link Here
|
| 241 |
int error; |
241 |
int error; |
| 242 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
242 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
| 243 |
|
243 |
|
| 244 |
NFSCL_REQSTART(nd, NFSPROC_NULL, vp); |
244 |
NFSCL_REQSTART(nd, NFSPROC_NULL, vp, NULL); |
| 245 |
error = nfscl_request(nd, vp, p, cred); |
245 |
error = nfscl_request(nd, vp, p, cred); |
| 246 |
if (nd->nd_repstat && !error) |
246 |
if (nd->nd_repstat && !error) |
| 247 |
error = nd->nd_repstat; |
247 |
error = nd->nd_repstat; |
|
Lines 310-316
nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct uc
Link Here
|
| 310 |
|
310 |
|
| 311 |
*attrflagp = 0; |
311 |
*attrflagp = 0; |
| 312 |
supported = mode; |
312 |
supported = mode; |
| 313 |
NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp); |
313 |
NFSCL_REQSTART(nd, NFSPROC_ACCESS, vp, cred); |
| 314 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
314 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 315 |
*tl = txdr_unsigned(mode); |
315 |
*tl = txdr_unsigned(mode); |
| 316 |
if (nd->nd_flag & ND_NFSV4) { |
316 |
if (nd->nd_flag & ND_NFSV4) { |
|
Lines 514-520
nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int
Link Here
|
| 514 |
|
514 |
|
| 515 |
dp = *dpp; |
515 |
dp = *dpp; |
| 516 |
*dpp = NULL; |
516 |
*dpp = NULL; |
| 517 |
nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0); |
517 |
nfscl_reqstart(nd, NFSPROC_OPEN, nmp, nfhp, fhlen, NULL, NULL, 0, 0, |
|
|
518 |
cred); |
| 518 |
NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); |
519 |
NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); |
| 519 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
520 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
| 520 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
521 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
|
Lines 707-713
nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struc
Link Here
|
| 707 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
708 |
struct nfsrv_descript nfsd, *nd = &nfsd; |
| 708 |
int error; |
709 |
int error; |
| 709 |
|
710 |
|
| 710 |
NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); |
711 |
NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp, cred); |
| 711 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); |
712 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); |
| 712 |
if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) |
713 |
if (NFSHASNFSV4N(VFSTONFS(vp->v_mount))) |
| 713 |
*tl++ = 0; |
714 |
*tl++ = 0; |
|
Lines 872-878
nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsm
Link Here
|
| 872 |
int error; |
873 |
int error; |
| 873 |
|
874 |
|
| 874 |
nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, |
875 |
nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, |
| 875 |
op->nfso_fhlen, NULL, NULL, 0, 0); |
876 |
op->nfso_fhlen, NULL, NULL, 0, 0, cred); |
| 876 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
877 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
| 877 |
if (NFSHASNFSV4N(nmp)) { |
878 |
if (NFSHASNFSV4N(nmp)) { |
| 878 |
*tl++ = 0; |
879 |
*tl++ = 0; |
|
Lines 918-924
nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhl
Link Here
|
| 918 |
if (NFSHASNFSV4N(nmp)) |
919 |
if (NFSHASNFSV4N(nmp)) |
| 919 |
return (0); /* No confirmation for NFSv4.1. */ |
920 |
return (0); /* No confirmation for NFSv4.1. */ |
| 920 |
nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, |
921 |
nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, |
| 921 |
0, 0); |
922 |
0, 0, NULL); |
| 922 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
923 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); |
| 923 |
*tl++ = op->nfso_stateid.seqid; |
924 |
*tl++ = op->nfso_stateid.seqid; |
| 924 |
*tl++ = op->nfso_stateid.other[0]; |
925 |
*tl++ = op->nfso_stateid.other[0]; |
|
Lines 1062-1069
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1062 |
* in-progress RPCs. |
1063 |
* in-progress RPCs. |
| 1063 |
*/ |
1064 |
*/ |
| 1064 |
tsep = NULL; |
1065 |
tsep = NULL; |
| 1065 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) |
1066 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) { |
| 1066 |
tsep = NFSMNT_MDSSESSION(nmp); |
1067 |
tsep = NFSMNT_MDSSESSION(nmp); |
|
|
1068 |
if (tsep->nfsess_defunct == 0) |
| 1069 |
printf("nfsrpc_setclient: " |
| 1070 |
"nfsess_defunct not set\n"); |
| 1071 |
} |
| 1067 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
1072 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
| 1068 |
nfsclds_list); |
1073 |
nfsclds_list); |
| 1069 |
/* |
1074 |
/* |
|
Lines 1105-1111
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1105 |
tsep = NFSMNT_MDSSESSION(nmp); |
1110 |
tsep = NFSMNT_MDSSESSION(nmp); |
| 1106 |
NFSUNLOCKMNT(nmp); |
1111 |
NFSUNLOCKMNT(nmp); |
| 1107 |
|
1112 |
|
| 1108 |
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); |
| 1109 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
1115 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 1110 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
1116 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
| 1111 |
*tl = txdr_unsigned(clp->nfsc_rev); |
1117 |
*tl = txdr_unsigned(clp->nfsc_rev); |
|
Lines 1175-1181
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1175 |
* and confirm it. |
1181 |
* and confirm it. |
| 1176 |
*/ |
1182 |
*/ |
| 1177 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
1183 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
| 1178 |
NULL, 0, 0); |
1184 |
NULL, 0, 0, NULL); |
| 1179 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
1185 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
| 1180 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
1186 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
| 1181 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
1187 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
|
Lines 1206-1212
nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC
Link Here
|
| 1206 |
int error; |
1212 |
int error; |
| 1207 |
nfsattrbit_t attrbits; |
1213 |
nfsattrbit_t attrbits; |
| 1208 |
|
1214 |
|
| 1209 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
1215 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 1210 |
if (nd->nd_flag & ND_NFSV4) { |
1216 |
if (nd->nd_flag & ND_NFSV4) { |
| 1211 |
NFSGETATTR_ATTRBIT(&attrbits); |
1217 |
NFSGETATTR_ATTRBIT(&attrbits); |
| 1212 |
(void) nfsrv_putattrbit(nd, &attrbits); |
1218 |
(void) nfsrv_putattrbit(nd, &attrbits); |
|
Lines 1234-1240
nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp
Link Here
|
| 1234 |
int error, vers = NFS_VER2; |
1240 |
int error, vers = NFS_VER2; |
| 1235 |
nfsattrbit_t attrbits; |
1241 |
nfsattrbit_t attrbits; |
| 1236 |
|
1242 |
|
| 1237 |
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); |
| 1238 |
if (nd->nd_flag & ND_NFSV4) { |
1245 |
if (nd->nd_flag & ND_NFSV4) { |
| 1239 |
vers = NFS_VER4; |
1246 |
vers = NFS_VER4; |
| 1240 |
NFSGETATTR_ATTRBIT(&attrbits); |
1247 |
NFSGETATTR_ATTRBIT(&attrbits); |
|
Lines 1359-1365
nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap,
Link Here
|
| 1359 |
nfsattrbit_t attrbits; |
1366 |
nfsattrbit_t attrbits; |
| 1360 |
|
1367 |
|
| 1361 |
*attrflagp = 0; |
1368 |
*attrflagp = 0; |
| 1362 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); |
1369 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp, cred); |
| 1363 |
if (nd->nd_flag & ND_NFSV4) |
1370 |
if (nd->nd_flag & ND_NFSV4) |
| 1364 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1371 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 1365 |
vap->va_type = vnode_vtype(vp); |
1372 |
vap->va_type = vnode_vtype(vp); |
|
Lines 1433-1444
nfsrpc_lookup(vnode_t dvp, char *name, int len, struct
Link Here
|
| 1433 |
name[0] == '.' && name[1] == '.') { |
1440 |
name[0] == '.' && name[1] == '.') { |
| 1434 |
lookupp = 1; |
1441 |
lookupp = 1; |
| 1435 |
openmode = 0; |
1442 |
openmode = 0; |
| 1436 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp); |
1443 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp, cred); |
| 1437 |
} else if (openmode != 0) { |
1444 |
} else if (openmode != 0) { |
| 1438 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPOPEN, dvp); |
1445 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPOPEN, dvp, cred); |
| 1439 |
nfsm_strtom(nd, name, len); |
1446 |
nfsm_strtom(nd, name, len); |
| 1440 |
} else { |
1447 |
} else { |
| 1441 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp); |
1448 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp, cred); |
| 1442 |
(void) nfsm_strtom(nd, name, len); |
1449 |
(void) nfsm_strtom(nd, name, len); |
| 1443 |
} |
1450 |
} |
| 1444 |
if (nd->nd_flag & ND_NFSV4) { |
1451 |
if (nd->nd_flag & ND_NFSV4) { |
|
Lines 1643-1649
nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct u
Link Here
|
| 1643 |
int error, len, cangetattr = 1; |
1650 |
int error, len, cangetattr = 1; |
| 1644 |
|
1651 |
|
| 1645 |
*attrflagp = 0; |
1652 |
*attrflagp = 0; |
| 1646 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp); |
1653 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp, cred); |
| 1647 |
if (nd->nd_flag & ND_NFSV4) { |
1654 |
if (nd->nd_flag & ND_NFSV4) { |
| 1648 |
/* |
1655 |
/* |
| 1649 |
* And do a Getattr op. |
1656 |
* And do a Getattr op. |
|
Lines 1779-1785
nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct uc
Link Here
|
| 1779 |
while (tsiz > 0) { |
1786 |
while (tsiz > 0) { |
| 1780 |
*attrflagp = 0; |
1787 |
*attrflagp = 0; |
| 1781 |
len = (tsiz > rsize) ? rsize : tsiz; |
1788 |
len = (tsiz > rsize) ? rsize : tsiz; |
| 1782 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp); |
1789 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp, cred); |
| 1783 |
if (nd->nd_flag & ND_NFSV4) |
1790 |
if (nd->nd_flag & ND_NFSV4) |
| 1784 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1791 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 1785 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
1792 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
|
Lines 1963-1971
nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iom
Link Here
|
| 1963 |
*attrflagp = 0; |
1970 |
*attrflagp = 0; |
| 1964 |
len = (tsiz > wsize) ? wsize : tsiz; |
1971 |
len = (tsiz > wsize) ? wsize : tsiz; |
| 1965 |
if (do_append) |
1972 |
if (do_append) |
| 1966 |
NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp); |
1973 |
NFSCL_REQSTART(nd, NFSPROC_APPENDWRITE, vp, cred); |
| 1967 |
else |
1974 |
else |
| 1968 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp); |
1975 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp, cred); |
| 1969 |
if (nd->nd_flag & ND_NFSV4) { |
1976 |
if (nd->nd_flag & ND_NFSV4) { |
| 1970 |
if (do_append) { |
1977 |
if (do_append) { |
| 1971 |
NFSZERO_ATTRBIT(&attrbits); |
1978 |
NFSZERO_ATTRBIT(&attrbits); |
|
Lines 2227-2233
nfsrpc_deallocaterpc(vnode_t vp, off_t offs, off_t len
Link Here
|
| 2227 |
nfsattrbit_t attrbits; |
2234 |
nfsattrbit_t attrbits; |
| 2228 |
|
2235 |
|
| 2229 |
*attrflagp = 0; |
2236 |
*attrflagp = 0; |
| 2230 |
NFSCL_REQSTART(nd, NFSPROC_DEALLOCATE, vp); |
2237 |
NFSCL_REQSTART(nd, NFSPROC_DEALLOCATE, vp, cred); |
| 2231 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
2238 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 2232 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
2239 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
| 2233 |
txdr_hyper(offs, tl); |
2240 |
txdr_hyper(offs, tl); |
|
Lines 2280-2286
nfsrpc_mknod(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 2280 |
*dattrflagp = 0; |
2287 |
*dattrflagp = 0; |
| 2281 |
if (namelen > NFS_MAXNAMLEN) |
2288 |
if (namelen > NFS_MAXNAMLEN) |
| 2282 |
return (ENAMETOOLONG); |
2289 |
return (ENAMETOOLONG); |
| 2283 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); |
2290 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp, cred); |
| 2284 |
if (nd->nd_flag & ND_NFSV4) { |
2291 |
if (nd->nd_flag & ND_NFSV4) { |
| 2285 |
if (vtyp == VBLK || vtyp == VCHR) { |
2292 |
if (vtyp == VBLK || vtyp == VCHR) { |
| 2286 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
2293 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
|
Lines 2429-2435
nfsrpc_createv23(vnode_t dvp, char *name, int namelen,
Link Here
|
| 2429 |
*dattrflagp = 0; |
2436 |
*dattrflagp = 0; |
| 2430 |
if (namelen > NFS_MAXNAMLEN) |
2437 |
if (namelen > NFS_MAXNAMLEN) |
| 2431 |
return (ENAMETOOLONG); |
2438 |
return (ENAMETOOLONG); |
| 2432 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2439 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
| 2433 |
(void) nfsm_strtom(nd, name, namelen); |
2440 |
(void) nfsm_strtom(nd, name, namelen); |
| 2434 |
if (nd->nd_flag & ND_NFSV3) { |
2441 |
if (nd->nd_flag & ND_NFSV3) { |
| 2435 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2442 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
|
Lines 2491-2497
nfsrpc_createv4(vnode_t dvp, char *name, int namelen,
Link Here
|
| 2491 |
*dattrflagp = 0; |
2498 |
*dattrflagp = 0; |
| 2492 |
if (namelen > NFS_MAXNAMLEN) |
2499 |
if (namelen > NFS_MAXNAMLEN) |
| 2493 |
return (ENAMETOOLONG); |
2500 |
return (ENAMETOOLONG); |
| 2494 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2501 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
| 2495 |
/* |
2502 |
/* |
| 2496 |
* For V4, this is actually an Open op. |
2503 |
* For V4, this is actually an Open op. |
| 2497 |
*/ |
2504 |
*/ |
|
Lines 2732-2738
tryagain:
Link Here
|
| 2732 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
2739 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
| 2733 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
2740 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
| 2734 |
if (ret == 1) { |
2741 |
if (ret == 1) { |
| 2735 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp); |
2742 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp, cred); |
| 2736 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
2743 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
| 2737 |
NFSX_UNSIGNED); |
2744 |
NFSX_UNSIGNED); |
| 2738 |
if (NFSHASNFSV4N(nmp)) |
2745 |
if (NFSHASNFSV4N(nmp)) |
|
Lines 2753-2759
tryagain:
Link Here
|
| 2753 |
ret = 0; |
2760 |
ret = 0; |
| 2754 |
} |
2761 |
} |
| 2755 |
if (ret == 0) |
2762 |
if (ret == 0) |
| 2756 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp); |
2763 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp, cred); |
| 2757 |
(void) nfsm_strtom(nd, name, namelen); |
2764 |
(void) nfsm_strtom(nd, name, namelen); |
| 2758 |
error = nfscl_request(nd, dvp, p, cred); |
2765 |
error = nfscl_request(nd, dvp, p, cred); |
| 2759 |
if (error) |
2766 |
if (error) |
|
Lines 2813-2823
tryagain:
Link Here
|
| 2813 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
2820 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
| 2814 |
&tdstateid, &gottd, p); |
2821 |
&tdstateid, &gottd, p); |
| 2815 |
if (gotfd && gottd) { |
2822 |
if (gotfd && gottd) { |
| 2816 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp); |
2823 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp, cred); |
| 2817 |
} else if (gotfd) { |
2824 |
} else if (gotfd) { |
| 2818 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp); |
2825 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp, cred); |
| 2819 |
} else if (gottd) { |
2826 |
} else if (gottd) { |
| 2820 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp); |
2827 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp, cred); |
| 2821 |
} |
2828 |
} |
| 2822 |
if (gotfd) { |
2829 |
if (gotfd) { |
| 2823 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
2830 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
|
Lines 2861-2867
tryagain:
Link Here
|
| 2861 |
ret = 0; |
2868 |
ret = 0; |
| 2862 |
} |
2869 |
} |
| 2863 |
if (ret == 0) |
2870 |
if (ret == 0) |
| 2864 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp); |
2871 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp, cred); |
| 2865 |
if (nd->nd_flag & ND_NFSV4) { |
2872 |
if (nd->nd_flag & ND_NFSV4) { |
| 2866 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2873 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2867 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
2874 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 2960-2966
nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int n
Link Here
|
| 2960 |
*dattrflagp = 0; |
2967 |
*dattrflagp = 0; |
| 2961 |
if (namelen > NFS_MAXNAMLEN) |
2968 |
if (namelen > NFS_MAXNAMLEN) |
| 2962 |
return (ENAMETOOLONG); |
2969 |
return (ENAMETOOLONG); |
| 2963 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp); |
2970 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp, cred); |
| 2964 |
if (nd->nd_flag & ND_NFSV4) { |
2971 |
if (nd->nd_flag & ND_NFSV4) { |
| 2965 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2972 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2966 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
2973 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
|
Lines 3027-3033
nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c
Link Here
|
| 3027 |
slen = strlen(target); |
3034 |
slen = strlen(target); |
| 3028 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
3035 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
| 3029 |
return (ENAMETOOLONG); |
3036 |
return (ENAMETOOLONG); |
| 3030 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp); |
3037 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp, cred); |
| 3031 |
if (nd->nd_flag & ND_NFSV4) { |
3038 |
if (nd->nd_flag & ND_NFSV4) { |
| 3032 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
3039 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 3033 |
*tl = txdr_unsigned(NFLNK); |
3040 |
*tl = txdr_unsigned(NFLNK); |
|
Lines 3090-3096
nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 3090 |
fhp = VTONFS(dvp)->n_fhp; |
3097 |
fhp = VTONFS(dvp)->n_fhp; |
| 3091 |
if (namelen > NFS_MAXNAMLEN) |
3098 |
if (namelen > NFS_MAXNAMLEN) |
| 3092 |
return (ENAMETOOLONG); |
3099 |
return (ENAMETOOLONG); |
| 3093 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); |
3100 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp, cred); |
| 3094 |
if (nd->nd_flag & ND_NFSV4) { |
3101 |
if (nd->nd_flag & ND_NFSV4) { |
| 3095 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
3102 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 3096 |
*tl = txdr_unsigned(NFDIR); |
3103 |
*tl = txdr_unsigned(NFDIR); |
|
Lines 3162-3168
nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 3162 |
*dattrflagp = 0; |
3169 |
*dattrflagp = 0; |
| 3163 |
if (namelen > NFS_MAXNAMLEN) |
3170 |
if (namelen > NFS_MAXNAMLEN) |
| 3164 |
return (ENAMETOOLONG); |
3171 |
return (ENAMETOOLONG); |
| 3165 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp); |
3172 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp, cred); |
| 3166 |
(void) nfsm_strtom(nd, name, namelen); |
3173 |
(void) nfsm_strtom(nd, name, namelen); |
| 3167 |
error = nfscl_request(nd, dvp, p, cred); |
3174 |
error = nfscl_request(nd, dvp, p, cred); |
| 3168 |
if (error) |
3175 |
if (error) |
|
Lines 3279-3285
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
| 3279 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3286 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
| 3280 |
*/ |
3287 |
*/ |
| 3281 |
if (uiop->uio_offset == 0) { |
3288 |
if (uiop->uio_offset == 0) { |
| 3282 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
3289 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
| 3283 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3290 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 3284 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3291 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
| 3285 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3292 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 3396-3402
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
| 3396 |
*/ |
3403 |
*/ |
| 3397 |
while (more_dirs && bigenough) { |
3404 |
while (more_dirs && bigenough) { |
| 3398 |
*attrflagp = 0; |
3405 |
*attrflagp = 0; |
| 3399 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp); |
3406 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp, cred); |
| 3400 |
if (nd->nd_flag & ND_NFSV2) { |
3407 |
if (nd->nd_flag & ND_NFSV2) { |
| 3401 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3408 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 3402 |
*tl++ = cookie.lval[1]; |
3409 |
*tl++ = cookie.lval[1]; |
|
Lines 3721-3727
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
| 3721 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3728 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
| 3722 |
*/ |
3729 |
*/ |
| 3723 |
if (uiop->uio_offset == 0) { |
3730 |
if (uiop->uio_offset == 0) { |
| 3724 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
3731 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
| 3725 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3732 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 3726 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3733 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
| 3727 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3734 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 3843-3849
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
| 3843 |
*/ |
3850 |
*/ |
| 3844 |
while (more_dirs && bigenough) { |
3851 |
while (more_dirs && bigenough) { |
| 3845 |
*attrflagp = 0; |
3852 |
*attrflagp = 0; |
| 3846 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp); |
3853 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp, cred); |
| 3847 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
3854 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
| 3848 |
*tl++ = cookie.lval[0]; |
3855 |
*tl++ = cookie.lval[0]; |
| 3849 |
*tl++ = cookie.lval[1]; |
3856 |
*tl++ = cookie.lval[1]; |
|
Lines 4198-4204
nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, st
Link Here
|
| 4198 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
4205 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
| 4199 |
|
4206 |
|
| 4200 |
*attrflagp = 0; |
4207 |
*attrflagp = 0; |
| 4201 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); |
4208 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp, cred); |
| 4202 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
4209 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
| 4203 |
txdr_hyper(offset, tl); |
4210 |
txdr_hyper(offset, tl); |
| 4204 |
tl += 2; |
4211 |
tl += 2; |
|
Lines 4418-4424
nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp,
Link Here
|
| 4418 |
struct nfsclsession *tsep; |
4425 |
struct nfsclsession *tsep; |
| 4419 |
|
4426 |
|
| 4420 |
nmp = VFSTONFS(vp->v_mount); |
4427 |
nmp = VFSTONFS(vp->v_mount); |
| 4421 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp); |
4428 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp, cred); |
| 4422 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4429 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
| 4423 |
if (fl->l_type == F_RDLCK) |
4430 |
if (fl->l_type == F_RDLCK) |
| 4424 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4431 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
|
Lines 4489-4495
nfsrpc_locku(struct nfsrv_descript *nd, struct nfsmoun
Link Here
|
| 4489 |
int error; |
4496 |
int error; |
| 4490 |
|
4497 |
|
| 4491 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
4498 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
| 4492 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0); |
4499 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0, cred); |
| 4493 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
4500 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
| 4494 |
*tl++ = txdr_unsigned(type); |
4501 |
*tl++ = txdr_unsigned(type); |
| 4495 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
4502 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
|
Lines 4541-4547
nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount
Link Here
|
| 4541 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
4548 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
| 4542 |
struct nfsclsession *tsep; |
4549 |
struct nfsclsession *tsep; |
| 4543 |
|
4550 |
|
| 4544 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0); |
4551 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0, |
|
|
4552 |
cred); |
| 4545 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4553 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
| 4546 |
if (type == F_RDLCK) |
4554 |
if (type == F_RDLCK) |
| 4547 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4555 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
|
Lines 4636-4642
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
| 4636 |
/* |
4644 |
/* |
| 4637 |
* For V4, you actually do a getattr. |
4645 |
* For V4, you actually do a getattr. |
| 4638 |
*/ |
4646 |
*/ |
| 4639 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4647 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 4640 |
NFSSTATFS_GETATTRBIT(&attrbits); |
4648 |
NFSSTATFS_GETATTRBIT(&attrbits); |
| 4641 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4649 |
(void) nfsrv_putattrbit(nd, &attrbits); |
| 4642 |
nd->nd_flag |= ND_USEGSSNAME; |
4650 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 4659-4665
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
| 4659 |
if (error) |
4667 |
if (error) |
| 4660 |
goto nfsmout; |
4668 |
goto nfsmout; |
| 4661 |
} else { |
4669 |
} else { |
| 4662 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp); |
4670 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp, cred); |
| 4663 |
error = nfscl_request(nd, vp, p, cred); |
4671 |
error = nfscl_request(nd, vp, p, cred); |
| 4664 |
if (error) |
4672 |
if (error) |
| 4665 |
return (error); |
4673 |
return (error); |
|
Lines 4715-4721
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
| 4715 |
/* |
4723 |
/* |
| 4716 |
* For V4, you actually do a getattr. |
4724 |
* For V4, you actually do a getattr. |
| 4717 |
*/ |
4725 |
*/ |
| 4718 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4726 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 4719 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
4727 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
| 4720 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4728 |
(void) nfsrv_putattrbit(nd, &attrbits); |
| 4721 |
nd->nd_flag |= ND_USEGSSNAME; |
4729 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 4732-4738
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
| 4732 |
error = nd->nd_repstat; |
4740 |
error = nd->nd_repstat; |
| 4733 |
} |
4741 |
} |
| 4734 |
} else { |
4742 |
} else { |
| 4735 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp); |
4743 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp, cred); |
| 4736 |
error = nfscl_request(nd, vp, p, cred); |
4744 |
error = nfscl_request(nd, vp, p, cred); |
| 4737 |
if (error) |
4745 |
if (error) |
| 4738 |
return (error); |
4746 |
return (error); |
|
Lines 4768-4774
nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struc
Link Here
|
| 4768 |
int error; |
4776 |
int error; |
| 4769 |
|
4777 |
|
| 4770 |
*attrflagp = 0; |
4778 |
*attrflagp = 0; |
| 4771 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp); |
4779 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp, cred); |
| 4772 |
error = nfscl_request(nd, vp, p, cred); |
4780 |
error = nfscl_request(nd, vp, p, cred); |
| 4773 |
if (error) |
4781 |
if (error) |
| 4774 |
return (error); |
4782 |
return (error); |
|
Lines 4815-4824
nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *
Link Here
|
| 4815 |
return (0); |
4823 |
return (0); |
| 4816 |
if (dsp == NULL) |
4824 |
if (dsp == NULL) |
| 4817 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
4825 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
| 4818 |
0); |
4826 |
0, cred); |
| 4819 |
else |
4827 |
else |
| 4820 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
4828 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
| 4821 |
&dsp->nfsclds_sess, 0, 0); |
4829 |
&dsp->nfsclds_sess, 0, 0, NULL); |
| 4822 |
if (!NFSHASNFSV4N(nmp)) { |
4830 |
if (!NFSHASNFSV4N(nmp)) { |
| 4823 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
4831 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
| 4824 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4832 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
|
Lines 4865-4875
nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo
Link Here
|
| 4865 |
if (NFSHASNFSV4N(nmp)) { |
4873 |
if (NFSHASNFSV4N(nmp)) { |
| 4866 |
/* For NFSv4.1, do a FreeStateID. */ |
4874 |
/* For NFSv4.1, do a FreeStateID. */ |
| 4867 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
4875 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
| 4868 |
NULL, 0, 0); |
4876 |
NULL, 0, 0, cred); |
| 4869 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
4877 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
| 4870 |
} else { |
4878 |
} else { |
| 4871 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
4879 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
| 4872 |
NULL, 0, 0); |
4880 |
NULL, 0, 0, NULL); |
| 4873 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4881 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 4874 |
tsep = nfsmnt_mdssession(nmp); |
4882 |
tsep = nfsmnt_mdssession(nmp); |
| 4875 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
4883 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
|
Lines 4903-4909
nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpat
Link Here
|
| 4903 |
u_int32_t *opcntp; |
4911 |
u_int32_t *opcntp; |
| 4904 |
|
4912 |
|
| 4905 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
4913 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
| 4906 |
0); |
4914 |
0, NULL); |
| 4907 |
cp = dirpath; |
4915 |
cp = dirpath; |
| 4908 |
cnt = 0; |
4916 |
cnt = 0; |
| 4909 |
do { |
4917 |
do { |
|
Lines 4970-4976
nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred
Link Here
|
| 4970 |
int error; |
4978 |
int error; |
| 4971 |
|
4979 |
|
| 4972 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
4980 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
| 4973 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0); |
4981 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0, cred); |
| 4974 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
4982 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
| 4975 |
if (NFSHASNFSV4N(nmp)) |
4983 |
if (NFSHASNFSV4N(nmp)) |
| 4976 |
*tl++ = 0; |
4984 |
*tl++ = 0; |
|
Lines 5004-5010
nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_
Link Here
|
| 5004 |
|
5012 |
|
| 5005 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
5013 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
| 5006 |
return (EOPNOTSUPP); |
5014 |
return (EOPNOTSUPP); |
| 5007 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp); |
5015 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp, cred); |
| 5008 |
NFSZERO_ATTRBIT(&attrbits); |
5016 |
NFSZERO_ATTRBIT(&attrbits); |
| 5009 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
5017 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
| 5010 |
(void) nfsrv_putattrbit(nd, &attrbits); |
5018 |
(void) nfsrv_putattrbit(nd, &attrbits); |
|
Lines 5050-5056
nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR
Link Here
|
| 5050 |
|
5058 |
|
| 5051 |
if (!NFSHASNFSV4(nmp)) |
5059 |
if (!NFSHASNFSV4(nmp)) |
| 5052 |
return (EOPNOTSUPP); |
5060 |
return (EOPNOTSUPP); |
| 5053 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp); |
5061 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp, cred); |
| 5054 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
5062 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 5055 |
NFSZERO_ATTRBIT(&attrbits); |
5063 |
NFSZERO_ATTRBIT(&attrbits); |
| 5056 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
5064 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
|
Lines 5083-5089
nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl
Link Here
|
| 5083 |
if (minorvers == 0) |
5091 |
if (minorvers == 0) |
| 5084 |
minorvers = nmp->nm_minorvers; |
5092 |
minorvers = nmp->nm_minorvers; |
| 5085 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
5093 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
| 5086 |
NFS_VER4, minorvers); |
5094 |
NFS_VER4, minorvers, NULL); |
| 5087 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
5095 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
| 5088 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
5096 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
| 5089 |
*tl = txdr_unsigned(clp->nfsc_rev); |
5097 |
*tl = txdr_unsigned(clp->nfsc_rev); |
|
Lines 5179-5185
nfsrpc_createsession(struct nfsmount *nmp, struct nfsc
Link Here
|
| 5179 |
else |
5187 |
else |
| 5180 |
minorvers = NFSV41_MINORVERSION; |
5188 |
minorvers = NFSV41_MINORVERSION; |
| 5181 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
5189 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
| 5182 |
NFS_VER4, minorvers); |
5190 |
NFS_VER4, minorvers, NULL); |
| 5183 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
5191 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
| 5184 |
*tl++ = sep->nfsess_clientid.lval[0]; |
5192 |
*tl++ = sep->nfsess_clientid.lval[0]; |
| 5185 |
*tl++ = sep->nfsess_clientid.lval[1]; |
5193 |
*tl++ = sep->nfsess_clientid.lval[1]; |
|
Lines 5297-5330
nfsmout:
Link Here
|
| 5297 |
} |
5305 |
} |
| 5298 |
|
5306 |
|
| 5299 |
/* |
5307 |
/* |
| 5300 |
* Do the NFSv4.1 Destroy Session. |
|
|
| 5301 |
*/ |
| 5302 |
int |
| 5303 |
nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp, |
| 5304 |
struct ucred *cred, NFSPROC_T *p) |
| 5305 |
{ |
| 5306 |
uint32_t *tl; |
| 5307 |
struct nfsrv_descript nfsd; |
| 5308 |
struct nfsrv_descript *nd = &nfsd; |
| 5309 |
int error; |
| 5310 |
struct nfsclsession *tsep; |
| 5311 |
|
| 5312 |
nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, |
| 5313 |
0); |
| 5314 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); |
| 5315 |
tsep = nfsmnt_mdssession(nmp); |
| 5316 |
bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); |
| 5317 |
nd->nd_flag |= ND_USEGSSNAME; |
| 5318 |
error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, |
| 5319 |
NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); |
| 5320 |
if (error != 0) |
| 5321 |
return (error); |
| 5322 |
error = nd->nd_repstat; |
| 5323 |
m_freem(nd->nd_mrep); |
| 5324 |
return (error); |
| 5325 |
} |
| 5326 |
|
| 5327 |
/* |
| 5328 |
* Do the NFSv4.1 Destroy Client. |
5308 |
* Do the NFSv4.1 Destroy Client. |
| 5329 |
*/ |
5309 |
*/ |
| 5330 |
int |
5310 |
int |
|
Lines 5338-5344
nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc
Link Here
|
| 5338 |
struct nfsclsession *tsep; |
5318 |
struct nfsclsession *tsep; |
| 5339 |
|
5319 |
|
| 5340 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
5320 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
| 5341 |
0); |
5321 |
0, NULL); |
| 5342 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
5322 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
| 5343 |
tsep = nfsmnt_mdssession(nmp); |
5323 |
tsep = nfsmnt_mdssession(nmp); |
| 5344 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
5324 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
|
Lines 5367-5373
nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i
Link Here
|
| 5367 |
int error; |
5347 |
int error; |
| 5368 |
|
5348 |
|
| 5369 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
5349 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
| 5370 |
0); |
5350 |
0, cred); |
| 5371 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
5351 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
| 5372 |
layouttype, layoutlen, 0); |
5352 |
layouttype, layoutlen, 0); |
| 5373 |
nd->nd_flag |= ND_USEGSSNAME; |
5353 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 5411-5417
nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de
Link Here
|
| 5411 |
ndi = NULL; |
5391 |
ndi = NULL; |
| 5412 |
gotdspp = NULL; |
5392 |
gotdspp = NULL; |
| 5413 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
5393 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
| 5414 |
0); |
5394 |
0, cred); |
| 5415 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5395 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
| 5416 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
5396 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
| 5417 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
5397 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
|
Lines 5632-5638
nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5632 |
int error; |
5612 |
int error; |
| 5633 |
|
5613 |
|
| 5634 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
5614 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
| 5635 |
0, 0); |
5615 |
0, 0, cred); |
| 5636 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
5616 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
| 5637 |
NFSX_STATEID); |
5617 |
NFSX_STATEID); |
| 5638 |
txdr_hyper(off, tl); |
5618 |
txdr_hyper(off, tl); |
|
Lines 5683-5689
nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5683 |
int error; |
5663 |
int error; |
| 5684 |
|
5664 |
|
| 5685 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
5665 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
| 5686 |
0, 0); |
5666 |
0, 0, cred); |
| 5687 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
5667 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
| 5688 |
if (reclaim != 0) |
5668 |
if (reclaim != 0) |
| 5689 |
*tl++ = newnfs_true; |
5669 |
*tl++ = newnfs_true; |
|
Lines 5769-5775
nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5769 |
int error; |
5749 |
int error; |
| 5770 |
|
5750 |
|
| 5771 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
5751 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
| 5772 |
0, 0); |
5752 |
0, 0, cred); |
| 5773 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
5753 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
| 5774 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5754 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
| 5775 |
txdr_hyper(offset, tl); tl += 2; |
5755 |
txdr_hyper(offset, tl); tl += 2; |
|
Lines 6078-6084
nfsrpc_reclaimcomplete(struct nfsmount *nmp, struct uc
Link Here
|
| 6078 |
int error; |
6058 |
int error; |
| 6079 |
|
6059 |
|
| 6080 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
6060 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
| 6081 |
0); |
6061 |
0, cred); |
| 6082 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
6062 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 6083 |
*tl = newnfs_false; |
6063 |
*tl = newnfs_false; |
| 6084 |
nd->nd_flag |= ND_USEGSSNAME; |
6064 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 6107-6112
nfscl_initsessionslots(struct nfsclsession *sep)
Link Here
|
| 6107 |
for (i = 0; i < 64; i++) |
6087 |
for (i = 0; i < 64; i++) |
| 6108 |
sep->nfsess_slotseq[i] = 0; |
6088 |
sep->nfsess_slotseq[i] = 0; |
| 6109 |
sep->nfsess_slots = 0; |
6089 |
sep->nfsess_slots = 0; |
|
|
6090 |
sep->nfsess_badslots = 0; |
| 6110 |
} |
6091 |
} |
| 6111 |
|
6092 |
|
| 6112 |
/* |
6093 |
/* |
|
Lines 6701-6707
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
| 6701 |
nd->nd_mrep = NULL; |
6682 |
nd->nd_mrep = NULL; |
| 6702 |
if (vers == 0 || vers == NFS_VER4) { |
6683 |
if (vers == 0 || vers == NFS_VER4) { |
| 6703 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
6684 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
| 6704 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6685 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6686 |
NULL); |
| 6705 |
vers = NFS_VER4; |
6687 |
vers = NFS_VER4; |
| 6706 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
6688 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
| 6707 |
if (flex != 0) |
6689 |
if (flex != 0) |
|
Lines 6710-6716
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
| 6710 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
6692 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
| 6711 |
} else { |
6693 |
} else { |
| 6712 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
6694 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
| 6713 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6695 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6696 |
NULL); |
| 6714 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
6697 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
| 6715 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
6698 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
| 6716 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
6699 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
|
Lines 6777-6783
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
| 6777 |
nd->nd_mrep = NULL; |
6760 |
nd->nd_mrep = NULL; |
| 6778 |
if (vers == 0 || vers == NFS_VER4) { |
6761 |
if (vers == 0 || vers == NFS_VER4) { |
| 6779 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6762 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
| 6780 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6763 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6764 |
NULL); |
| 6781 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
6765 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
| 6782 |
vers = NFS_VER4; |
6766 |
vers = NFS_VER4; |
| 6783 |
if (flex != 0) |
6767 |
if (flex != 0) |
|
Lines 6787-6793
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
| 6787 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6771 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 6788 |
} else { |
6772 |
} else { |
| 6789 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6773 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
| 6790 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6774 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6775 |
NULL); |
| 6791 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6776 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
| 6792 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6777 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
| 6793 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
6778 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
|
Lines 6910-6916
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
| 6910 |
nd->nd_mrep = NULL; |
6895 |
nd->nd_mrep = NULL; |
| 6911 |
if (vers == 0 || vers == NFS_VER4) { |
6896 |
if (vers == 0 || vers == NFS_VER4) { |
| 6912 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6897 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
| 6913 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6898 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6899 |
NULL); |
| 6914 |
vers = NFS_VER4; |
6900 |
vers = NFS_VER4; |
| 6915 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
6901 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
| 6916 |
minorvers); |
6902 |
minorvers); |
|
Lines 6918-6924
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
| 6918 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6904 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 6919 |
} else { |
6905 |
} else { |
| 6920 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6906 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
| 6921 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6907 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6908 |
NULL); |
| 6922 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6909 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
| 6923 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6910 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
| 6924 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
6911 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
|
Lines 7138-7148
nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
| 7138 |
nd->nd_mrep = NULL; |
7125 |
nd->nd_mrep = NULL; |
| 7139 |
if (vers == 0 || vers == NFS_VER4) { |
7126 |
if (vers == 0 || vers == NFS_VER4) { |
| 7140 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
7127 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
| 7141 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
7128 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
7129 |
NULL); |
| 7142 |
vers = NFS_VER4; |
7130 |
vers = NFS_VER4; |
| 7143 |
} else { |
7131 |
} else { |
| 7144 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
7132 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
| 7145 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
7133 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
7134 |
NULL); |
| 7146 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
7135 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
| 7147 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
7136 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
| 7148 |
} |
7137 |
} |
|
Lines 7257-7263
nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt,
Link Here
|
| 7257 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
7246 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
| 7258 |
else |
7247 |
else |
| 7259 |
return (0); |
7248 |
return (0); |
| 7260 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp); |
7249 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp, cred); |
| 7261 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
7250 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
| 7262 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
7251 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
| 7263 |
txdr_hyper(offset, tl); |
7252 |
txdr_hyper(offset, tl); |
|
Lines 7301-7307
nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
| 7301 |
return (0); |
7290 |
return (0); |
| 7302 |
nd->nd_mrep = NULL; |
7291 |
nd->nd_mrep = NULL; |
| 7303 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
7292 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
| 7304 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
7293 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, NULL); |
| 7305 |
vers = NFS_VER4; |
7294 |
vers = NFS_VER4; |
| 7306 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
7295 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
| 7307 |
minorvers); |
7296 |
minorvers); |
|
Lines 7470-7476
nfsrpc_allocaterpc(vnode_t vp, off_t off, off_t len, n
Link Here
|
| 7470 |
nfsattrbit_t attrbits; |
7459 |
nfsattrbit_t attrbits; |
| 7471 |
|
7460 |
|
| 7472 |
*attrflagp = 0; |
7461 |
*attrflagp = 0; |
| 7473 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp); |
7462 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp, cred); |
| 7474 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
7463 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 7475 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
7464 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
| 7476 |
txdr_hyper(off, tl); tl += 2; |
7465 |
txdr_hyper(off, tl); tl += 2; |
|
Lines 7958-7964
nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp,
Link Here
|
| 7958 |
*dpp = NULL; |
7947 |
*dpp = NULL; |
| 7959 |
*laystatp = ENXIO; |
7948 |
*laystatp = ENXIO; |
| 7960 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
7949 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
| 7961 |
0, 0); |
7950 |
0, 0, cred); |
| 7962 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
7951 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
| 7963 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
7952 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
| 7964 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
7953 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
|
Lines 8143-8149
nfsrpc_createlayout(vnode_t dvp, char *name, int namel
Link Here
|
| 8143 |
*dattrflagp = 0; |
8132 |
*dattrflagp = 0; |
| 8144 |
if (namelen > NFS_MAXNAMLEN) |
8133 |
if (namelen > NFS_MAXNAMLEN) |
| 8145 |
return (ENAMETOOLONG); |
8134 |
return (ENAMETOOLONG); |
| 8146 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp); |
8135 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp, cred); |
| 8147 |
/* |
8136 |
/* |
| 8148 |
* For V4, this is actually an Open op. |
8137 |
* For V4, this is actually an Open op. |
| 8149 |
*/ |
8138 |
*/ |
|
Lines 8355-8361
nfsrpc_createlayout(vnode_t dvp, char *name, int namel
Link Here
|
| 8355 |
} |
8344 |
} |
| 8356 |
if (nd->nd_repstat != 0 && error == 0) |
8345 |
if (nd->nd_repstat != 0 && error == 0) |
| 8357 |
error = nd->nd_repstat; |
8346 |
error = nd->nd_repstat; |
| 8358 |
if (error == NFSERR_STALECLIENTID || error == NFSERR_BADSESSION) |
8347 |
if (error == NFSERR_STALECLIENTID) |
| 8359 |
nfscl_initiate_recovery(owp->nfsow_clp); |
8348 |
nfscl_initiate_recovery(owp->nfsow_clp); |
| 8360 |
nfsmout: |
8349 |
nfsmout: |
| 8361 |
NFSCL_DEBUG(4, "eo nfsrpc_createlayout err=%d\n", error); |
8350 |
NFSCL_DEBUG(4, "eo nfsrpc_createlayout err=%d\n", error); |
|
Lines 8584-8590
nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outv
Link Here
|
| 8584 |
*lenp = 0; |
8573 |
*lenp = 0; |
| 8585 |
if (len > nfs_maxcopyrange) |
8574 |
if (len > nfs_maxcopyrange) |
| 8586 |
len = nfs_maxcopyrange; |
8575 |
len = nfs_maxcopyrange; |
| 8587 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp); |
8576 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp, cred); |
| 8588 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8577 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8589 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8578 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
| 8590 |
NFSGETATTR_ATTRBIT(&attrbits); |
8579 |
NFSGETATTR_ATTRBIT(&attrbits); |
|
Lines 8749-8755
nfsrpc_seekrpc(vnode_t vp, off_t *offp, nfsv4stateid_t
Link Here
|
| 8749 |
nfsattrbit_t attrbits; |
8738 |
nfsattrbit_t attrbits; |
| 8750 |
|
8739 |
|
| 8751 |
*attrflagp = 0; |
8740 |
*attrflagp = 0; |
| 8752 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp); |
8741 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp, cred); |
| 8753 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
8742 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 8754 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8743 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 8755 |
txdr_hyper(*offp, tl); tl += 2; |
8744 |
txdr_hyper(*offp, tl); tl += 2; |
|
Lines 8793-8799
nfsrpc_getextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8793 |
uint32_t len, len2; |
8782 |
uint32_t len, len2; |
| 8794 |
|
8783 |
|
| 8795 |
*attrflagp = 0; |
8784 |
*attrflagp = 0; |
| 8796 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp); |
8785 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp, cred); |
| 8797 |
nfsm_strtom(nd, name, strlen(name)); |
8786 |
nfsm_strtom(nd, name, strlen(name)); |
| 8798 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8787 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8799 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8788 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 8863-8869
nfsrpc_setextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8863 |
nfsattrbit_t attrbits; |
8852 |
nfsattrbit_t attrbits; |
| 8864 |
|
8853 |
|
| 8865 |
*attrflagp = 0; |
8854 |
*attrflagp = 0; |
| 8866 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp); |
8855 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp, cred); |
| 8867 |
if (uiop->uio_resid > nd->nd_maxreq) { |
8856 |
if (uiop->uio_resid > nd->nd_maxreq) { |
| 8868 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
8857 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
| 8869 |
m_freem(nd->nd_mreq); |
8858 |
m_freem(nd->nd_mreq); |
|
Lines 8911-8917
nfsrpc_rmextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8911 |
nfsattrbit_t attrbits; |
8900 |
nfsattrbit_t attrbits; |
| 8912 |
|
8901 |
|
| 8913 |
*attrflagp = 0; |
8902 |
*attrflagp = 0; |
| 8914 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp); |
8903 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp, cred); |
| 8915 |
nfsm_strtom(nd, name, strlen(name)); |
8904 |
nfsm_strtom(nd, name, strlen(name)); |
| 8916 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8905 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8917 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8906 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 8951-8957
nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, stru
Link Here
|
| 8951 |
u_char c; |
8940 |
u_char c; |
| 8952 |
|
8941 |
|
| 8953 |
*attrflagp = 0; |
8942 |
*attrflagp = 0; |
| 8954 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp); |
8943 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp, cred); |
| 8955 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8944 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 8956 |
txdr_hyper(*cookiep, tl); tl += 2; |
8945 |
txdr_hyper(*cookiep, tl); tl += 2; |
| 8957 |
*tl++ = txdr_unsigned(*lenp); |
8946 |
*tl++ = txdr_unsigned(*lenp); |
|
Lines 9125-9131
nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucre
Link Here
|
| 9125 |
int error; |
9114 |
int error; |
| 9126 |
|
9115 |
|
| 9127 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
9116 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
| 9128 |
NFS_VER4, rcp->minorvers); |
9117 |
NFS_VER4, rcp->minorvers, NULL); |
| 9129 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
9118 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
| 9130 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
9119 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
| 9131 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |
9120 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |