Lines Matching refs:cs
204 struct svc_req *req, struct compound_state *cs);
253 struct svc_req *req, struct compound_state *cs);
257 struct svc_req *req, struct compound_state *cs);
260 struct svc_req *req, compound_state_t *cs);
263 struct svc_req *req, struct compound_state *cs);
266 struct svc_req *req, compound_state_t *cs);
269 struct svc_req *req, compound_state_t *cs);
272 struct svc_req *req, compound_state_t *cs);
275 struct svc_req *req, compound_state_t *cs);
297 struct compound_state *cs, struct nfs4_svgetit_arg *sargp,
765 rfs4_init_compound_state(struct compound_state *cs) in rfs4_init_compound_state() argument
767 bzero(cs, sizeof (*cs)); in rfs4_init_compound_state()
768 cs->cont = TRUE; in rfs4_init_compound_state()
769 cs->access = CS_ACCESS_DENIED; in rfs4_init_compound_state()
770 cs->deleg = FALSE; in rfs4_init_compound_state()
771 cs->mandlock = FALSE; in rfs4_init_compound_state()
772 cs->fh.nfs_fh4_val = cs->fhbuf; in rfs4_init_compound_state()
777 rfs4_fini_compound_state(struct compound_state *cs) in rfs4_fini_compound_state() argument
779 if (cs->vp) { in rfs4_fini_compound_state()
780 VN_RELE(cs->vp); in rfs4_fini_compound_state()
782 if (cs->saved_vp) { in rfs4_fini_compound_state()
783 VN_RELE(cs->saved_vp); in rfs4_fini_compound_state()
785 if (cs->cr) { in rfs4_fini_compound_state()
786 crfree(cs->cr); in rfs4_fini_compound_state()
788 if (cs->saved_fh.nfs_fh4_val) { in rfs4_fini_compound_state()
789 kmem_free(cs->saved_fh.nfs_fh4_val, NFS4_FHSIZE); in rfs4_fini_compound_state()
791 if (cs->sp) { in rfs4_fini_compound_state()
792 rfs4x_session_rele(cs->sp); in rfs4_fini_compound_state()
1067 struct compound_state *cs) in rfs4_op_inval() argument
1069 *cs->statusp = *((nfsstat4 *)&(resop)->nfs_resop4_u) = NFS4ERR_INVAL; in rfs4_op_inval()
1093 do_rfs4_op_secinfo(struct compound_state *cs, char *nm, SECINFO4res *resp) in do_rfs4_op_secinfo() argument
1107 dvp = cs->vp; in do_rfs4_op_secinfo()
1108 exi = cs->exi; in do_rfs4_op_secinfo()
1158 error = VOP_LOOKUP(dvp, nm, &vp, NULL, 0, NULL, cs->cr, in do_rfs4_op_secinfo()
1170 (PSEUDO(exi) || !is_exported_sec(cs->nfsflavor, exi) || in do_rfs4_op_secinfo()
1171 cs->access & CS_ACCESS_LIMITED)) { in do_rfs4_op_secinfo()
1216 exi = nfs_vptoexi(NULL, vp, cs->cr, &walk, NULL, TRUE); in do_rfs4_op_secinfo()
1229 exi = cs->exi; in do_rfs4_op_secinfo()
1291 access = nfsauth4_secinfo_access(exi, cs->req, in do_rfs4_op_secinfo()
1292 flavor, perm, cs->basecr); in do_rfs4_op_secinfo()
1353 struct compound_state *cs) in rfs4_op_secinfo() argument
1364 DTRACE_NFSV4_2(op__secinfo__start, struct compound_state *, cs, in rfs4_op_secinfo()
1371 if (cs->vp == NULL) { in rfs4_op_secinfo()
1372 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_secinfo()
1376 if (cs->vp->v_type != VDIR) { in rfs4_op_secinfo()
1377 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_secinfo()
1391 *cs->statusp = resp->status = status; in rfs4_op_secinfo()
1398 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_secinfo()
1403 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_secinfo()
1409 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_op_secinfo()
1413 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_secinfo()
1418 *cs->statusp = resp->status = do_rfs4_op_secinfo(cs, name, resp); in rfs4_op_secinfo()
1420 if (resp->status == NFS4_OK && rfs4_has_session(cs)) { in rfs4_op_secinfo()
1435 VN_RELE(cs->vp); in rfs4_op_secinfo()
1436 cs->vp = NULL; in rfs4_op_secinfo()
1444 DTRACE_NFSV4_2(op__secinfo__done, struct compound_state *, cs, in rfs4_op_secinfo()
1484 struct compound_state *cs) in rfs4_op_access() argument
1492 cred_t *cr = cs->cr; in rfs4_op_access()
1497 DTRACE_NFSV4_2(op__access__start, struct compound_state *, cs, in rfs4_op_access()
1501 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_access()
1502 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_access()
1506 if (cs->vp == NULL) { in rfs4_op_access()
1507 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_access()
1513 vp = cs->vp; in rfs4_op_access()
1521 if (rdonly4(req, cs) && in rfs4_op_access()
1537 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_access()
1550 if ((tslabel = nfs_getflabel(vp, cs->exi)) == NULL) { in rfs4_op_access()
1551 *cs->statusp = resp->status = puterrno4(EACCES); in rfs4_op_access()
1611 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_access()
1613 DTRACE_NFSV4_2(op__access__done, struct compound_state *, cs, in rfs4_op_access()
1620 struct compound_state *cs) in rfs4_op_commit() argument
1625 vnode_t *vp = cs->vp; in rfs4_op_commit()
1626 cred_t *cr = cs->cr; in rfs4_op_commit()
1630 DTRACE_NFSV4_2(op__commit__start, struct compound_state *, cs, in rfs4_op_commit()
1634 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_commit()
1637 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_commit()
1638 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_commit()
1643 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_commit()
1655 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_commit()
1658 if (rdonly4(req, cs)) { in rfs4_op_commit()
1659 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_commit()
1668 *cs->statusp = resp->status; in rfs4_op_commit()
1673 (error = VOP_ACCESS(vp, VWRITE, 0, cs->cr, NULL))) { in rfs4_op_commit()
1674 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_commit()
1681 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_commit()
1686 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_commit()
1689 DTRACE_NFSV4_2(op__commit__done, struct compound_state *, cs, in rfs4_op_commit()
1700 struct compound_state *cs, vattr_t *vap, char *nm) in do_rfs4_op_mknod() argument
1703 cred_t *cr = cs->cr; in do_rfs4_op_mknod()
1704 vnode_t *dvp = cs->vp; in do_rfs4_op_mknod()
1713 *cs->statusp = resp->status = NFS4ERR_PERM; in do_rfs4_op_mknod()
1731 *cs->statusp = resp->status = NFS4ERR_BADTYPE; in do_rfs4_op_mknod()
1739 *cs->statusp = resp->status = NFS4ERR_INVAL; in do_rfs4_op_mknod()
1749 *cs->statusp = resp->status = puterrno4(error); in do_rfs4_op_mknod()
1762 struct compound_state *cs) in rfs4_op_create() argument
1768 cred_t *cr = cs->cr; in rfs4_op_create()
1769 vnode_t *dvp = cs->vp; in rfs4_op_create()
1783 DTRACE_NFSV4_2(op__create__start, struct compound_state *, cs, in rfs4_op_create()
1789 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_create()
1798 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_create()
1812 *cs->statusp = resp->status = NFS4ERR_BADTYPE; in rfs4_op_create()
1816 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_create()
1817 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_create()
1821 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_create()
1826 *cs->statusp = resp->status = status; in rfs4_op_create()
1830 if (rdonly4(req, cs)) { in rfs4_op_create()
1831 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_create()
1840 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_create()
1845 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_create()
1851 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_op_create()
1855 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_create()
1867 &args->createattrs, cs, &sarg, &ntov, NFS4ATTR_SETIT); in rfs4_op_create()
1873 *cs->statusp = resp->status = status; in rfs4_op_create()
1886 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_create()
1929 if (VOP_GETATTR(dvp, &iva, 0, cs->cr, NULL)) in rfs4_op_create()
1946 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_create()
1956 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_create()
1966 lname = nfscmd_convname(ca, cs->exi, lnm, in rfs4_op_create()
1970 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_create()
1992 if (VOP_GETATTR(dvp, &iva, 0, cs->cr, NULL)) in rfs4_op_create()
2005 if (VOP_GETATTR(dvp, &iva2, 0, cs->cr, NULL) || in rfs4_op_create()
2021 vp = do_rfs4_op_mknod(args, resp, req, cs, vap, name); in rfs4_op_create()
2037 if (VOP_GETATTR(dvp, &iva, 0, cs->cr, NULL)) in rfs4_op_create()
2047 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_create()
2098 error = makefh4(&cs->fh, vp, cs->exi); in rfs4_op_create()
2100 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_create()
2129 if (cs->vp) in rfs4_op_create()
2130 VN_RELE(cs->vp); in rfs4_op_create()
2132 cs->vp = vp; in rfs4_op_create()
2133 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_create()
2135 DTRACE_NFSV4_2(op__create__done, struct compound_state *, cs, in rfs4_op_create()
2142 struct compound_state *cs) in rfs4_op_delegpurge() argument
2144 DTRACE_NFSV4_2(op__delegpurge__start, struct compound_state *, cs, in rfs4_op_delegpurge()
2147 rfs4_op_inval(argop, resop, req, cs); in rfs4_op_delegpurge()
2149 DTRACE_NFSV4_2(op__delegpurge__done, struct compound_state *, cs, in rfs4_op_delegpurge()
2156 struct compound_state *cs) in rfs4_op_delegreturn() argument
2163 DTRACE_NFSV4_2(op__delegreturn__start, struct compound_state *, cs, in rfs4_op_delegreturn()
2167 resp->status = *cs->statusp = status; in rfs4_op_delegreturn()
2172 if (cs->vp != dsp->rds_finfo->rf_vp) { in rfs4_op_delegreturn()
2173 resp->status = *cs->statusp = NFS4ERR_BAD_STATEID; in rfs4_op_delegreturn()
2181 DTRACE_NFSV4_2(op__delegreturn__done, struct compound_state *, cs, in rfs4_op_delegreturn()
2224 secinfo_match_or_authnone(struct compound_state *cs) in secinfo_match_or_authnone() argument
2233 sp = cs->exi->exi_export.ex_secinfo; in secinfo_match_or_authnone()
2234 for (i = 0; i < cs->exi->exi_export.ex_seccnt; i++) { in secinfo_match_or_authnone()
2235 if (cs->nfsflavor == sp[i].s_secinfo.sc_nfsnum || in secinfo_match_or_authnone()
2247 call_checkauth4(struct compound_state *cs, struct svc_req *req) in call_checkauth4() argument
2255 if (!secinfo_match_or_authnone(cs)) { in call_checkauth4()
2256 *cs->statusp = NFS4ERR_WRONGSEC; in call_checkauth4()
2257 return (*cs->statusp); in call_checkauth4()
2260 authres = checkauth4(cs, req); in call_checkauth4()
2263 *cs->statusp = NFS4_OK; in call_checkauth4()
2264 if (! (cs->access & CS_ACCESS_LIMITED)) in call_checkauth4()
2265 cs->access = CS_ACCESS_OK; in call_checkauth4()
2267 *cs->statusp = NFS4ERR_ACCESS; in call_checkauth4()
2269 *cs->statusp = NFS4ERR_WRONGSEC; in call_checkauth4()
2271 *cs->statusp = NFS4ERR_DELAY; in call_checkauth4()
2273 return (*cs->statusp); in call_checkauth4()
2293 if (sargp->cs->vp) in bitmap4_to_attrmask()
2294 sargp->xattr = get_fh4_flag(&sargp->cs->fh, in bitmap4_to_attrmask()
2359 struct compound_state *cs = sargp->cs; in bitmap4_get_sysattrs() local
2360 vnode_t *vp = cs->vp; in bitmap4_get_sysattrs()
2370 return (rfs4_vop_getattr(vp, sargp->vap, 0, cs->cr)); in bitmap4_get_sysattrs()
2552 struct compound_state *cs) in rfs4_op_getattr() argument
2560 DTRACE_NFSV4_2(op__getattr__start, struct compound_state *, cs, in rfs4_op_getattr()
2563 if (cs->vp == NULL) { in rfs4_op_getattr()
2564 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_getattr()
2568 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_getattr()
2569 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_getattr()
2574 sarg.cs = cs; in rfs4_op_getattr()
2584 if (vn_is_nfs_reparse(cs->vp, cs->cr)) { in rfs4_op_getattr()
2596 *cs->statusp = resp->status = status; in rfs4_op_getattr()
2598 DTRACE_NFSV4_2(op__getattr__done, struct compound_state *, cs, in rfs4_op_getattr()
2613 struct compound_state *cs) in rfs4_op_getfh() argument
2617 DTRACE_NFSV4_1(op__getfh__start, struct compound_state *, cs); in rfs4_op_getfh()
2619 if (cs->vp == NULL) { in rfs4_op_getfh()
2620 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_getfh()
2623 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_getfh()
2624 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_getfh()
2629 if (cs->exi->exi_moved || vn_is_nfs_reparse(cs->exi->exi_vp, cs->cr)) { in rfs4_op_getfh()
2631 cs->exi->exi_moved = 1; in rfs4_op_getfh()
2632 *cs->statusp = resp->status = NFS4ERR_MOVED; in rfs4_op_getfh()
2634 vnode_t *, cs->vp, char *, "rfs4_op_getfh"); in rfs4_op_getfh()
2639 if (vn_is_nfs_reparse(cs->vp, cs->cr) && !client_is_downrev(req)) { in rfs4_op_getfh()
2641 *cs->statusp = resp->status = NFS4ERR_MOVED; in rfs4_op_getfh()
2643 vnode_t *, cs->vp, char *, "rfs4_op_getfh"); in rfs4_op_getfh()
2648 kmem_alloc(cs->fh.nfs_fh4_len, KM_SLEEP); in rfs4_op_getfh()
2649 nfs_fh4_copy(&cs->fh, &resp->object); in rfs4_op_getfh()
2650 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_getfh()
2652 DTRACE_NFSV4_2(op__getfh__done, struct compound_state *, cs, in rfs4_op_getfh()
2676 struct svc_req *req, struct compound_state *cs) in rfs4_op_illegal() argument
2681 *cs->statusp = resp->status = NFS4ERR_OP_ILLEGAL; in rfs4_op_illegal()
2687 struct compound_state *cs) in rfs4_op_notsup() argument
2689 *cs->statusp = *((nfsstat4 *)&(resop)->nfs_resop4_u) = NFS4ERR_NOTSUPP; in rfs4_op_notsup()
2699 struct compound_state *cs) in rfs4_op_link() argument
2713 DTRACE_NFSV4_2(op__link__start, struct compound_state *, cs, in rfs4_op_link()
2717 vp = cs->saved_vp; in rfs4_op_link()
2719 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_link()
2724 dvp = cs->vp; in rfs4_op_link()
2726 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_link()
2735 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_link()
2739 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_link()
2740 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_link()
2746 *cs->statusp = resp->status = NFS4ERR_ISDIR; in rfs4_op_link()
2752 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_link()
2756 if (cs->saved_exi != cs->exi) { in rfs4_op_link()
2757 *cs->statusp = resp->status = NFS4ERR_XDEV; in rfs4_op_link()
2763 *cs->statusp = resp->status = status; in rfs4_op_link()
2769 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_link()
2774 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_link()
2779 if (rdonly4(req, cs)) { in rfs4_op_link()
2780 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_link()
2787 error = VOP_GETATTR(dvp, &bdva, 0, cs->cr, NULL); in rfs4_op_link()
2789 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_link()
2795 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_op_link()
2799 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_link()
2806 error = VOP_LINK(dvp, vp, name, cs->cr, NULL, 0); in rfs4_op_link()
2816 if (VOP_GETATTR(dvp, &idva, 0, cs->cr, NULL)) in rfs4_op_link()
2822 (void) VOP_FSYNC(vp, FNODSYNC, cs->cr, NULL); in rfs4_op_link()
2823 (void) VOP_FSYNC(dvp, 0, cs->cr, NULL); in rfs4_op_link()
2826 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_link()
2835 if (VOP_GETATTR(dvp, &adva, 0, cs->cr, NULL)) { in rfs4_op_link()
2853 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_link()
2855 DTRACE_NFSV4_2(op__link__done, struct compound_state *, cs, in rfs4_op_link()
2865 do_rfs4_op_lookup(char *nm, struct svc_req *req, struct compound_state *cs) in do_rfs4_op_lookup() argument
2876 if (cs->vp->v_flag & V_XATTRDIR) { in do_rfs4_op_lookup()
2878 ASSERT(get_fh4_flag(&cs->fh, FH4_ATTRDIR)); in do_rfs4_op_lookup()
2881 ASSERT(! get_fh4_flag(&cs->fh, FH4_ATTRDIR)); in do_rfs4_op_lookup()
2894 ASSERT(cs->exi != NULL); in do_rfs4_op_lookup()
2895 zone_rootvp = cs->exi->exi_ne->exi_root->exi_vp; in do_rfs4_op_lookup()
2901 if ((cs->vp->v_flag & VROOT) || VN_CMP(cs->vp, zone_rootvp)) { in do_rfs4_op_lookup()
2907 if (VN_CMP(cs->vp, zone_rootvp)) in do_rfs4_op_lookup()
2913 cs->vp = untraverse(cs->vp, zone_rootvp); in do_rfs4_op_lookup()
2927 different_export = nfs_exported(cs->exi, cs->vp); in do_rfs4_op_lookup()
2931 error = VOP_LOOKUP(cs->vp, nm, &vp, NULL, 0, NULL, cs->cr, in do_rfs4_op_lookup()
2950 (PSEUDO(cs->exi) || ! is_exported_sec(cs->nfsflavor, cs->exi) || in do_rfs4_op_lookup()
2951 cs->access & CS_ACCESS_LIMITED)) { in do_rfs4_op_lookup()
2952 if (! nfs_visible(cs->exi, vp, &different_export)) { in do_rfs4_op_lookup()
2962 pre_exi = cs->exi; /* save pre-traversed exportinfo */ in do_rfs4_op_lookup()
2976 } else if (vp->v_vfsp != cs->vp->v_vfsp) { in do_rfs4_op_lookup()
3001 exi = nfs_vptoexi(NULL, vp, cs->cr, &walk, NULL, TRUE); in do_rfs4_op_lookup()
3026 cs->exi = exi; in do_rfs4_op_lookup()
3039 crfree(cs->cr); in do_rfs4_op_lookup()
3040 cs->cr = crdup(cs->basecr); in do_rfs4_op_lookup()
3042 oldvp = cs->vp; in do_rfs4_op_lookup()
3043 cs->vp = vp; in do_rfs4_op_lookup()
3046 stat = call_checkauth4(cs, req); in do_rfs4_op_lookup()
3048 VN_RELE(cs->vp); in do_rfs4_op_lookup()
3049 cs->vp = oldvp; in do_rfs4_op_lookup()
3073 cs->exi)) { in do_rfs4_op_lookup()
3111 error = makefh4(&cs->fh, vp, cs->exi); in do_rfs4_op_lookup()
3116 VN_RELE(cs->vp); in do_rfs4_op_lookup()
3117 cs->vp = oldvp; in do_rfs4_op_lookup()
3124 if (cs->vp) in do_rfs4_op_lookup()
3125 VN_RELE(cs->vp); in do_rfs4_op_lookup()
3126 cs->vp = vp; in do_rfs4_op_lookup()
3135 set_fh4_flag(&cs->fh, FH4_NAMEDATTR); in do_rfs4_op_lookup()
3138 cs->mandlock = FALSE; in do_rfs4_op_lookup()
3146 struct compound_state *cs) in rfs4_op_lookup() argument
3156 DTRACE_NFSV4_2(op__lookup__start, struct compound_state *, cs, in rfs4_op_lookup()
3159 if (cs->vp == NULL) { in rfs4_op_lookup()
3160 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_lookup()
3164 if (cs->vp->v_type == VLNK) { in rfs4_op_lookup()
3165 *cs->statusp = resp->status = NFS4ERR_SYMLINK; in rfs4_op_lookup()
3169 if (cs->vp->v_type != VDIR) { in rfs4_op_lookup()
3170 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_lookup()
3176 *cs->statusp = resp->status = status; in rfs4_op_lookup()
3182 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_lookup()
3187 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_lookup()
3193 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_op_lookup()
3197 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_lookup()
3202 *cs->statusp = resp->status = do_rfs4_op_lookup(name, req, cs); in rfs4_op_lookup()
3209 DTRACE_NFSV4_2(op__lookup__done, struct compound_state *, cs, in rfs4_op_lookup()
3216 struct compound_state *cs) in rfs4_op_lookupp() argument
3220 DTRACE_NFSV4_1(op__lookupp__start, struct compound_state *, cs); in rfs4_op_lookupp()
3222 if (cs->vp == NULL) { in rfs4_op_lookupp()
3223 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_lookupp()
3227 if (cs->vp->v_type == VLNK) { in rfs4_op_lookupp()
3228 *cs->statusp = resp->status = NFS4ERR_SYMLINK; in rfs4_op_lookupp()
3232 if (cs->vp->v_type != VDIR) { in rfs4_op_lookupp()
3233 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_lookupp()
3237 *cs->statusp = resp->status = do_rfs4_op_lookup("..", req, cs); in rfs4_op_lookupp()
3244 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_lookupp()
3248 DTRACE_NFSV4_2(op__lookupp__done, struct compound_state *, cs, in rfs4_op_lookupp()
3256 struct compound_state *cs) in rfs4_op_openattr() argument
3264 DTRACE_NFSV4_2(op__openattr__start, struct compound_state *, cs, in rfs4_op_openattr()
3267 if (cs->vp == NULL) { in rfs4_op_openattr()
3268 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_openattr()
3272 if ((cs->vp->v_vfsp->vfs_flag & VFS_XATTR) == 0 && in rfs4_op_openattr()
3273 !vfs_has_feature(cs->vp->v_vfsp, VFSFT_SYSATTR_VIEWS)) { in rfs4_op_openattr()
3274 *cs->statusp = resp->status = puterrno4(ENOTSUP); in rfs4_op_openattr()
3283 if (vfs_has_feature(cs->vp->v_vfsp, VFSFT_ACEMASKONACCESS)) in rfs4_op_openattr()
3284 error = VOP_ACCESS(cs->vp, ACE_READ_NAMED_ATTRS, in rfs4_op_openattr()
3285 V_ACE_MASK, cs->cr, NULL); in rfs4_op_openattr()
3287 error = ((VOP_ACCESS(cs->vp, VREAD, 0, cs->cr, NULL) != 0) && in rfs4_op_openattr()
3288 (VOP_ACCESS(cs->vp, VWRITE, 0, cs->cr, NULL) != 0) && in rfs4_op_openattr()
3289 (VOP_ACCESS(cs->vp, VEXEC, 0, cs->cr, NULL) != 0)); in rfs4_op_openattr()
3292 *cs->statusp = resp->status = puterrno4(EACCES); in rfs4_op_openattr()
3310 if (args->createdir && ! (exp_ro = rdonly4(req, cs))) in rfs4_op_openattr()
3313 error = VOP_LOOKUP(cs->vp, "", &avp, NULL, lookup_flags, NULL, cs->cr, in rfs4_op_openattr()
3318 *cs->statusp = resp->status = puterrno4(EROFS); in rfs4_op_openattr()
3320 *cs->statusp = resp->status = puterrno4(ENOTSUP); in rfs4_op_openattr()
3322 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_openattr()
3328 error = makefh4(&cs->fh, avp, cs->exi); in rfs4_op_openattr()
3332 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_openattr()
3336 VN_RELE(cs->vp); in rfs4_op_openattr()
3337 cs->vp = avp; in rfs4_op_openattr()
3345 set_fh4_flag(&cs->fh, FH4_ATTRDIR); in rfs4_op_openattr()
3346 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_openattr()
3349 DTRACE_NFSV4_2(op__openattr__done, struct compound_state *, cs, in rfs4_op_openattr()
3397 struct compound_state *cs) in rfs4_op_read() argument
3409 bool_t *deleg = &cs->deleg; in rfs4_op_read()
3419 DTRACE_NFSV4_2(op__read__start, struct compound_state *, cs, in rfs4_op_read()
3422 vp = cs->vp; in rfs4_op_read()
3424 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_read()
3427 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_read()
3428 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_read()
3433 deleg, TRUE, &ct, cs)) != NFS4_OK) { in rfs4_op_read()
3434 *cs->statusp = resp->status = stat; in rfs4_op_read()
3447 *cs->statusp = resp->status = NFS4ERR_LOCKED; in rfs4_op_read()
3454 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_read()
3464 verror = VOP_GETATTR(vp, &va, 0, cs->cr, &ct); in rfs4_op_read()
3471 *cs->statusp = resp->status = puterrno4(verror); in rfs4_op_read()
3476 *cs->statusp = resp->status = in rfs4_op_read()
3481 if (crgetuid(cs->cr) != va.va_uid && in rfs4_op_read()
3482 (error = VOP_ACCESS(vp, VREAD, 0, cs->cr, &ct)) && in rfs4_op_read()
3483 (error = VOP_ACCESS(vp, VEXEC, 0, cs->cr, &ct))) { in rfs4_op_read()
3484 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_read()
3489 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_read()
3495 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_read()
3503 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_read()
3510 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_read()
3538 if (!VOP_REQZCBUF(vp, UIO_READ, (xuio_t *)uiop, cs->cr, &ct)) { in rfs4_op_read()
3585 error = do_io(FREAD, vp, uiop, 0, cs->cr, &ct); in rfs4_op_read()
3588 verror = VOP_GETATTR(vp, &va, 0, cs->cr, &ct); in rfs4_op_read()
3593 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_read()
3603 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_read()
3623 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_read()
3636 DTRACE_NFSV4_2(op__read__done, struct compound_state *, cs, in rfs4_op_read()
3669 struct compound_state *cs) in rfs4_op_putpubfh() argument
3678 DTRACE_NFSV4_1(op__putpubfh__start, struct compound_state *, cs); in rfs4_op_putpubfh()
3680 if (cs->vp) { in rfs4_op_putpubfh()
3681 VN_RELE(cs->vp); in rfs4_op_putpubfh()
3682 cs->vp = NULL; in rfs4_op_putpubfh()
3685 if (cs->cr) in rfs4_op_putpubfh()
3686 crfree(cs->cr); in rfs4_op_putpubfh()
3688 cs->cr = crdup(cs->basecr); in rfs4_op_putpubfh()
3692 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_putpubfh()
3696 error = makefh4(&cs->fh, vp, ne->exi_public); in rfs4_op_putpubfh()
3698 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_putpubfh()
3701 sav_exi = cs->exi; in rfs4_op_putpubfh()
3708 fh_fmtp = (nfs_fh4_fmt_t *)cs->fh.nfs_fh4_val; in rfs4_op_putpubfh()
3717 cs->exi = ((exi != NULL) ? exi : ne->exi_public); in rfs4_op_putpubfh()
3722 cs->exi = ne->exi_public; in rfs4_op_putpubfh()
3735 cs->exi)) { in rfs4_op_putpubfh()
3736 *cs->statusp = resp->status = in rfs4_op_putpubfh()
3744 cs->vp = vp; in rfs4_op_putpubfh()
3746 if ((resp->status = call_checkauth4(cs, req)) != NFS4_OK) { in rfs4_op_putpubfh()
3747 VN_RELE(cs->vp); in rfs4_op_putpubfh()
3748 cs->vp = NULL; in rfs4_op_putpubfh()
3749 cs->exi = sav_exi; in rfs4_op_putpubfh()
3753 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_putpubfh()
3755 DTRACE_NFSV4_2(op__putpubfh__done, struct compound_state *, cs, in rfs4_op_putpubfh()
3778 struct compound_state *cs) in rfs4_op_putfh() argument
3784 DTRACE_NFSV4_2(op__putfh__start, struct compound_state *, cs, in rfs4_op_putfh()
3787 if (cs->vp) { in rfs4_op_putfh()
3788 VN_RELE(cs->vp); in rfs4_op_putfh()
3789 cs->vp = NULL; in rfs4_op_putfh()
3792 if (cs->cr) { in rfs4_op_putfh()
3793 crfree(cs->cr); in rfs4_op_putfh()
3794 cs->cr = NULL; in rfs4_op_putfh()
3799 *cs->statusp = resp->status = NFS4ERR_BADHANDLE; in rfs4_op_putfh()
3804 cs->exi = checkexport4(&fh_fmtp->fh4_fsid, (fid_t *)&fh_fmtp->fh4_xlen, in rfs4_op_putfh()
3807 if (cs->exi == NULL) { in rfs4_op_putfh()
3808 *cs->statusp = resp->status = NFS4ERR_STALE; in rfs4_op_putfh()
3812 cs->cr = crdup(cs->basecr); in rfs4_op_putfh()
3814 ASSERT(cs->cr != NULL); in rfs4_op_putfh()
3816 if (! (cs->vp = nfs4_fhtovp(&args->object, cs->exi, &resp->status))) { in rfs4_op_putfh()
3817 *cs->statusp = resp->status; in rfs4_op_putfh()
3821 if ((resp->status = call_checkauth4(cs, req)) != NFS4_OK) { in rfs4_op_putfh()
3822 VN_RELE(cs->vp); in rfs4_op_putfh()
3823 cs->vp = NULL; in rfs4_op_putfh()
3827 nfs_fh4_copy(&args->object, &cs->fh); in rfs4_op_putfh()
3828 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_putfh()
3829 cs->deleg = FALSE; in rfs4_op_putfh()
3832 DTRACE_NFSV4_2(op__putfh__done, struct compound_state *, cs, in rfs4_op_putfh()
3839 struct compound_state *cs) in rfs4_op_putrootfh() argument
3846 DTRACE_NFSV4_1(op__putrootfh__start, struct compound_state *, cs); in rfs4_op_putrootfh()
3848 if (cs->vp) { in rfs4_op_putrootfh()
3849 VN_RELE(cs->vp); in rfs4_op_putrootfh()
3850 cs->vp = NULL; in rfs4_op_putrootfh()
3853 if (cs->cr) in rfs4_op_putrootfh()
3854 crfree(cs->cr); in rfs4_op_putrootfh()
3856 cs->cr = crdup(cs->basecr); in rfs4_op_putrootfh()
3866 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_putrootfh()
3882 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_putrootfh()
3890 error = makefh4(&cs->fh, ZONE_ROOTVP(), exi); in rfs4_op_putrootfh()
3892 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_putrootfh()
3896 sav_exi = cs->exi; in rfs4_op_putrootfh()
3897 cs->exi = exi; in rfs4_op_putrootfh()
3900 cs->vp = ZONE_ROOTVP(); in rfs4_op_putrootfh()
3902 if ((resp->status = call_checkauth4(cs, req)) != NFS4_OK) { in rfs4_op_putrootfh()
3903 VN_RELE(cs->vp); in rfs4_op_putrootfh()
3904 cs->vp = NULL; in rfs4_op_putrootfh()
3905 cs->exi = sav_exi; in rfs4_op_putrootfh()
3909 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_putrootfh()
3910 cs->deleg = FALSE; in rfs4_op_putrootfh()
3912 DTRACE_NFSV4_2(op__putrootfh__done, struct compound_state *, cs, in rfs4_op_putrootfh()
3924 struct compound_state *cs) in rfs4_op_readlink() argument
3937 DTRACE_NFSV4_1(op__readlink__start, struct compound_state *, cs); in rfs4_op_readlink()
3940 vp = cs->vp; in rfs4_op_readlink()
3942 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_readlink()
3946 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_readlink()
3947 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_readlink()
3952 if (vn_is_nfs_reparse(vp, cs->cr) && client_is_downrev(req)) { in rfs4_op_readlink()
3961 *cs->statusp = resp->status = NFS4ERR_ISDIR; in rfs4_op_readlink()
3966 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_readlink()
3973 error = VOP_GETATTR(vp, &va, 0, cs->cr, NULL); in rfs4_op_readlink()
3975 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_readlink()
3980 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_readlink()
3990 cs->exi->exi_ne->ne_globals->svstat[NFS_V4]; in rfs4_op_readlink()
3993 s = build_symlink(vp, cs->cr, &strsz); in rfs4_op_readlink()
4016 error = VOP_READLINK(vp, &uio, cs->cr, NULL); in rfs4_op_readlink()
4024 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_readlink()
4029 name = nfscmd_convname(ca, cs->exi, data, NFSCMD_CONV_OUTBOUND, in rfs4_op_readlink()
4048 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_readlink()
4051 DTRACE_NFSV4_2(op__readlink__done, struct compound_state *, cs, in rfs4_op_readlink()
4080 struct svc_req *req, struct compound_state *cs) in rfs4_op_release_lockowner() argument
4094 cs, RELEASE_LOCKOWNER4args *, ap); in rfs4_op_release_lockowner()
4100 *cs->statusp = resp->status = in rfs4_op_release_lockowner()
4108 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_release_lockowner()
4119 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_release_lockowner()
4152 *cs->statusp = resp->status = NFS4ERR_LOCKS_HELD; in rfs4_op_release_lockowner()
4206 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_release_lockowner()
4210 cs, RELEASE_LOCKOWNER4res *, resp); in rfs4_op_release_lockowner()
4252 struct compound_state *cs) in rfs4_op_remove() argument
4268 DTRACE_NFSV4_2(op__remove__start, struct compound_state *, cs, in rfs4_op_remove()
4272 dvp = cs->vp; in rfs4_op_remove()
4274 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_remove()
4278 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_remove()
4279 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_remove()
4288 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_remove()
4293 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_remove()
4299 *cs->statusp = resp->status = status; in rfs4_op_remove()
4308 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_remove()
4313 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_remove()
4318 if (rdonly4(req, cs)) { in rfs4_op_remove()
4319 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_remove()
4325 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_op_remove()
4329 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_remove()
4341 fp = rfs4_lookup_and_findfile(dvp, name, &vp, &error, cs->cr); in rfs4_op_remove()
4347 *cs->statusp = resp->status = NFS4ERR_DELAY; in rfs4_op_remove()
4357 *cs->statusp = resp->status = error; in rfs4_op_remove()
4368 *cs->statusp = resp->status = NFS4ERR_FILE_OPEN; in rfs4_op_remove()
4391 cs->exi)) { in rfs4_op_remove()
4392 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_remove()
4410 error = VOP_GETATTR(dvp, &bdva, 0, cs->cr, NULL); in rfs4_op_remove()
4412 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_remove()
4442 if ((error = VOP_RMDIR(dvp, name, ZONE_ROOTVP(), cs->cr, in rfs4_op_remove()
4447 if ((error = VOP_REMOVE(dvp, name, cs->cr, NULL, 0)) == 0 && in rfs4_op_remove()
4464 if (!VOP_GETATTR(tvp, &va, 0, cs->cr, NULL) && in rfs4_op_remove()
4491 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_remove()
4499 if (VOP_GETATTR(dvp, &idva, 0, cs->cr, NULL)) in rfs4_op_remove()
4505 (void) VOP_FSYNC(dvp, 0, cs->cr, NULL); in rfs4_op_remove()
4512 if (VOP_GETATTR(dvp, &adva, 0, cs->cr, NULL)) { in rfs4_op_remove()
4531 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_remove()
4534 DTRACE_NFSV4_2(op__remove__done, struct compound_state *, cs, in rfs4_op_remove()
4547 struct compound_state *cs) in rfs4_op_rename() argument
4569 DTRACE_NFSV4_2(op__rename__start, struct compound_state *, cs, in rfs4_op_rename()
4579 ndvp = cs->vp; in rfs4_op_rename()
4581 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_rename()
4586 odvp = cs->saved_vp; in rfs4_op_rename()
4588 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_rename()
4592 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_rename()
4593 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_rename()
4602 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_rename()
4611 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_rename()
4616 *cs->statusp = resp->status = NFS4ERR_NOTDIR; in rfs4_op_rename()
4620 if (cs->saved_exi != cs->exi) { in rfs4_op_rename()
4621 *cs->statusp = resp->status = NFS4ERR_XDEV; in rfs4_op_rename()
4627 *cs->statusp = resp->status = status; in rfs4_op_rename()
4633 *cs->statusp = resp->status = status; in rfs4_op_rename()
4639 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_rename()
4644 converted_onm = nfscmd_convname(ca, cs->exi, onm, NFSCMD_CONV_INBOUND, in rfs4_op_rename()
4648 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_rename()
4655 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_rename()
4661 converted_nnm = nfscmd_convname(ca, cs->exi, nnm, NFSCMD_CONV_INBOUND, in rfs4_op_rename()
4665 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_rename()
4676 *cs->statusp = resp->status = NFS4ERR_NAMETOOLONG; in rfs4_op_rename()
4683 if (rdonly4(req, cs)) { in rfs4_op_rename()
4684 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_rename()
4703 EQUALITY_CHECK, cs->exi)) { in rfs4_op_rename()
4704 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_rename()
4717 &error, cs->cr); in rfs4_op_rename()
4721 *cs->statusp = resp->status = NFS4ERR_DELAY; in rfs4_op_rename()
4727 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_rename()
4741 cs->cr); in rfs4_op_rename()
4745 *cs->statusp = resp->status = NFS4ERR_DELAY; in rfs4_op_rename()
4756 *cs->statusp = resp->status = NFS4ERR_FILE_OPEN; in rfs4_op_rename()
4765 *cs->statusp = resp->status = NFS4ERR_FILE_OPEN; in rfs4_op_rename()
4772 error = VOP_GETATTR(odvp, &obdva, 0, cs->cr, NULL); in rfs4_op_rename()
4775 error = VOP_GETATTR(ndvp, &nbdva, 0, cs->cr, NULL); in rfs4_op_rename()
4778 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_rename()
4785 error = VOP_RENAME(odvp, converted_onm, ndvp, converted_nnm, cs->cr, in rfs4_op_rename()
4804 if (!VOP_GETATTR(tvp, &va, 0, cs->cr, NULL) && in rfs4_op_rename()
4867 if (VOP_GETATTR(odvp, &oidva, 0, cs->cr, NULL)) in rfs4_op_rename()
4871 if (VOP_GETATTR(ndvp, &nidva, 0, cs->cr, NULL)) in rfs4_op_rename()
4877 (void) VOP_FSYNC(odvp, 0, cs->cr, NULL); in rfs4_op_rename()
4878 (void) VOP_FSYNC(ndvp, 0, cs->cr, NULL); in rfs4_op_rename()
4881 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_rename()
4890 if (VOP_GETATTR(odvp, &oadva, 0, cs->cr, NULL)) { in rfs4_op_rename()
4896 if (VOP_GETATTR(odvp, &nadva, 0, cs->cr, NULL)) { in rfs4_op_rename()
4928 if (cs->exi->exi_export.ex_flags & EX_VOLRNM) { in rfs4_op_rename()
4936 error = VOP_LOOKUP(ndvp, nnm, &vp, NULL, 0, NULL, cs->cr, in rfs4_op_rename()
4940 add_volrnm_fh(cs->exi, vp); in rfs4_op_rename()
4947 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_rename()
4949 DTRACE_NFSV4_2(op__rename__done, struct compound_state *, cs, in rfs4_op_rename()
4976 DTRACE_NFSV4_2(op__rename__done, struct compound_state *, cs, in rfs4_op_rename()
4983 struct compound_state *cs) in rfs4_op_renew() argument
4989 DTRACE_NFSV4_2(op__renew__start, struct compound_state *, cs, in rfs4_op_renew()
4993 *cs->statusp = resp->status = in rfs4_op_renew()
5000 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_renew()
5009 *cs->statusp = resp->status = NFS4ERR_CB_PATH_DOWN; in rfs4_op_renew()
5011 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_renew()
5018 DTRACE_NFSV4_2(op__renew__done, struct compound_state *, cs, in rfs4_op_renew()
5025 struct compound_state *cs) in rfs4_op_restorefh() argument
5029 DTRACE_NFSV4_1(op__restorefh__start, struct compound_state *, cs); in rfs4_op_restorefh()
5032 if ((cs->saved_vp == NULL) || (cs->saved_fh.nfs_fh4_val == NULL)) { in rfs4_op_restorefh()
5033 *cs->statusp = resp->status = NFS4ERR_RESTOREFH; in rfs4_op_restorefh()
5036 if (cs->vp != NULL) { in rfs4_op_restorefh()
5037 VN_RELE(cs->vp); in rfs4_op_restorefh()
5039 cs->vp = cs->saved_vp; in rfs4_op_restorefh()
5040 cs->saved_vp = NULL; in rfs4_op_restorefh()
5041 cs->exi = cs->saved_exi; in rfs4_op_restorefh()
5042 nfs_fh4_copy(&cs->saved_fh, &cs->fh); in rfs4_op_restorefh()
5043 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_restorefh()
5044 cs->deleg = FALSE; in rfs4_op_restorefh()
5047 DTRACE_NFSV4_2(op__restorefh__done, struct compound_state *, cs, in rfs4_op_restorefh()
5054 struct compound_state *cs) in rfs4_op_savefh() argument
5058 DTRACE_NFSV4_1(op__savefh__start, struct compound_state *, cs); in rfs4_op_savefh()
5061 if (cs->vp == NULL) { in rfs4_op_savefh()
5062 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_savefh()
5065 if (cs->saved_vp != NULL) { in rfs4_op_savefh()
5066 VN_RELE(cs->saved_vp); in rfs4_op_savefh()
5068 cs->saved_vp = cs->vp; in rfs4_op_savefh()
5069 VN_HOLD(cs->saved_vp); in rfs4_op_savefh()
5070 cs->saved_exi = cs->exi; in rfs4_op_savefh()
5075 if (cs->saved_fh.nfs_fh4_val == NULL) { in rfs4_op_savefh()
5076 cs->saved_fh.nfs_fh4_val = kmem_alloc(NFS4_FHSIZE, KM_SLEEP); in rfs4_op_savefh()
5078 nfs_fh4_copy(&cs->fh, &cs->saved_fh); in rfs4_op_savefh()
5079 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_savefh()
5082 DTRACE_NFSV4_2(op__savefh__done, struct compound_state *, cs, in rfs4_op_savefh()
5119 ret_error = VOP_GETATTR(sargp->cs->vp, sargp->vap, 0, in rfs4_verify_attr()
5120 sargp->cs->cr, NULL); in rfs4_verify_attr()
5144 ret_error = VFS_STATVFS(sargp->cs->vp->v_vfsp, sargp->sbp); in rfs4_verify_attr()
5253 do_rfs4_set_attrs(bitmap4 *resp, fattr4 *fattrp, struct compound_state *cs, in do_rfs4_set_attrs() argument
5263 vnode_t *vp = cs->vp; in do_rfs4_set_attrs()
5280 if (cs->access == CS_ACCESS_DENIED) { in do_rfs4_set_attrs()
5287 sargp->cs = cs; in do_rfs4_set_attrs()
5347 do_rfs4_op_setattr(bitmap4 *resp, fattr4 *fattrp, struct compound_state *cs, in do_rfs4_op_setattr() argument
5355 cred_t *cr = cs->cr; in do_rfs4_op_setattr()
5356 vnode_t *vp = cs->vp; in do_rfs4_op_setattr()
5369 status = do_rfs4_set_attrs(resp, fattrp, cs, &sarg, &ntov, in do_rfs4_op_setattr()
5397 error = VOP_GETATTR(vp, &va, 0, cs->cr, NULL); in do_rfs4_op_setattr()
5412 status = rfs4_check_stateid(FWRITE, cs->vp, stateid, in do_rfs4_op_setattr()
5413 trunc, &cs->deleg, sarg.vap->va_mask & AT_SIZE, &ct, cs); in do_rfs4_op_setattr()
5581 struct compound_state *cs) in rfs4_op_setattr() argument
5587 DTRACE_NFSV4_2(op__setattr__start, struct compound_state *, cs, in rfs4_op_setattr()
5590 if (cs->vp == NULL) { in rfs4_op_setattr()
5591 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_setattr()
5599 if (vn_ismntpt(cs->vp)) { in rfs4_op_setattr()
5600 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_setattr()
5606 if (rdonly4(req, cs)) { in rfs4_op_setattr()
5607 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_setattr()
5619 if (!do_rfs_label_check(clabel, cs->vp, in rfs4_op_setattr()
5620 EQUALITY_CHECK, cs->exi)) { in rfs4_op_setattr()
5621 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_setattr()
5627 *cs->statusp = resp->status = in rfs4_op_setattr()
5628 do_rfs4_op_setattr(&resp->attrsset, &args->obj_attributes, cs, in rfs4_op_setattr()
5632 DTRACE_NFSV4_2(op__setattr__done, struct compound_state *, cs, in rfs4_op_setattr()
5639 struct compound_state *cs) in rfs4_op_verify() argument
5655 DTRACE_NFSV4_2(op__verify__start, struct compound_state *, cs, in rfs4_op_verify()
5658 if (cs->vp == NULL) { in rfs4_op_verify()
5659 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_verify()
5666 resp->status = do_rfs4_set_attrs(NULL, &args->obj_attributes, cs, in rfs4_op_verify()
5690 *cs->statusp = resp->status; in rfs4_op_verify()
5693 DTRACE_NFSV4_2(op__verify__done, struct compound_state *, cs, in rfs4_op_verify()
5700 struct compound_state *cs) in rfs4_op_nverify() argument
5716 DTRACE_NFSV4_2(op__nverify__start, struct compound_state *, cs, in rfs4_op_nverify()
5719 if (cs->vp == NULL) { in rfs4_op_nverify()
5720 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_nverify()
5721 DTRACE_NFSV4_2(op__nverify__done, struct compound_state *, cs, in rfs4_op_nverify()
5728 resp->status = do_rfs4_set_attrs(NULL, &args->obj_attributes, cs, in rfs4_op_nverify()
5752 *cs->statusp = resp->status; in rfs4_op_nverify()
5755 DTRACE_NFSV4_2(op__nverify__done, struct compound_state *, cs, in rfs4_op_nverify()
5767 struct compound_state *cs) in rfs4_op_write() argument
5781 bool_t *deleg = &cs->deleg; in rfs4_op_write()
5787 DTRACE_NFSV4_2(op__write__start, struct compound_state *, cs, in rfs4_op_write()
5790 vp = cs->vp; in rfs4_op_write()
5792 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_write()
5795 if (cs->access == CS_ACCESS_DENIED) { in rfs4_op_write()
5796 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_write()
5800 cr = cs->cr; in rfs4_op_write()
5803 deleg, TRUE, &ct, cs)) != NFS4_OK) { in rfs4_op_write()
5804 *cs->statusp = resp->status = stat; in rfs4_op_write()
5817 *cs->statusp = resp->status = NFS4ERR_LOCKED; in rfs4_op_write()
5830 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_write()
5834 if (rdonly4(req, cs)) { in rfs4_op_write()
5835 *cs->statusp = resp->status = NFS4ERR_ROFS; in rfs4_op_write()
5840 *cs->statusp = resp->status = in rfs4_op_write()
5847 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_write()
5852 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_write()
5858 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_write()
5927 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_write()
5945 *cs->statusp = resp->status = puterrno4(error); in rfs4_op_write()
5949 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_write()
5963 DTRACE_NFSV4_2(op__write__done, struct compound_state *, cs, in rfs4_op_write()
5968 rfs4_opnum_in_range(const compound_state_t *cs, int opnum) in rfs4_opnum_in_range() argument
5972 else if (cs->minorversion == 0 && opnum > LAST_NFS40_OP) in rfs4_opnum_in_range()
5974 else if (cs->minorversion == 1 && opnum > LAST_NFS41_OP) in rfs4_opnum_in_range()
5976 else if (cs->minorversion == 2 && opnum > LAST_NFS42_OP) in rfs4_opnum_in_range()
5982 rfs4_compound(COMPOUND4args *args, COMPOUND4res *resp, compound_state_t *cs, in rfs4_compound() argument
6005 cs->statusp = &resp->status; in rfs4_compound()
6006 cs->req = req; in rfs4_compound()
6007 cs->minorversion = args->minorversion; in rfs4_compound()
6019 if (sec_svc_getcred(req, cr, &cs->principal, &cs->nfsflavor) == 0) { in rfs4_compound()
6021 cs, COMPOUND4args *, args); in rfs4_compound()
6023 cs, COMPOUND4res *, resp); in rfs4_compound()
6034 cs->op_len = args->array_len; in rfs4_compound()
6035 cs->basecr = cr; in rfs4_compound()
6038 DTRACE_NFSV4_2(compound__start, struct compound_state *, cs, in rfs4_compound()
6067 for (i = 0; i < args->array_len && cs->cont; i++) { in rfs4_compound()
6078 cs->op_pos = i; in rfs4_compound()
6079 if (op < rfsv4disp_cnt && rfs4_opnum_in_range(cs, op)) { in rfs4_compound()
6088 (*rfsv4disptab[op].dis_proc)(argop, resop, req, cs); in rfs4_compound()
6090 rfs4_op_string[op], *cs->statusp)); in rfs4_compound()
6091 if (*cs->statusp != NFS4_OK) in rfs4_compound()
6092 cs->cont = FALSE; in rfs4_compound()
6103 rfs4_op_illegal(argop, resop, req, cs); in rfs4_compound()
6104 cs->cont = FALSE; in rfs4_compound()
6111 if ((i + 1) < args->array_len && !cs->cont) { in rfs4_compound()
6126 DTRACE_NFSV4_2(compound__done, struct compound_state *, cs, in rfs4_compound()
6254 creds_ok(cred_set_t *cr_set, struct svc_req *req, struct compound_state *cs) in creds_ok() argument
6266 struct compound_state *cs) in rfs4_lookup() argument
6274 if (cs->vp == NULL) { in rfs4_lookup()
6277 if (cs->vp->v_type != VDIR) { in rfs4_lookup()
6296 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_lookup()
6304 status = do_rfs4_op_lookup(name, req, cs); in rfs4_lookup()
6316 struct compound_state *cs, uint32_t access, change_info4 *cinfo) in rfs4_lookupfile() argument
6319 vnode_t *dvp = cs->vp; in rfs4_lookupfile()
6325 error = VOP_GETATTR(dvp, &bva, 0, cs->cr, NULL); in rfs4_lookupfile()
6332 status = rfs4_lookup(component, req, cs); in rfs4_lookupfile()
6343 if (VOP_GETATTR(dvp, &ava, 0, cs->cr, NULL)) { in rfs4_lookupfile()
6353 error = VOP_GETATTR(cs->vp, &fva, 0, cs->cr, NULL); in rfs4_lookupfile()
6379 cs->mandlock = MANDLOCK(cs->vp, fva.va_mode); in rfs4_lookupfile()
6380 return (check_open_access(access, cs, req)); in rfs4_lookupfile()
6478 check_open_access(uint32_t access, struct compound_state *cs, in check_open_access() argument
6484 cred_t *cr = cs->cr; in check_open_access()
6487 if (cs->access == CS_ACCESS_DENIED || cs->mandlock) { in check_open_access()
6491 vp = cs->vp; in check_open_access()
6499 readonly = rdonly4(req, cs); in check_open_access()
6536 rfs4_createfile(OPEN4args *args, struct svc_req *req, struct compound_state *cs, in rfs4_createfile() argument
6567 dvp = cs->vp; in rfs4_createfile()
6570 if (rdonly4(req, cs)) in rfs4_createfile()
6582 cs->exi)) { in rfs4_createfile()
6614 error = VOP_GETATTR(dvp, &bva, 0, cs->cr, NULL); in rfs4_createfile()
6642 cs, &sarg, &ntov, NFS4ATTR_SETIT); in rfs4_createfile()
6711 name = nfscmd_convname(ca, cs->exi, nm, NFSCMD_CONV_INBOUND, in rfs4_createfile()
6720 cs->cr, &vp, &created); in rfs4_createfile()
6779 if (VOP_GETATTR(dvp, &iva, 0, cs->cr, NULL)) { in rfs4_createfile()
6803 (void) VOP_FSYNC(dvp, 0, cs->cr, NULL); in rfs4_createfile()
6810 if (VOP_GETATTR(dvp, &ava, 0, cs->cr, NULL)) { in rfs4_createfile()
6836 cs->mandlock = TRUE; in rfs4_createfile()
6838 if (VOP_GETATTR(vp, &cva, 0, cs->cr, NULL) == 0) { in rfs4_createfile()
6839 cs->mandlock = MANDLOCK(cs->vp, cva.va_mode); in rfs4_createfile()
6893 (void) VOP_SETATTR(vp, &cva, 0, cs->cr, &ct); in rfs4_createfile()
6899 error = makefh4(&cs->fh, vp, cs->exi); in rfs4_createfile()
6904 (void) VOP_FSYNC(vp, FNODSYNC, cs->cr, NULL); in rfs4_createfile()
6914 set_fh4_flag(&cs->fh, FH4_NAMEDATTR); in rfs4_createfile()
6916 if (cs->vp) in rfs4_createfile()
6917 VN_RELE(cs->vp); in rfs4_createfile()
6919 cs->vp = vp; in rfs4_createfile()
6929 status = check_open_access(args->share_access, cs, req); in rfs4_createfile()
6938 rfs4_do_open(struct compound_state *cs, struct svc_req *req, in rfs4_do_open() argument
6960 fp = rfs4_findfile_withlock(cs->vp, &cs->fh, &fcreate); in rfs4_do_open()
6983 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_do_open()
7031 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_do_open()
7058 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_do_open()
7076 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_do_open()
7100 err = VOP_OPEN(&cs->vp, fflags, cs->cr, &ct); in rfs4_do_open()
7110 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_do_open()
7129 vn_open_upgrade(cs->vp, fflags); in rfs4_do_open()
7155 cs->deleg = (fp->rf_dinfo.rd_dtype == OPEN_DELEGATE_WRITE); in rfs4_do_open()
7177 rfs4_do_openfh(struct compound_state *cs, struct svc_req *req, OPEN4args *args, in rfs4_do_openfh() argument
7181 rfs4_do_open(cs, req, oo, DELEG_ANY, in rfs4_do_openfh()
7187 rfs4_do_opennull(struct compound_state *cs, struct svc_req *req, in rfs4_do_opennull() argument
7195 req, cs, args->share_access, cinfo); in rfs4_do_opennull()
7202 resp->status = rfs4_createfile(args, req, cs, cinfo, attrset, in rfs4_do_opennull()
7210 rfs4_do_open(cs, req, oo, in rfs4_do_opennull()
7223 *cs->statusp = resp->status; in rfs4_do_opennull()
7231 rfs4_do_openprev(struct compound_state *cs, struct svc_req *req, in rfs4_do_openprev() argument
7236 vtype_t v_type = cs->vp->v_type; in rfs4_do_openprev()
7251 error = VOP_GETATTR(cs->vp, &va, 0, cs->cr, NULL); in rfs4_do_openprev()
7257 cs->mandlock = MANDLOCK(cs->vp, va.va_mode); in rfs4_do_openprev()
7266 if (crgetuid(cs->cr) != va.va_uid) { in rfs4_do_openprev()
7267 resp->status = check_open_access(args->share_access, cs, req); in rfs4_do_openprev()
7280 rfs4_do_open(cs, req, oo, in rfs4_do_openprev()
7286 rfs4_do_opendelcur(struct compound_state *cs, struct svc_req *req, in rfs4_do_opendelcur() argument
7321 ASSERT(cs->vp != NULL); in rfs4_do_opendelcur()
7322 VN_RELE(cs->vp); in rfs4_do_opendelcur()
7324 cs->vp = dsp->rds_finfo->rf_vp; in rfs4_do_opendelcur()
7326 error = makefh4(&cs->fh, cs->vp, cs->exi); in rfs4_do_opendelcur()
7329 *cs->statusp = resp->status = puterrno4(error); in rfs4_do_opendelcur()
7336 rfs4_do_open(cs, req, oo, DELEG_NONE, in rfs4_do_opendelcur()
7342 rfs4_do_opendelprev(struct compound_state *cs, struct svc_req *req, in rfs4_do_opendelprev() argument
7365 req, cs, args->share_access, &resp->cinfo); in rfs4_do_opendelprev()
7372 fp = rfs4_findfile_withlock(cs->vp, NULL, &create); in rfs4_do_opendelprev()
7495 const compound_state_t *cs) in rfs4_check_open_seqid() argument
7499 if (rfs4_has_session(cs)) in rfs4_check_open_seqid()
7542 struct svc_req *req, struct compound_state *cs) in rfs4_op_open() argument
7554 DTRACE_NFSV4_2(op__open__start, struct compound_state *, cs, in rfs4_op_open()
7557 if (cs->vp == NULL) { in rfs4_op_open()
7558 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_open()
7563 if (rfs4_has_session(cs)) in rfs4_op_open()
7564 owner->clientid = cs->client->rc_clientid; in rfs4_op_open()
7572 *cs->statusp = resp->status = in rfs4_op_open()
7579 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_open()
7593 *cs->statusp = resp->status = NFS4ERR_RESOURCE; in rfs4_op_open()
7601 if (rfs4_has_session(cs)) { in rfs4_op_open()
7607 if (!rfs4_has_session(cs)) in rfs4_op_open()
7615 switch (rfs4_check_open_seqid(args->seqid, oo, resop, cs)) { in rfs4_op_open()
7617 ASSERT(!rfs4_has_session(cs)); in rfs4_op_open()
7641 ASSERT(!rfs4_has_session(cs)); in rfs4_op_open()
7651 *cs->statusp = resp->status = NFS4ERR_GRACE; in rfs4_op_open()
7661 *cs->statusp = resp->status = NFS4ERR_NO_GRACE; in rfs4_op_open()
7670 *cs->statusp = resp->status = NFS4ERR_NO_GRACE; in rfs4_op_open()
7692 if (vn_ismntpt(cs->vp)) { in rfs4_op_open()
7693 *cs->statusp = resp->status = NFS4ERR_ACCESS; in rfs4_op_open()
7705 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_open()
7717 rfs4_do_opennull(cs, req, args, oo, resp); in rfs4_op_open()
7720 rfs4_do_openprev(cs, req, args, oo, resp); in rfs4_op_open()
7723 rfs4_do_opendelcur(cs, req, args, oo, resp); in rfs4_op_open()
7726 rfs4_do_opendelprev(cs, req, args, oo, resp); in rfs4_op_open()
7729 rfs4_do_openfh(cs, req, args, oo, resp); in rfs4_op_open()
7761 rfs4_update_open_resp(oo, resop, &cs->fh); in rfs4_op_open()
7780 cs->exi = checkexport4(&fh_fmtp->fh4_fsid, in rfs4_op_open()
7783 if (cs->exi == NULL) { in rfs4_op_open()
7788 VN_RELE(cs->vp); in rfs4_op_open()
7790 cs->vp = nfs4_fhtovp(&oo->ro_reply_fh, cs->exi, in rfs4_op_open()
7793 if (cs->vp == NULL) in rfs4_op_open()
7796 nfs_fh4_copy(&oo->ro_reply_fh, &cs->fh); in rfs4_op_open()
7832 *cs->statusp = resp->status; in rfs4_op_open()
7834 if (!rfs4_has_session(cs)) in rfs4_op_open()
7839 DTRACE_NFSV4_2(op__open__done, struct compound_state *, cs, in rfs4_op_open()
7846 struct svc_req *req, struct compound_state *cs) in rfs4_op_open_confirm() argument
7853 DTRACE_NFSV4_2(op__open__confirm__start, struct compound_state *, cs, in rfs4_op_open_confirm()
7856 ASSERT(!rfs4_has_session(cs)); in rfs4_op_open_confirm()
7858 if (cs->vp == NULL) { in rfs4_op_open_confirm()
7859 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_open_confirm()
7863 if (cs->vp->v_type != VREG) { in rfs4_op_open_confirm()
7864 *cs->statusp = resp->status = in rfs4_op_open_confirm()
7865 cs->vp->v_type == VDIR ? NFS4ERR_ISDIR : NFS4ERR_INVAL; in rfs4_op_open_confirm()
7871 *cs->statusp = resp->status = status; in rfs4_op_open_confirm()
7876 if (cs->vp != sp->rs_finfo->rf_vp) { in rfs4_op_open_confirm()
7878 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_confirm()
7885 switch (rfs4_check_stateid_seqid(sp, &args->open_stateid, cs)) { in rfs4_op_open_confirm()
7888 resop, cs) != 0) { in rfs4_op_open_confirm()
7889 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_open_confirm()
7898 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_confirm()
7901 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_open_confirm()
7904 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_confirm()
7907 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_open_confirm()
7910 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_open_confirm()
7914 resop, cs)) { in rfs4_op_open_confirm()
7922 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_open_confirm()
7929 *cs->statusp = resp->status; in rfs4_op_open_confirm()
7936 resop, cs) != NFS4_CHKSEQ_OKAY) { in rfs4_op_open_confirm()
7937 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_open_confirm()
7940 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_open_confirm()
7951 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_open_confirm()
7958 DTRACE_NFSV4_2(op__open__confirm__done, struct compound_state *, cs, in rfs4_op_open_confirm()
7965 struct svc_req *req, struct compound_state *cs) in rfs4_op_open_downgrade() argument
7976 DTRACE_NFSV4_2(op__open__downgrade__start, struct compound_state *, cs, in rfs4_op_open_downgrade()
7979 if (cs->vp == NULL) { in rfs4_op_open_downgrade()
7980 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_open_downgrade()
7984 if (cs->vp->v_type != VREG) { in rfs4_op_open_downgrade()
7985 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_open_downgrade()
7991 *cs->statusp = resp->status = status; in rfs4_op_open_downgrade()
7996 if (cs->vp != sp->rs_finfo->rf_vp) { in rfs4_op_open_downgrade()
7998 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_downgrade()
8005 switch (rfs4_check_stateid_seqid(sp, &args->open_stateid, cs)) { in rfs4_op_open_downgrade()
8008 resop, cs) != NFS4_CHKSEQ_OKAY) { in rfs4_op_open_downgrade()
8009 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_open_downgrade()
8014 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_open_downgrade()
8017 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_downgrade()
8020 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_open_downgrade()
8023 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_open_downgrade()
8026 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_open_downgrade()
8029 ASSERT(!rfs4_has_session(cs)); in rfs4_op_open_downgrade()
8033 resop, cs)) { in rfs4_op_open_downgrade()
8041 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_open_downgrade()
8048 *cs->statusp = resp->status; in rfs4_op_open_downgrade()
8065 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_open_downgrade()
8087 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_open_downgrade()
8103 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_open_downgrade()
8183 vn_open_downgrade(cs->vp, fflags); in rfs4_op_open_downgrade()
8191 *cs->statusp = resp->status = NFS4_OK; in rfs4_op_open_downgrade()
8202 DTRACE_NFSV4_2(op__open__downgrade__done, struct compound_state *, cs, in rfs4_op_open_downgrade()
8230 struct svc_req *req, struct compound_state *cs) in rfs4_op_setclientid() argument
8240 DTRACE_NFSV4_2(op__setclientid__start, struct compound_state *, cs, in rfs4_op_setclientid()
8277 *cs->statusp = res->status = NFS4ERR_SERVERFAULT; in rfs4_op_setclientid()
8288 *cs->statusp = res->status = NFS4_OK; in rfs4_op_setclientid()
8322 if (!creds_ok(&cp_confirmed->rc_cr_set, req, cs)) { in rfs4_op_setclientid()
8330 *cs->statusp = res->status = NFS4ERR_CLID_INUSE; in rfs4_op_setclientid()
8364 *cs->statusp = res->status = NFS4_OK; in rfs4_op_setclientid()
8425 *cs->statusp = res->status = NFS4ERR_SERVERFAULT; in rfs4_op_setclientid()
8441 *cs->statusp = res->status = NFS4_OK; in rfs4_op_setclientid()
8453 DTRACE_NFSV4_2(op__setclientid__done, struct compound_state *, cs, in rfs4_op_setclientid()
8460 struct svc_req *req, struct compound_state *cs) in rfs4_op_setclientid_confirm() argument
8470 struct compound_state *, cs, in rfs4_op_setclientid_confirm()
8474 *cs->statusp = res->status = NFS4_OK; in rfs4_op_setclientid_confirm()
8479 *cs->statusp = res->status = in rfs4_op_setclientid_confirm()
8484 if (!creds_ok(&cp->rc_cr_set, req, cs)) { in rfs4_op_setclientid_confirm()
8485 *cs->statusp = res->status = NFS4ERR_CLID_INUSE; in rfs4_op_setclientid_confirm()
8492 *cs->statusp = res->status = NFS4ERR_STALE_CLIENTID; in rfs4_op_setclientid_confirm()
8537 struct compound_state *, cs, in rfs4_op_setclientid_confirm()
8545 struct svc_req *req, struct compound_state *cs) in rfs4_op_close() argument
8552 DTRACE_NFSV4_2(op__close__start, struct compound_state *, cs, in rfs4_op_close()
8555 if (cs->vp == NULL) { in rfs4_op_close()
8556 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_close()
8562 *cs->statusp = resp->status = status; in rfs4_op_close()
8567 if (cs->vp != sp->rs_finfo->rf_vp) { in rfs4_op_close()
8569 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_close()
8576 switch (rfs4_check_stateid_seqid(sp, &args->open_stateid, cs)) { in rfs4_op_close()
8579 resop, cs) != NFS4_CHKSEQ_OKAY) { in rfs4_op_close()
8580 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_close()
8585 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_close()
8588 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_close()
8591 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_close()
8594 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_close()
8597 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_close()
8600 ASSERT(!rfs4_has_session(cs)); in rfs4_op_close()
8604 resop, cs)) { in rfs4_op_close()
8612 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_close()
8619 *cs->statusp = resp->status; in rfs4_op_close()
8641 rfs4_state_close(sp, FALSE, FALSE, cs->cr); in rfs4_op_close()
8643 *cs->statusp = resp->status = status; in rfs4_op_close()
8649 DTRACE_NFSV4_2(op__close__done, struct compound_state *, cs, in rfs4_op_close()
9082 struct svc_req *req, struct compound_state *cs) in rfs4_op_lock() argument
9098 DTRACE_NFSV4_2(op__lock__start, struct compound_state *, cs, in rfs4_op_lock()
9101 if (cs->vp == NULL) { in rfs4_op_lock()
9102 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_lock()
9104 cs, LOCK4res *, resp); in rfs4_op_lock()
9119 *cs->statusp = resp->status = status; in rfs4_op_lock()
9121 cs, LOCK4res *, resp); in rfs4_op_lock()
9126 if (cs->vp != sp->rs_finfo->rf_vp) { in rfs4_op_lock()
9128 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_lock()
9130 cs, LOCK4res *, resp); in rfs4_op_lock()
9137 switch (rc = rfs4_check_stateid_seqid(sp, stateid, cs)) { in rfs4_op_lock()
9139 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_lock()
9142 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_lock()
9145 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_lock()
9148 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_lock()
9151 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_lock()
9154 if (rfs4_has_session(cs)) in rfs4_op_lock()
9158 ASSERT(!rfs4_has_session(cs)); in rfs4_op_lock()
9172 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_lock()
9193 *cs->statusp = resp->status = NFS4ERR_RESOURCE; in rfs4_op_lock()
9210 *cs->statusp = resp->status = NFS4ERR_SERVERFAULT; in rfs4_op_lock()
9226 if (!rfs4_has_session(cs) && !dup_lock && !create) { in rfs4_op_lock()
9228 *cs->statusp = in rfs4_op_lock()
9256 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_lock()
9264 *cs->statusp = resp->status; in rfs4_op_lock()
9298 *cs->statusp = resp->status = status; in rfs4_op_lock()
9300 cs, LOCK4res *, resp); in rfs4_op_lock()
9306 if (cs->vp != lsp->rls_state->rs_finfo->rf_vp) { in rfs4_op_lock()
9308 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_lock()
9310 cs, LOCK4res *, resp); in rfs4_op_lock()
9318 switch (rfs4_check_lo_stateid_seqid(lsp, stateid, cs)) { in rfs4_op_lock()
9324 if (rfs4_has_session(cs)) in rfs4_op_lock()
9355 *cs->statusp = resp->status; in rfs4_op_lock()
9366 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_lock()
9374 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_lock()
9377 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_lock()
9380 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_lock()
9383 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_lock()
9386 ASSERT(!rfs4_has_session(cs)); in rfs4_op_lock()
9398 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_lock()
9402 *cs->statusp = status = resp->status; in rfs4_op_lock()
9419 if (cs->vp->v_type != VREG) { in rfs4_op_lock()
9420 if (cs->vp->v_type == VDIR) in rfs4_op_lock()
9445 cs->deleg = TRUE; in rfs4_op_lock()
9448 args->offset, args->length, cs->cr, resop); in rfs4_op_lock()
9453 *cs->statusp = resp->status = status; in rfs4_op_lock()
9486 DTRACE_NFSV4_2(op__lock__done, struct compound_state *, cs, in rfs4_op_lock()
9516 struct svc_req *req, struct compound_state *cs) in rfs4_op_locku() argument
9524 DTRACE_NFSV4_2(op__locku__start, struct compound_state *, cs, in rfs4_op_locku()
9527 if (cs->vp == NULL) { in rfs4_op_locku()
9528 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_locku()
9529 DTRACE_NFSV4_2(op__locku__done, struct compound_state *, cs, in rfs4_op_locku()
9535 *cs->statusp = resp->status = status; in rfs4_op_locku()
9536 DTRACE_NFSV4_2(op__locku__done, struct compound_state *, cs, in rfs4_op_locku()
9542 if (cs->vp != lsp->rls_state->rs_finfo->rf_vp) { in rfs4_op_locku()
9544 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_locku()
9545 DTRACE_NFSV4_2(op__locku__done, struct compound_state *, cs, in rfs4_op_locku()
9553 switch (rfs4_check_lo_stateid_seqid(lsp, stateid, cs)) { in rfs4_op_locku()
9555 if (rfs4_has_session(cs)) in rfs4_op_locku()
9560 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_locku()
9565 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_locku()
9568 *cs->statusp = resp->status = NFS4ERR_BAD_STATEID; in rfs4_op_locku()
9571 *cs->statusp = resp->status = NFS4ERR_EXPIRED; in rfs4_op_locku()
9574 *cs->statusp = resp->status = NFS4ERR_OLD_STATEID; in rfs4_op_locku()
9577 ASSERT(!rfs4_has_session(cs)); in rfs4_op_locku()
9587 *cs->statusp = resp->status = NFS4ERR_BAD_SEQID; in rfs4_op_locku()
9591 *cs->statusp = status = resp->status; in rfs4_op_locku()
9607 if (cs->vp->v_type != VREG) { in rfs4_op_locku()
9608 if (cs->vp->v_type == VDIR) in rfs4_op_locku()
9621 args->offset, args->length, cs->cr, resop); in rfs4_op_locku()
9624 *cs->statusp = resp->status = status; in rfs4_op_locku()
9635 DTRACE_NFSV4_2(op__locku__done, struct compound_state *, cs, in rfs4_op_locku()
9648 struct svc_req *req, struct compound_state *cs) in rfs4_op_lockt() argument
9663 DTRACE_NFSV4_2(op__lockt__start, struct compound_state *, cs, in rfs4_op_lockt()
9666 if (cs->vp == NULL) { in rfs4_op_lockt()
9667 *cs->statusp = resp->status = NFS4ERR_NOFILEHANDLE; in rfs4_op_lockt()
9675 if (cs->vp->v_type != VREG) { in rfs4_op_lockt()
9676 if (cs->vp->v_type == VDIR) in rfs4_op_lockt()
9677 *cs->statusp = resp->status = NFS4ERR_ISDIR; in rfs4_op_lockt()
9679 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_lockt()
9689 *cs->statusp = resp->status = in rfs4_op_lockt()
9700 *cs->statusp = resp->status = NFS4ERR_STALE_CLIENTID; in rfs4_op_lockt()
9705 *cs->statusp = resp->status = NFS4ERR_GRACE; in rfs4_op_lockt()
9727 *cs->statusp = resp->status = NFS4ERR_INVAL; in rfs4_op_lockt()
9761 error = VOP_FRLOCK(cs->vp, F_GETLK, &flk, flag, (u_offset_t)0, in rfs4_op_lockt()
9762 NULL, cs->cr, NULL); in rfs4_op_lockt()
9794 *cs->statusp = resp->status; in rfs4_op_lockt()
9796 DTRACE_NFSV4_2(op__lockt__done, struct compound_state *, cs, in rfs4_op_lockt()