|
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 1060-1067
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1060 |
* in-progress RPCs. |
1061 |
* in-progress RPCs. |
| 1061 |
*/ |
1062 |
*/ |
| 1062 |
tsep = NULL; |
1063 |
tsep = NULL; |
| 1063 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) |
1064 |
if (TAILQ_FIRST(&nmp->nm_sess) != NULL) { |
| 1064 |
tsep = NFSMNT_MDSSESSION(nmp); |
1065 |
tsep = NFSMNT_MDSSESSION(nmp); |
|
|
1066 |
if (tsep->nfsess_defunct == 0) |
| 1067 |
printf("nfsrpc_setclient: " |
| 1068 |
"nfsess_defunct not set\n"); |
| 1069 |
} |
| 1065 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
1070 |
TAILQ_INSERT_HEAD(&nmp->nm_sess, dsp, |
| 1066 |
nfsclds_list); |
1071 |
nfsclds_list); |
| 1067 |
/* |
1072 |
/* |
|
Lines 1103-1109
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1103 |
tsep = NFSMNT_MDSSESSION(nmp); |
1108 |
tsep = NFSMNT_MDSSESSION(nmp); |
| 1104 |
NFSUNLOCKMNT(nmp); |
1109 |
NFSUNLOCKMNT(nmp); |
| 1105 |
|
1110 |
|
| 1106 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0); |
1111 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL, 0, 0, |
|
|
1112 |
NULL); |
| 1107 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
1113 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 1108 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
1114 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); |
| 1109 |
*tl = txdr_unsigned(clp->nfsc_rev); |
1115 |
*tl = txdr_unsigned(clp->nfsc_rev); |
|
Lines 1173-1179
nfsrpc_setclient(struct nfsmount *nmp, struct nfsclcli
Link Here
|
| 1173 |
* and confirm it. |
1179 |
* and confirm it. |
| 1174 |
*/ |
1180 |
*/ |
| 1175 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
1181 |
nfscl_reqstart(nd, NFSPROC_SETCLIENTIDCFRM, nmp, NULL, 0, NULL, |
| 1176 |
NULL, 0, 0); |
1182 |
NULL, 0, 0, NULL); |
| 1177 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
1183 |
NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); |
| 1178 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
1184 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
| 1179 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
1185 |
*tl++ = tsep->nfsess_clientid.lval[1]; |
|
Lines 1204-1210
nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC
Link Here
|
| 1204 |
int error; |
1210 |
int error; |
| 1205 |
nfsattrbit_t attrbits; |
1211 |
nfsattrbit_t attrbits; |
| 1206 |
|
1212 |
|
| 1207 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
1213 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 1208 |
if (nd->nd_flag & ND_NFSV4) { |
1214 |
if (nd->nd_flag & ND_NFSV4) { |
| 1209 |
NFSGETATTR_ATTRBIT(&attrbits); |
1215 |
NFSGETATTR_ATTRBIT(&attrbits); |
| 1210 |
(void) nfsrv_putattrbit(nd, &attrbits); |
1216 |
(void) nfsrv_putattrbit(nd, &attrbits); |
|
Lines 1232-1238
nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp
Link Here
|
| 1232 |
int error, vers = NFS_VER2; |
1238 |
int error, vers = NFS_VER2; |
| 1233 |
nfsattrbit_t attrbits; |
1239 |
nfsattrbit_t attrbits; |
| 1234 |
|
1240 |
|
| 1235 |
nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0); |
1241 |
nfscl_reqstart(nd, NFSPROC_GETATTR, nmp, fhp, fhlen, NULL, NULL, 0, 0, |
|
|
1242 |
cred); |
| 1236 |
if (nd->nd_flag & ND_NFSV4) { |
1243 |
if (nd->nd_flag & ND_NFSV4) { |
| 1237 |
vers = NFS_VER4; |
1244 |
vers = NFS_VER4; |
| 1238 |
NFSGETATTR_ATTRBIT(&attrbits); |
1245 |
NFSGETATTR_ATTRBIT(&attrbits); |
|
Lines 1358-1364
nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap,
Link Here
|
| 1358 |
nfsattrbit_t attrbits; |
1365 |
nfsattrbit_t attrbits; |
| 1359 |
|
1366 |
|
| 1360 |
*attrflagp = 0; |
1367 |
*attrflagp = 0; |
| 1361 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); |
1368 |
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp, cred); |
| 1362 |
if (nd->nd_flag & ND_NFSV4) |
1369 |
if (nd->nd_flag & ND_NFSV4) |
| 1363 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1370 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 1364 |
vap->va_type = vnode_vtype(vp); |
1371 |
vap->va_type = vnode_vtype(vp); |
|
Lines 1426-1434
nfsrpc_lookup(vnode_t dvp, char *name, int len, struct
Link Here
|
| 1426 |
if (NFSHASNFSV4(nmp) && len == 2 && |
1433 |
if (NFSHASNFSV4(nmp) && len == 2 && |
| 1427 |
name[0] == '.' && name[1] == '.') { |
1434 |
name[0] == '.' && name[1] == '.') { |
| 1428 |
lookupp = 1; |
1435 |
lookupp = 1; |
| 1429 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp); |
1436 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, dvp, cred); |
| 1430 |
} else { |
1437 |
} else { |
| 1431 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp); |
1438 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUP, dvp, cred); |
| 1432 |
(void) nfsm_strtom(nd, name, len); |
1439 |
(void) nfsm_strtom(nd, name, len); |
| 1433 |
} |
1440 |
} |
| 1434 |
if (nd->nd_flag & ND_NFSV4) { |
1441 |
if (nd->nd_flag & ND_NFSV4) { |
|
Lines 1504-1510
nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct u
Link Here
|
| 1504 |
int error, len, cangetattr = 1; |
1511 |
int error, len, cangetattr = 1; |
| 1505 |
|
1512 |
|
| 1506 |
*attrflagp = 0; |
1513 |
*attrflagp = 0; |
| 1507 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp); |
1514 |
NFSCL_REQSTART(nd, NFSPROC_READLINK, vp, cred); |
| 1508 |
if (nd->nd_flag & ND_NFSV4) { |
1515 |
if (nd->nd_flag & ND_NFSV4) { |
| 1509 |
/* |
1516 |
/* |
| 1510 |
* And do a Getattr op. |
1517 |
* And do a Getattr op. |
|
Lines 1640-1646
nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct uc
Link Here
|
| 1640 |
while (tsiz > 0) { |
1647 |
while (tsiz > 0) { |
| 1641 |
*attrflagp = 0; |
1648 |
*attrflagp = 0; |
| 1642 |
len = (tsiz > rsize) ? rsize : tsiz; |
1649 |
len = (tsiz > rsize) ? rsize : tsiz; |
| 1643 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp); |
1650 |
NFSCL_REQSTART(nd, NFSPROC_READ, vp, cred); |
| 1644 |
if (nd->nd_flag & ND_NFSV4) |
1651 |
if (nd->nd_flag & ND_NFSV4) |
| 1645 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1652 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 1646 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
1653 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED * 3); |
|
Lines 1818-1824
nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iom
Link Here
|
| 1818 |
while (tsiz > 0) { |
1825 |
while (tsiz > 0) { |
| 1819 |
*attrflagp = 0; |
1826 |
*attrflagp = 0; |
| 1820 |
len = (tsiz > wsize) ? wsize : tsiz; |
1827 |
len = (tsiz > wsize) ? wsize : tsiz; |
| 1821 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp); |
1828 |
NFSCL_REQSTART(nd, NFSPROC_WRITE, vp, cred); |
| 1822 |
if (nd->nd_flag & ND_NFSV4) { |
1829 |
if (nd->nd_flag & ND_NFSV4) { |
| 1823 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
1830 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 1824 |
NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER+2*NFSX_UNSIGNED); |
1831 |
NFSM_BUILD(tl, u_int32_t *, NFSX_HYPER+2*NFSX_UNSIGNED); |
|
Lines 1988-1994
nfsrpc_mknod(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 1988 |
*dattrflagp = 0; |
1995 |
*dattrflagp = 0; |
| 1989 |
if (namelen > NFS_MAXNAMLEN) |
1996 |
if (namelen > NFS_MAXNAMLEN) |
| 1990 |
return (ENAMETOOLONG); |
1997 |
return (ENAMETOOLONG); |
| 1991 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp); |
1998 |
NFSCL_REQSTART(nd, NFSPROC_MKNOD, dvp, cred); |
| 1992 |
if (nd->nd_flag & ND_NFSV4) { |
1999 |
if (nd->nd_flag & ND_NFSV4) { |
| 1993 |
if (vtyp == VBLK || vtyp == VCHR) { |
2000 |
if (vtyp == VBLK || vtyp == VCHR) { |
| 1994 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
2001 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
|
Lines 2138-2144
nfsrpc_createv23(vnode_t dvp, char *name, int namelen,
Link Here
|
| 2138 |
*dattrflagp = 0; |
2145 |
*dattrflagp = 0; |
| 2139 |
if (namelen > NFS_MAXNAMLEN) |
2146 |
if (namelen > NFS_MAXNAMLEN) |
| 2140 |
return (ENAMETOOLONG); |
2147 |
return (ENAMETOOLONG); |
| 2141 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2148 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
| 2142 |
(void) nfsm_strtom(nd, name, namelen); |
2149 |
(void) nfsm_strtom(nd, name, namelen); |
| 2143 |
if (nd->nd_flag & ND_NFSV3) { |
2150 |
if (nd->nd_flag & ND_NFSV3) { |
| 2144 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2151 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
|
Lines 2200-2206
nfsrpc_createv4(vnode_t dvp, char *name, int namelen,
Link Here
|
| 2200 |
*dattrflagp = 0; |
2207 |
*dattrflagp = 0; |
| 2201 |
if (namelen > NFS_MAXNAMLEN) |
2208 |
if (namelen > NFS_MAXNAMLEN) |
| 2202 |
return (ENAMETOOLONG); |
2209 |
return (ENAMETOOLONG); |
| 2203 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp); |
2210 |
NFSCL_REQSTART(nd, NFSPROC_CREATE, dvp, cred); |
| 2204 |
/* |
2211 |
/* |
| 2205 |
* For V4, this is actually an Open op. |
2212 |
* For V4, this is actually an Open op. |
| 2206 |
*/ |
2213 |
*/ |
|
Lines 2441-2447
tryagain:
Link Here
|
| 2441 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
2448 |
if (NFSHASNFSV4(nmp) && ret == 0) { |
| 2442 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
2449 |
ret = nfscl_removedeleg(vp, p, &dstateid); |
| 2443 |
if (ret == 1) { |
2450 |
if (ret == 1) { |
| 2444 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp); |
2451 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGREMOVE, vp, cred); |
| 2445 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
2452 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + |
| 2446 |
NFSX_UNSIGNED); |
2453 |
NFSX_UNSIGNED); |
| 2447 |
if (NFSHASNFSV4N(nmp)) |
2454 |
if (NFSHASNFSV4N(nmp)) |
|
Lines 2462-2468
tryagain:
Link Here
|
| 2462 |
ret = 0; |
2469 |
ret = 0; |
| 2463 |
} |
2470 |
} |
| 2464 |
if (ret == 0) |
2471 |
if (ret == 0) |
| 2465 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp); |
2472 |
NFSCL_REQSTART(nd, NFSPROC_REMOVE, dvp, cred); |
| 2466 |
(void) nfsm_strtom(nd, name, namelen); |
2473 |
(void) nfsm_strtom(nd, name, namelen); |
| 2467 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2474 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
| 2468 |
if (error) |
2475 |
if (error) |
|
Lines 2522-2532
tryagain:
Link Here
|
| 2522 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
2529 |
ret = nfscl_renamedeleg(fvp, &fdstateid, &gotfd, tvp, |
| 2523 |
&tdstateid, &gottd, p); |
2530 |
&tdstateid, &gottd, p); |
| 2524 |
if (gotfd && gottd) { |
2531 |
if (gotfd && gottd) { |
| 2525 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp); |
2532 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME2, fvp, cred); |
| 2526 |
} else if (gotfd) { |
2533 |
} else if (gotfd) { |
| 2527 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp); |
2534 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, fvp, cred); |
| 2528 |
} else if (gottd) { |
2535 |
} else if (gottd) { |
| 2529 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp); |
2536 |
NFSCL_REQSTART(nd, NFSPROC_RETDELEGRENAME1, tvp, cred); |
| 2530 |
} |
2537 |
} |
| 2531 |
if (gotfd) { |
2538 |
if (gotfd) { |
| 2532 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
2539 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
|
Lines 2570-2576
tryagain:
Link Here
|
| 2570 |
ret = 0; |
2577 |
ret = 0; |
| 2571 |
} |
2578 |
} |
| 2572 |
if (ret == 0) |
2579 |
if (ret == 0) |
| 2573 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp); |
2580 |
NFSCL_REQSTART(nd, NFSPROC_RENAME, fdvp, cred); |
| 2574 |
if (nd->nd_flag & ND_NFSV4) { |
2581 |
if (nd->nd_flag & ND_NFSV4) { |
| 2575 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2582 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2576 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
2583 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 2670-2676
nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int n
Link Here
|
| 2670 |
*dattrflagp = 0; |
2677 |
*dattrflagp = 0; |
| 2671 |
if (namelen > NFS_MAXNAMLEN) |
2678 |
if (namelen > NFS_MAXNAMLEN) |
| 2672 |
return (ENAMETOOLONG); |
2679 |
return (ENAMETOOLONG); |
| 2673 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp); |
2680 |
NFSCL_REQSTART(nd, NFSPROC_LINK, vp, cred); |
| 2674 |
if (nd->nd_flag & ND_NFSV4) { |
2681 |
if (nd->nd_flag & ND_NFSV4) { |
| 2675 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2682 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2676 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
2683 |
*tl = txdr_unsigned(NFSV4OP_PUTFH); |
|
Lines 2737-2743
nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c
Link Here
|
| 2737 |
slen = strlen(target); |
2744 |
slen = strlen(target); |
| 2738 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
2745 |
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) |
| 2739 |
return (ENAMETOOLONG); |
2746 |
return (ENAMETOOLONG); |
| 2740 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp); |
2747 |
NFSCL_REQSTART(nd, NFSPROC_SYMLINK, dvp, cred); |
| 2741 |
if (nd->nd_flag & ND_NFSV4) { |
2748 |
if (nd->nd_flag & ND_NFSV4) { |
| 2742 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2749 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2743 |
*tl = txdr_unsigned(NFLNK); |
2750 |
*tl = txdr_unsigned(NFLNK); |
|
Lines 2800-2806
nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 2800 |
fhp = VTONFS(dvp)->n_fhp; |
2807 |
fhp = VTONFS(dvp)->n_fhp; |
| 2801 |
if (namelen > NFS_MAXNAMLEN) |
2808 |
if (namelen > NFS_MAXNAMLEN) |
| 2802 |
return (ENAMETOOLONG); |
2809 |
return (ENAMETOOLONG); |
| 2803 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); |
2810 |
NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp, cred); |
| 2804 |
if (nd->nd_flag & ND_NFSV4) { |
2811 |
if (nd->nd_flag & ND_NFSV4) { |
| 2805 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
2812 |
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
| 2806 |
*tl = txdr_unsigned(NFDIR); |
2813 |
*tl = txdr_unsigned(NFDIR); |
|
Lines 2872-2878
nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str
Link Here
|
| 2872 |
*dattrflagp = 0; |
2879 |
*dattrflagp = 0; |
| 2873 |
if (namelen > NFS_MAXNAMLEN) |
2880 |
if (namelen > NFS_MAXNAMLEN) |
| 2874 |
return (ENAMETOOLONG); |
2881 |
return (ENAMETOOLONG); |
| 2875 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp); |
2882 |
NFSCL_REQSTART(nd, NFSPROC_RMDIR, dvp, cred); |
| 2876 |
(void) nfsm_strtom(nd, name, namelen); |
2883 |
(void) nfsm_strtom(nd, name, namelen); |
| 2877 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
2884 |
error = nfscl_request(nd, dvp, p, cred, dstuff); |
| 2878 |
if (error) |
2885 |
if (error) |
|
Lines 2989-2995
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
| 2989 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
2996 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
| 2990 |
*/ |
2997 |
*/ |
| 2991 |
if (uiop->uio_offset == 0) { |
2998 |
if (uiop->uio_offset == 0) { |
| 2992 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
2999 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
| 2993 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3000 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 2994 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3001 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
| 2995 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3002 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 3106-3112
nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64
Link Here
|
| 3106 |
*/ |
3113 |
*/ |
| 3107 |
while (more_dirs && bigenough) { |
3114 |
while (more_dirs && bigenough) { |
| 3108 |
*attrflagp = 0; |
3115 |
*attrflagp = 0; |
| 3109 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp); |
3116 |
NFSCL_REQSTART(nd, NFSPROC_READDIR, vp, cred); |
| 3110 |
if (nd->nd_flag & ND_NFSV2) { |
3117 |
if (nd->nd_flag & ND_NFSV2) { |
| 3111 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3118 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 3112 |
*tl++ = cookie.lval[1]; |
3119 |
*tl++ = cookie.lval[1]; |
|
Lines 3433-3439
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
| 3433 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
3440 |
* Joy, oh joy. For V4 we get to hand craft '.' and '..'. |
| 3434 |
*/ |
3441 |
*/ |
| 3435 |
if (uiop->uio_offset == 0) { |
3442 |
if (uiop->uio_offset == 0) { |
| 3436 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); |
3443 |
NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp, cred); |
| 3437 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
3444 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 3438 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
3445 |
*tl++ = txdr_unsigned(NFSV4OP_GETFH); |
| 3439 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
3446 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 3555-3561
nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsui
Link Here
|
| 3555 |
*/ |
3562 |
*/ |
| 3556 |
while (more_dirs && bigenough) { |
3563 |
while (more_dirs && bigenough) { |
| 3557 |
*attrflagp = 0; |
3564 |
*attrflagp = 0; |
| 3558 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp); |
3565 |
NFSCL_REQSTART(nd, NFSPROC_READDIRPLUS, vp, cred); |
| 3559 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
3566 |
NFSM_BUILD(tl, u_int32_t *, 6 * NFSX_UNSIGNED); |
| 3560 |
*tl++ = cookie.lval[0]; |
3567 |
*tl++ = cookie.lval[0]; |
| 3561 |
*tl++ = cookie.lval[1]; |
3568 |
*tl++ = cookie.lval[1]; |
|
Lines 3911-3917
nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, st
Link Here
|
| 3911 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
3918 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
| 3912 |
|
3919 |
|
| 3913 |
*attrflagp = 0; |
3920 |
*attrflagp = 0; |
| 3914 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); |
3921 |
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp, cred); |
| 3915 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
3922 |
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED); |
| 3916 |
txdr_hyper(offset, tl); |
3923 |
txdr_hyper(offset, tl); |
| 3917 |
tl += 2; |
3924 |
tl += 2; |
|
Lines 4131-4137
nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp,
Link Here
|
| 4131 |
struct nfsclsession *tsep; |
4138 |
struct nfsclsession *tsep; |
| 4132 |
|
4139 |
|
| 4133 |
nmp = VFSTONFS(vp->v_mount); |
4140 |
nmp = VFSTONFS(vp->v_mount); |
| 4134 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp); |
4141 |
NFSCL_REQSTART(nd, NFSPROC_LOCKT, vp, cred); |
| 4135 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4142 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
| 4136 |
if (fl->l_type == F_RDLCK) |
4143 |
if (fl->l_type == F_RDLCK) |
| 4137 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4144 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
|
Lines 4202-4208
nfsrpc_locku(struct nfsrv_descript *nd, struct nfsmoun
Link Here
|
| 4202 |
int error; |
4209 |
int error; |
| 4203 |
|
4210 |
|
| 4204 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
4211 |
nfscl_reqstart(nd, NFSPROC_LOCKU, nmp, lp->nfsl_open->nfso_fh, |
| 4205 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0); |
4212 |
lp->nfsl_open->nfso_fhlen, NULL, NULL, 0, 0, cred); |
| 4206 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
4213 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); |
| 4207 |
*tl++ = txdr_unsigned(type); |
4214 |
*tl++ = txdr_unsigned(type); |
| 4208 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
4215 |
*tl = txdr_unsigned(lp->nfsl_seqid); |
|
Lines 4254-4260
nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount
Link Here
|
| 4254 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
4261 |
uint8_t own[NFSV4CL_LOCKNAMELEN + NFSX_V4FHMAX]; |
| 4255 |
struct nfsclsession *tsep; |
4262 |
struct nfsclsession *tsep; |
| 4256 |
|
4263 |
|
| 4257 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0); |
4264 |
nfscl_reqstart(nd, NFSPROC_LOCK, nmp, nfhp, fhlen, NULL, NULL, 0, 0, |
|
|
4265 |
cred); |
| 4258 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
4266 |
NFSM_BUILD(tl, u_int32_t *, 7 * NFSX_UNSIGNED); |
| 4259 |
if (type == F_RDLCK) |
4267 |
if (type == F_RDLCK) |
| 4260 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
4268 |
*tl++ = txdr_unsigned(NFSV4LOCKT_READ); |
|
Lines 4349-4355
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
| 4349 |
/* |
4357 |
/* |
| 4350 |
* For V4, you actually do a getattr. |
4358 |
* For V4, you actually do a getattr. |
| 4351 |
*/ |
4359 |
*/ |
| 4352 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4360 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 4353 |
NFSSTATFS_GETATTRBIT(&attrbits); |
4361 |
NFSSTATFS_GETATTRBIT(&attrbits); |
| 4354 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4362 |
(void) nfsrv_putattrbit(nd, &attrbits); |
| 4355 |
nd->nd_flag |= ND_USEGSSNAME; |
4363 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 4372-4378
nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struc
Link Here
|
| 4372 |
if (error) |
4380 |
if (error) |
| 4373 |
goto nfsmout; |
4381 |
goto nfsmout; |
| 4374 |
} else { |
4382 |
} else { |
| 4375 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp); |
4383 |
NFSCL_REQSTART(nd, NFSPROC_FSSTAT, vp, NULL); |
| 4376 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4384 |
error = nfscl_request(nd, vp, p, cred, stuff); |
| 4377 |
if (error) |
4385 |
if (error) |
| 4378 |
return (error); |
4386 |
return (error); |
|
Lines 4428-4434
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
| 4428 |
/* |
4436 |
/* |
| 4429 |
* For V4, you actually do a getattr. |
4437 |
* For V4, you actually do a getattr. |
| 4430 |
*/ |
4438 |
*/ |
| 4431 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp); |
4439 |
NFSCL_REQSTART(nd, NFSPROC_GETATTR, vp, cred); |
| 4432 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
4440 |
NFSPATHCONF_GETATTRBIT(&attrbits); |
| 4433 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4441 |
(void) nfsrv_putattrbit(nd, &attrbits); |
| 4434 |
nd->nd_flag |= ND_USEGSSNAME; |
4442 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 4445-4451
nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
Link Here
|
| 4445 |
error = nd->nd_repstat; |
4453 |
error = nd->nd_repstat; |
| 4446 |
} |
4454 |
} |
| 4447 |
} else { |
4455 |
} else { |
| 4448 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp); |
4456 |
NFSCL_REQSTART(nd, NFSPROC_PATHCONF, vp, NULL); |
| 4449 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4457 |
error = nfscl_request(nd, vp, p, cred, stuff); |
| 4450 |
if (error) |
4458 |
if (error) |
| 4451 |
return (error); |
4459 |
return (error); |
|
Lines 4481-4487
nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struc
Link Here
|
| 4481 |
int error; |
4489 |
int error; |
| 4482 |
|
4490 |
|
| 4483 |
*attrflagp = 0; |
4491 |
*attrflagp = 0; |
| 4484 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp); |
4492 |
NFSCL_REQSTART(nd, NFSPROC_FSINFO, vp, NULL); |
| 4485 |
error = nfscl_request(nd, vp, p, cred, stuff); |
4493 |
error = nfscl_request(nd, vp, p, cred, stuff); |
| 4486 |
if (error) |
4494 |
if (error) |
| 4487 |
return (error); |
4495 |
return (error); |
|
Lines 4528-4537
nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *
Link Here
|
| 4528 |
return (0); |
4536 |
return (0); |
| 4529 |
if (dsp == NULL) |
4537 |
if (dsp == NULL) |
| 4530 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
4538 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, NULL, 0, |
| 4531 |
0); |
4539 |
0, cred); |
| 4532 |
else |
4540 |
else |
| 4533 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
4541 |
nfscl_reqstart(nd, NFSPROC_RENEW, nmp, NULL, 0, NULL, |
| 4534 |
&dsp->nfsclds_sess, 0, 0); |
4542 |
&dsp->nfsclds_sess, 0, 0, NULL); |
| 4535 |
if (!NFSHASNFSV4N(nmp)) { |
4543 |
if (!NFSHASNFSV4N(nmp)) { |
| 4536 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
4544 |
/* NFSv4.1 just uses a Sequence Op and not a Renew. */ |
| 4537 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4545 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
|
Lines 4578-4588
nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo
Link Here
|
| 4578 |
if (NFSHASNFSV4N(nmp)) { |
4586 |
if (NFSHASNFSV4N(nmp)) { |
| 4579 |
/* For NFSv4.1, do a FreeStateID. */ |
4587 |
/* For NFSv4.1, do a FreeStateID. */ |
| 4580 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
4588 |
nfscl_reqstart(nd, NFSPROC_FREESTATEID, nmp, NULL, 0, NULL, |
| 4581 |
NULL, 0, 0); |
4589 |
NULL, 0, 0, cred); |
| 4582 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
4590 |
nfsm_stateidtom(nd, &lp->nfsl_stateid, NFSSTATEID_PUTSTATEID); |
| 4583 |
} else { |
4591 |
} else { |
| 4584 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
4592 |
nfscl_reqstart(nd, NFSPROC_RELEASELCKOWN, nmp, NULL, 0, NULL, |
| 4585 |
NULL, 0, 0); |
4593 |
NULL, 0, 0, NULL); |
| 4586 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
4594 |
NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); |
| 4587 |
tsep = nfsmnt_mdssession(nmp); |
4595 |
tsep = nfsmnt_mdssession(nmp); |
| 4588 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
4596 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
|
Lines 4616-4622
nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpat
Link Here
|
| 4616 |
u_int32_t *opcntp; |
4624 |
u_int32_t *opcntp; |
| 4617 |
|
4625 |
|
| 4618 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
4626 |
nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, |
| 4619 |
0); |
4627 |
0, NULL); |
| 4620 |
cp = dirpath; |
4628 |
cp = dirpath; |
| 4621 |
cnt = 0; |
4629 |
cnt = 0; |
| 4622 |
do { |
4630 |
do { |
|
Lines 4683-4689
nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred
Link Here
|
| 4683 |
int error; |
4691 |
int error; |
| 4684 |
|
4692 |
|
| 4685 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
4693 |
nfscl_reqstart(nd, NFSPROC_DELEGRETURN, nmp, dp->nfsdl_fh, |
| 4686 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0); |
4694 |
dp->nfsdl_fhlen, NULL, NULL, 0, 0, cred); |
| 4687 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
4695 |
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID); |
| 4688 |
if (NFSHASNFSV4N(nmp)) |
4696 |
if (NFSHASNFSV4N(nmp)) |
| 4689 |
*tl++ = 0; |
4697 |
*tl++ = 0; |
|
Lines 4717-4723
nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_
Link Here
|
| 4717 |
|
4725 |
|
| 4718 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
4726 |
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) |
| 4719 |
return (EOPNOTSUPP); |
4727 |
return (EOPNOTSUPP); |
| 4720 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp); |
4728 |
NFSCL_REQSTART(nd, NFSPROC_GETACL, vp, cred); |
| 4721 |
NFSZERO_ATTRBIT(&attrbits); |
4729 |
NFSZERO_ATTRBIT(&attrbits); |
| 4722 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
4730 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
| 4723 |
(void) nfsrv_putattrbit(nd, &attrbits); |
4731 |
(void) nfsrv_putattrbit(nd, &attrbits); |
|
Lines 4763-4769
nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPR
Link Here
|
| 4763 |
|
4771 |
|
| 4764 |
if (!NFSHASNFSV4(nmp)) |
4772 |
if (!NFSHASNFSV4(nmp)) |
| 4765 |
return (EOPNOTSUPP); |
4773 |
return (EOPNOTSUPP); |
| 4766 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp); |
4774 |
NFSCL_REQSTART(nd, NFSPROC_SETACL, vp, cred); |
| 4767 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
4775 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 4768 |
NFSZERO_ATTRBIT(&attrbits); |
4776 |
NFSZERO_ATTRBIT(&attrbits); |
| 4769 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
4777 |
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); |
|
Lines 4796-4802
nfsrpc_exchangeid(struct nfsmount *nmp, struct nfsclcl
Link Here
|
| 4796 |
if (minorvers == 0) |
4804 |
if (minorvers == 0) |
| 4797 |
minorvers = nmp->nm_minorvers; |
4805 |
minorvers = nmp->nm_minorvers; |
| 4798 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
4806 |
nfscl_reqstart(nd, NFSPROC_EXCHANGEID, nmp, NULL, 0, NULL, NULL, |
| 4799 |
NFS_VER4, minorvers); |
4807 |
NFS_VER4, minorvers, NULL); |
| 4800 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
4808 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
| 4801 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
4809 |
*tl++ = txdr_unsigned(nfsboottime.tv_sec); /* Client owner */ |
| 4802 |
*tl = txdr_unsigned(clp->nfsc_rev); |
4810 |
*tl = txdr_unsigned(clp->nfsc_rev); |
|
Lines 4892-4898
nfsrpc_createsession(struct nfsmount *nmp, struct nfsc
Link Here
|
| 4892 |
else |
4900 |
else |
| 4893 |
minorvers = NFSV41_MINORVERSION; |
4901 |
minorvers = NFSV41_MINORVERSION; |
| 4894 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
4902 |
nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL, |
| 4895 |
NFS_VER4, minorvers); |
4903 |
NFS_VER4, minorvers, NULL); |
| 4896 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
4904 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
| 4897 |
*tl++ = sep->nfsess_clientid.lval[0]; |
4905 |
*tl++ = sep->nfsess_clientid.lval[0]; |
| 4898 |
*tl++ = sep->nfsess_clientid.lval[1]; |
4906 |
*tl++ = sep->nfsess_clientid.lval[1]; |
|
Lines 5010-5043
nfsmout:
Link Here
|
| 5010 |
} |
5018 |
} |
| 5011 |
|
5019 |
|
| 5012 |
/* |
5020 |
/* |
| 5013 |
* Do the NFSv4.1 Destroy Session. |
|
|
| 5014 |
*/ |
| 5015 |
int |
| 5016 |
nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp, |
| 5017 |
struct ucred *cred, NFSPROC_T *p) |
| 5018 |
{ |
| 5019 |
uint32_t *tl; |
| 5020 |
struct nfsrv_descript nfsd; |
| 5021 |
struct nfsrv_descript *nd = &nfsd; |
| 5022 |
int error; |
| 5023 |
struct nfsclsession *tsep; |
| 5024 |
|
| 5025 |
nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, |
| 5026 |
0); |
| 5027 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); |
| 5028 |
tsep = nfsmnt_mdssession(nmp); |
| 5029 |
bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); |
| 5030 |
nd->nd_flag |= ND_USEGSSNAME; |
| 5031 |
error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, |
| 5032 |
NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); |
| 5033 |
if (error != 0) |
| 5034 |
return (error); |
| 5035 |
error = nd->nd_repstat; |
| 5036 |
m_freem(nd->nd_mrep); |
| 5037 |
return (error); |
| 5038 |
} |
| 5039 |
|
| 5040 |
/* |
| 5041 |
* Do the NFSv4.1 Destroy Client. |
5021 |
* Do the NFSv4.1 Destroy Client. |
| 5042 |
*/ |
5022 |
*/ |
| 5043 |
int |
5023 |
int |
|
Lines 5051-5057
nfsrpc_destroyclient(struct nfsmount *nmp, struct nfsc
Link Here
|
| 5051 |
struct nfsclsession *tsep; |
5031 |
struct nfsclsession *tsep; |
| 5052 |
|
5032 |
|
| 5053 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
5033 |
nfscl_reqstart(nd, NFSPROC_DESTROYCLIENT, nmp, NULL, 0, NULL, NULL, 0, |
| 5054 |
0); |
5034 |
0, NULL); |
| 5055 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
5035 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); |
| 5056 |
tsep = nfsmnt_mdssession(nmp); |
5036 |
tsep = nfsmnt_mdssession(nmp); |
| 5057 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
5037 |
*tl++ = tsep->nfsess_clientid.lval[0]; |
|
Lines 5080-5086
nfsrpc_layoutget(struct nfsmount *nmp, uint8_t *fhp, i
Link Here
|
| 5080 |
int error; |
5060 |
int error; |
| 5081 |
|
5061 |
|
| 5082 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
5062 |
nfscl_reqstart(nd, NFSPROC_LAYOUTGET, nmp, fhp, fhlen, NULL, NULL, 0, |
| 5083 |
0); |
5063 |
0, cred); |
| 5084 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
5064 |
nfsrv_setuplayoutget(nd, iomode, offset, len, minlen, stateidp, |
| 5085 |
layouttype, layoutlen, 0); |
5065 |
layouttype, layoutlen, 0); |
| 5086 |
nd->nd_flag |= ND_USEGSSNAME; |
5066 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 5124-5130
nfsrpc_getdeviceinfo(struct nfsmount *nmp, uint8_t *de
Link Here
|
| 5124 |
ndi = NULL; |
5104 |
ndi = NULL; |
| 5125 |
gotdspp = NULL; |
5105 |
gotdspp = NULL; |
| 5126 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
5106 |
nfscl_reqstart(nd, NFSPROC_GETDEVICEINFO, nmp, NULL, 0, NULL, NULL, 0, |
| 5127 |
0); |
5107 |
0, cred); |
| 5128 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5108 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
| 5129 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
5109 |
NFSBCOPY(deviceid, tl, NFSX_V4DEVICEID); |
| 5130 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
5110 |
tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); |
|
Lines 5345-5351
nfsrpc_layoutcommit(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5345 |
int error; |
5325 |
int error; |
| 5346 |
|
5326 |
|
| 5347 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
5327 |
nfscl_reqstart(nd, NFSPROC_LAYOUTCOMMIT, nmp, fh, fhlen, NULL, NULL, |
| 5348 |
0, 0); |
5328 |
0, 0, cred); |
| 5349 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
5329 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED + 3 * NFSX_HYPER + |
| 5350 |
NFSX_STATEID); |
5330 |
NFSX_STATEID); |
| 5351 |
txdr_hyper(off, tl); |
5331 |
txdr_hyper(off, tl); |
|
Lines 5396-5402
nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5396 |
int error; |
5376 |
int error; |
| 5397 |
|
5377 |
|
| 5398 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
5378 |
nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, |
| 5399 |
0, 0); |
5379 |
0, 0, cred); |
| 5400 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
5380 |
NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED); |
| 5401 |
if (reclaim != 0) |
5381 |
if (reclaim != 0) |
| 5402 |
*tl++ = newnfs_true; |
5382 |
*tl++ = newnfs_true; |
|
Lines 5482-5488
nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh,
Link Here
|
| 5482 |
int error; |
5462 |
int error; |
| 5483 |
|
5463 |
|
| 5484 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
5464 |
nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, |
| 5485 |
0, 0); |
5465 |
0, 0, cred); |
| 5486 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
5466 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + |
| 5487 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
5467 |
NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); |
| 5488 |
txdr_hyper(offset, tl); tl += 2; |
5468 |
txdr_hyper(offset, tl); tl += 2; |
|
Lines 5791-5797
nfsrpc_reclaimcomplete(struct nfsmount *nmp, struct uc
Link Here
|
| 5791 |
int error; |
5771 |
int error; |
| 5792 |
|
5772 |
|
| 5793 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
5773 |
nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL, 0, |
| 5794 |
0); |
5774 |
0, cred); |
| 5795 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
5775 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 5796 |
*tl = newnfs_false; |
5776 |
*tl = newnfs_false; |
| 5797 |
nd->nd_flag |= ND_USEGSSNAME; |
5777 |
nd->nd_flag |= ND_USEGSSNAME; |
|
Lines 5820-5825
nfscl_initsessionslots(struct nfsclsession *sep)
Link Here
|
| 5820 |
for (i = 0; i < 64; i++) |
5800 |
for (i = 0; i < 64; i++) |
| 5821 |
sep->nfsess_slotseq[i] = 0; |
5801 |
sep->nfsess_slotseq[i] = 0; |
| 5822 |
sep->nfsess_slots = 0; |
5802 |
sep->nfsess_slots = 0; |
|
|
5803 |
sep->nfsess_badslots = 0; |
| 5823 |
} |
5804 |
} |
| 5824 |
|
5805 |
|
| 5825 |
/* |
5806 |
/* |
|
Lines 6414-6420
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
| 6414 |
nd->nd_mrep = NULL; |
6395 |
nd->nd_mrep = NULL; |
| 6415 |
if (vers == 0 || vers == NFS_VER4) { |
6396 |
if (vers == 0 || vers == NFS_VER4) { |
| 6416 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
6397 |
nfscl_reqstart(nd, NFSPROC_READDS, nmp, fhp->nfh_fh, |
| 6417 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6398 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6399 |
NULL); |
| 6418 |
vers = NFS_VER4; |
6400 |
vers = NFS_VER4; |
| 6419 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
6401 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers4 minvers=%d\n", minorvers); |
| 6420 |
if (flex != 0) |
6402 |
if (flex != 0) |
|
Lines 6423-6429
nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4state
Link Here
|
| 6423 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
6405 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSEQIDZERO); |
| 6424 |
} else { |
6406 |
} else { |
| 6425 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
6407 |
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh, |
| 6426 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6408 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6409 |
NULL); |
| 6427 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
6410 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]); |
| 6428 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
6411 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]); |
| 6429 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
6412 |
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n"); |
|
Lines 6490-6496
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
| 6490 |
nd->nd_mrep = NULL; |
6473 |
nd->nd_mrep = NULL; |
| 6491 |
if (vers == 0 || vers == NFS_VER4) { |
6474 |
if (vers == 0 || vers == NFS_VER4) { |
| 6492 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6475 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
| 6493 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6476 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6477 |
NULL); |
| 6494 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
6478 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers4 minvers=%d\n", minorvers); |
| 6495 |
vers = NFS_VER4; |
6479 |
vers = NFS_VER4; |
| 6496 |
if (flex != 0) |
6480 |
if (flex != 0) |
|
Lines 6500-6506
nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomo
Link Here
|
| 6500 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6484 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 6501 |
} else { |
6485 |
} else { |
| 6502 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6486 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
| 6503 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6487 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6488 |
NULL); |
| 6504 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6489 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
| 6505 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6490 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
| 6506 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
6491 |
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n"); |
|
Lines 6623-6629
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
| 6623 |
nd->nd_mrep = NULL; |
6608 |
nd->nd_mrep = NULL; |
| 6624 |
if (vers == 0 || vers == NFS_VER4) { |
6609 |
if (vers == 0 || vers == NFS_VER4) { |
| 6625 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
6610 |
nfscl_reqstart(nd, NFSPROC_WRITEDS, nmp, fhp->nfh_fh, |
| 6626 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6611 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6612 |
NULL); |
| 6627 |
vers = NFS_VER4; |
6613 |
vers = NFS_VER4; |
| 6628 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
6614 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers4 minvers=%d\n", |
| 6629 |
minorvers); |
6615 |
minorvers); |
|
Lines 6631-6637
nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_c
Link Here
|
| 6631 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
6617 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 6632 |
} else { |
6618 |
} else { |
| 6633 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
6619 |
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh, |
| 6634 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6620 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6621 |
NULL); |
| 6635 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
6622 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]); |
| 6636 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
6623 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]); |
| 6637 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
6624 |
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n"); |
|
Lines 6851-6861
nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
| 6851 |
nd->nd_mrep = NULL; |
6838 |
nd->nd_mrep = NULL; |
| 6852 |
if (vers == 0 || vers == NFS_VER4) { |
6839 |
if (vers == 0 || vers == NFS_VER4) { |
| 6853 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
6840 |
nfscl_reqstart(nd, NFSPROC_COMMITDS, nmp, fhp->nfh_fh, |
| 6854 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6841 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6842 |
NULL); |
| 6855 |
vers = NFS_VER4; |
6843 |
vers = NFS_VER4; |
| 6856 |
} else { |
6844 |
} else { |
| 6857 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
6845 |
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh, |
| 6858 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
6846 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, |
|
|
6847 |
NULL); |
| 6859 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
6848 |
NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]); |
| 6860 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
6849 |
NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]); |
| 6861 |
} |
6850 |
} |
|
Lines 6970-6976
nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt,
Link Here
|
| 6970 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
6959 |
NFSSETBIT_ATTRBIT(&hints, NFSV4IOHINT_DONTNEED); |
| 6971 |
else |
6960 |
else |
| 6972 |
return (0); |
6961 |
return (0); |
| 6973 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp); |
6962 |
NFSCL_REQSTART(nd, NFSPROC_IOADVISE, vp, cred); |
| 6974 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
6963 |
nfsm_stateidtom(nd, NULL, NFSSTATEID_PUTALLZERO); |
| 6975 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
6964 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER); |
| 6976 |
txdr_hyper(offset, tl); |
6965 |
txdr_hyper(offset, tl); |
|
Lines 7014-7020
nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt,
Link Here
|
| 7014 |
return (0); |
7003 |
return (0); |
| 7015 |
nd->nd_mrep = NULL; |
7004 |
nd->nd_mrep = NULL; |
| 7016 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
7005 |
nfscl_reqstart(nd, NFSPROC_IOADVISEDS, nmp, fhp->nfh_fh, |
| 7017 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers); |
7006 |
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers, NULL); |
| 7018 |
vers = NFS_VER4; |
7007 |
vers = NFS_VER4; |
| 7019 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
7008 |
NFSCL_DEBUG(4, "nfsrpc_adviseds: vers=%d minvers=%d\n", vers, |
| 7020 |
minorvers); |
7009 |
minorvers); |
|
Lines 7184-7190
nfsrpc_allocaterpc(vnode_t vp, off_t off, off_t len, n
Link Here
|
| 7184 |
nfsattrbit_t attrbits; |
7173 |
nfsattrbit_t attrbits; |
| 7185 |
|
7174 |
|
| 7186 |
*attrflagp = 0; |
7175 |
*attrflagp = 0; |
| 7187 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp); |
7176 |
NFSCL_REQSTART(nd, NFSPROC_ALLOCATE, vp, cred); |
| 7188 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
7177 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 7189 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
7178 |
NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_UNSIGNED); |
| 7190 |
txdr_hyper(off, tl); tl += 2; |
7179 |
txdr_hyper(off, tl); tl += 2; |
|
Lines 7672-7678
nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp,
Link Here
|
| 7672 |
*dpp = NULL; |
7661 |
*dpp = NULL; |
| 7673 |
*laystatp = ENXIO; |
7662 |
*laystatp = ENXIO; |
| 7674 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
7663 |
nfscl_reqstart(nd, NFSPROC_OPENLAYGET, nmp, nfhp, fhlen, NULL, NULL, |
| 7675 |
0, 0); |
7664 |
0, 0, cred); |
| 7676 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
7665 |
NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); |
| 7677 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
7666 |
*tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); |
| 7678 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
7667 |
*tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); |
|
Lines 7857-7863
nfsrpc_createlayout(vnode_t dvp, char *name, int namel
Link Here
|
| 7857 |
*dattrflagp = 0; |
7846 |
*dattrflagp = 0; |
| 7858 |
if (namelen > NFS_MAXNAMLEN) |
7847 |
if (namelen > NFS_MAXNAMLEN) |
| 7859 |
return (ENAMETOOLONG); |
7848 |
return (ENAMETOOLONG); |
| 7860 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp); |
7849 |
NFSCL_REQSTART(nd, NFSPROC_CREATELAYGET, dvp, cred); |
| 7861 |
/* |
7850 |
/* |
| 7862 |
* For V4, this is actually an Open op. |
7851 |
* For V4, this is actually an Open op. |
| 7863 |
*/ |
7852 |
*/ |
|
Lines 8069-8075
nfsrpc_createlayout(vnode_t dvp, char *name, int namel
Link Here
|
| 8069 |
} |
8058 |
} |
| 8070 |
if (nd->nd_repstat != 0 && error == 0) |
8059 |
if (nd->nd_repstat != 0 && error == 0) |
| 8071 |
error = nd->nd_repstat; |
8060 |
error = nd->nd_repstat; |
| 8072 |
if (error == NFSERR_STALECLIENTID || error == NFSERR_BADSESSION) |
8061 |
if (error == NFSERR_STALECLIENTID) |
| 8073 |
nfscl_initiate_recovery(owp->nfsow_clp); |
8062 |
nfscl_initiate_recovery(owp->nfsow_clp); |
| 8074 |
nfsmout: |
8063 |
nfsmout: |
| 8075 |
NFSCL_DEBUG(4, "eo nfsrpc_createlayout err=%d\n", error); |
8064 |
NFSCL_DEBUG(4, "eo nfsrpc_createlayout err=%d\n", error); |
|
Lines 8298-8304
nfsrpc_copyrpc(vnode_t invp, off_t inoff, vnode_t outv
Link Here
|
| 8298 |
*lenp = 0; |
8287 |
*lenp = 0; |
| 8299 |
if (len > nfs_maxcopyrange) |
8288 |
if (len > nfs_maxcopyrange) |
| 8300 |
len = nfs_maxcopyrange; |
8289 |
len = nfs_maxcopyrange; |
| 8301 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp); |
8290 |
NFSCL_REQSTART(nd, NFSPROC_COPY, invp, cred); |
| 8302 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8291 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8303 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8292 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
| 8304 |
NFSGETATTR_ATTRBIT(&attrbits); |
8293 |
NFSGETATTR_ATTRBIT(&attrbits); |
|
Lines 8463-8469
nfsrpc_seekrpc(vnode_t vp, off_t *offp, nfsv4stateid_t
Link Here
|
| 8463 |
nfsattrbit_t attrbits; |
8452 |
nfsattrbit_t attrbits; |
| 8464 |
|
8453 |
|
| 8465 |
*attrflagp = 0; |
8454 |
*attrflagp = 0; |
| 8466 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp); |
8455 |
NFSCL_REQSTART(nd, NFSPROC_SEEK, vp, cred); |
| 8467 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
8456 |
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); |
| 8468 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8457 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 8469 |
txdr_hyper(*offp, tl); tl += 2; |
8458 |
txdr_hyper(*offp, tl); tl += 2; |
|
Lines 8507-8513
nfsrpc_getextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8507 |
uint32_t len, len2; |
8496 |
uint32_t len, len2; |
| 8508 |
|
8497 |
|
| 8509 |
*attrflagp = 0; |
8498 |
*attrflagp = 0; |
| 8510 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp); |
8499 |
NFSCL_REQSTART(nd, NFSPROC_GETEXTATTR, vp, cred); |
| 8511 |
nfsm_strtom(nd, name, strlen(name)); |
8500 |
nfsm_strtom(nd, name, strlen(name)); |
| 8512 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8501 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8513 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8502 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 8577-8583
nfsrpc_setextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8577 |
nfsattrbit_t attrbits; |
8566 |
nfsattrbit_t attrbits; |
| 8578 |
|
8567 |
|
| 8579 |
*attrflagp = 0; |
8568 |
*attrflagp = 0; |
| 8580 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp); |
8569 |
NFSCL_REQSTART(nd, NFSPROC_SETEXTATTR, vp, cred); |
| 8581 |
if (uiop->uio_resid > nd->nd_maxreq) { |
8570 |
if (uiop->uio_resid > nd->nd_maxreq) { |
| 8582 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
8571 |
/* nd_maxreq is set by NFSCL_REQSTART(). */ |
| 8583 |
m_freem(nd->nd_mreq); |
8572 |
m_freem(nd->nd_mreq); |
|
Lines 8625-8631
nfsrpc_rmextattr(vnode_t vp, const char *name, struct
Link Here
|
| 8625 |
nfsattrbit_t attrbits; |
8614 |
nfsattrbit_t attrbits; |
| 8626 |
|
8615 |
|
| 8627 |
*attrflagp = 0; |
8616 |
*attrflagp = 0; |
| 8628 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp); |
8617 |
NFSCL_REQSTART(nd, NFSPROC_RMEXTATTR, vp, cred); |
| 8629 |
nfsm_strtom(nd, name, strlen(name)); |
8618 |
nfsm_strtom(nd, name, strlen(name)); |
| 8630 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
8619 |
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); |
| 8631 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
8620 |
*tl = txdr_unsigned(NFSV4OP_GETATTR); |
|
Lines 8665-8671
nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, stru
Link Here
|
| 8665 |
u_char c; |
8654 |
u_char c; |
| 8666 |
|
8655 |
|
| 8667 |
*attrflagp = 0; |
8656 |
*attrflagp = 0; |
| 8668 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp); |
8657 |
NFSCL_REQSTART(nd, NFSPROC_LISTEXTATTR, vp, cred); |
| 8669 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
8658 |
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 2 * NFSX_UNSIGNED); |
| 8670 |
txdr_hyper(*cookiep, tl); tl += 2; |
8659 |
txdr_hyper(*cookiep, tl); tl += 2; |
| 8671 |
*tl++ = txdr_unsigned(*lenp); |
8660 |
*tl++ = txdr_unsigned(*lenp); |
|
Lines 8839-8845
nfsrpc_bindconnsess(CLIENT *cl, void *arg, struct ucre
Link Here
|
| 8839 |
int error; |
8828 |
int error; |
| 8840 |
|
8829 |
|
| 8841 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
8830 |
nfscl_reqstart(nd, NFSPROC_BINDCONNTOSESS, NULL, NULL, 0, NULL, NULL, |
| 8842 |
NFS_VER4, rcp->minorvers); |
8831 |
NFS_VER4, rcp->minorvers, NULL); |
| 8843 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
8832 |
NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 2 * NFSX_UNSIGNED); |
| 8844 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
8833 |
memcpy(tl, rcp->sessionid, NFSX_V4SESSIONID); |
| 8845 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |
8834 |
tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; |