Lines Matching refs:cstate
98 check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in check_attr_support() argument
101 struct dentry *dentry = cstate->current_fh.fh_dentry; in check_attr_support()
102 struct svc_export *exp = cstate->current_fh.fh_export; in check_attr_support()
104 if (!nfsd_attrs_supported(cstate->minorversion, bmval)) in check_attr_support()
121 struct nfsd4_compound_state *cstate, struct nfsd4_open *open) in nfsd4_check_open_attributes() argument
128 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
131 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
218 static void nfsd4_set_open_owner_reply_cache(struct nfsd4_compound_state *cstate, struct nfsd4_open… in nfsd4_set_open_owner_reply_cache() argument
220 if (nfsd4_has_session(cstate)) in nfsd4_set_open_owner_reply_cache()
227 do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open… in do_open_lookup() argument
229 struct svc_fh *current_fh = &cstate->current_fh; in do_open_lookup()
296 nfsd4_set_open_owner_reply_cache(cstate, open, *resfh); in do_open_lookup()
308 do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *ope… in do_open_fhandle() argument
310 struct svc_fh *current_fh = &cstate->current_fh; in do_open_fhandle()
320 nfsd4_set_open_owner_reply_cache(cstate, open, current_fh); in do_open_fhandle()
352 nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_open() argument
375 if (nfsd4_has_session(cstate) && in nfsd4_open()
377 &cstate->session->se_client->cl_flags) && in nfsd4_open()
381 if (nfsd4_has_session(cstate)) in nfsd4_open()
382 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
385 status = nfsd4_process_open1(cstate, open, nn); in nfsd4_open()
388 fh_put(&cstate->current_fh); in nfsd4_open()
389 fh_copy_shallow(&cstate->current_fh.fh_handle, in nfsd4_open()
391 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_open()
405 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
421 status = do_open_lookup(rqstp, cstate, open, &resfh); in nfsd4_open()
427 cstate, nn); in nfsd4_open()
435 status = do_open_fhandle(rqstp, cstate, open); in nfsd4_open()
438 resfh = &cstate->current_fh; in nfsd4_open()
464 if (resfh && resfh != &cstate->current_fh) { in nfsd4_open()
465 fh_dup2(&cstate->current_fh, resfh); in nfsd4_open()
469 nfsd4_cleanup_open_state(cstate, open); in nfsd4_open()
470 nfsd4_bump_seqid(cstate, status); in nfsd4_open()
480 static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct n… in nfsd4_open_omfg() argument
486 if (nfsd4_has_session(cstate)) in nfsd4_open_omfg()
489 return nfsd4_open(rqstp, cstate, &op->u); in nfsd4_open_omfg()
496 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getfh() argument
499 u->getfh = &cstate->current_fh; in nfsd4_getfh()
504 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putfh() argument
510 fh_put(&cstate->current_fh); in nfsd4_putfh()
511 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; in nfsd4_putfh()
512 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, in nfsd4_putfh()
514 ret = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_BYPASS_GSS); in nfsd4_putfh()
517 SET_FH_FLAG(&cstate->current_fh, NFSD4_FH_FOREIGN); in nfsd4_putfh()
525 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putrootfh() argument
530 fh_put(&cstate->current_fh); in nfsd4_putrootfh()
531 status = exp_pseudoroot(rqstp, &cstate->current_fh); in nfsd4_putrootfh()
536 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_restorefh() argument
539 if (!cstate->save_fh.fh_dentry) in nfsd4_restorefh()
542 fh_dup2(&cstate->current_fh, &cstate->save_fh); in nfsd4_restorefh()
543 if (HAS_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG)) { in nfsd4_restorefh()
544 memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); in nfsd4_restorefh()
545 SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG); in nfsd4_restorefh()
551 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_savefh() argument
554 fh_dup2(&cstate->save_fh, &cstate->current_fh); in nfsd4_savefh()
555 if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG)) { in nfsd4_savefh()
556 memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); in nfsd4_savefh()
557 SET_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG); in nfsd4_savefh()
566 nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_access() argument
573 if (cstate->minorversion >= 2) in nfsd4_access()
581 return nfsd_access(rqstp, &cstate->current_fh, &access->ac_resp_access, in nfsd4_access()
595 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_commit() argument
600 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, in nfsd4_commit()
606 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_create() argument
616 status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_NOP); in nfsd4_create()
620 status = check_attr_support(rqstp, cstate, create->cr_bmval, in nfsd4_create()
628 status = nfsd_symlink(rqstp, &cstate->current_fh, in nfsd4_create()
639 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
650 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
656 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
662 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
669 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
688 fh_unlock(&cstate->current_fh); in nfsd4_create()
689 set_change_info(&create->cr_cinfo, &cstate->current_fh); in nfsd4_create()
690 fh_dup2(&cstate->current_fh, &resfh); in nfsd4_create()
699 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getattr() argument
705 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_getattr()
712 getattr->ga_bmval[0] &= nfsd_suppattrs[cstate->minorversion][0]; in nfsd4_getattr()
713 getattr->ga_bmval[1] &= nfsd_suppattrs[cstate->minorversion][1]; in nfsd4_getattr()
714 getattr->ga_bmval[2] &= nfsd_suppattrs[cstate->minorversion][2]; in nfsd4_getattr()
716 getattr->ga_fhp = &cstate->current_fh; in nfsd4_getattr()
721 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_link() argument
727 status = nfsd_link(rqstp, &cstate->current_fh, in nfsd4_link()
728 link->li_name, link->li_namelen, &cstate->save_fh); in nfsd4_link()
730 set_change_info(&link->li_cinfo, &cstate->current_fh); in nfsd4_link()
752 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookupp() argument
755 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_lookupp()
759 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookup() argument
762 return nfsd_lookup(rqstp, &cstate->current_fh, in nfsd4_lookup()
764 &cstate->current_fh); in nfsd4_lookup()
768 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_read() argument
778 trace_nfsd_read_start(rqstp, &cstate->current_fh, in nfsd4_read()
793 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_read()
803 read->rd_fhp = &cstate->current_fh; in nfsd4_read()
818 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readdir() argument
830 readdir->rd_bmval[0] &= nfsd_suppattrs[cstate->minorversion][0]; in nfsd4_readdir()
831 readdir->rd_bmval[1] &= nfsd_suppattrs[cstate->minorversion][1]; in nfsd4_readdir()
832 readdir->rd_bmval[2] &= nfsd_suppattrs[cstate->minorversion][2]; in nfsd4_readdir()
839 readdir->rd_fhp = &cstate->current_fh; in nfsd4_readdir()
844 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readlink() argument
848 u->readlink.rl_fhp = &cstate->current_fh; in nfsd4_readlink()
853 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_remove() argument
861 status = nfsd_unlink(rqstp, &cstate->current_fh, 0, in nfsd4_remove()
864 fh_unlock(&cstate->current_fh); in nfsd4_remove()
865 set_change_info(&remove->rm_cinfo, &cstate->current_fh); in nfsd4_remove()
871 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_rename() argument
879 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, in nfsd4_rename()
880 rename->rn_snamelen, &cstate->current_fh, in nfsd4_rename()
884 set_change_info(&rename->rn_sinfo, &cstate->current_fh); in nfsd4_rename()
885 set_change_info(&rename->rn_tinfo, &cstate->save_fh); in nfsd4_rename()
890 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo() argument
898 err = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_EXEC); in nfsd4_secinfo()
901 err = nfsd_lookup_dentry(rqstp, &cstate->current_fh, in nfsd4_secinfo()
906 fh_unlock(&cstate->current_fh); in nfsd4_secinfo()
913 if (cstate->minorversion) in nfsd4_secinfo()
915 fh_put(&cstate->current_fh); in nfsd4_secinfo()
920 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo_no_name() argument
929 err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_secinfo_no_name()
937 u->secinfo_no_name.sin_exp = exp_get(cstate->current_fh.fh_export); in nfsd4_secinfo_no_name()
938 fh_put(&cstate->current_fh); in nfsd4_secinfo_no_name()
957 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setattr() argument
965 status = nfs4_preprocess_stateid_op(rqstp, cstate, in nfsd4_setattr()
966 &cstate->current_fh, &setattr->sa_stateid, in nfsd4_setattr()
973 err = fh_want_write(&cstate->current_fh); in nfsd4_setattr()
978 status = check_attr_support(rqstp, cstate, setattr->sa_bmval, in nfsd4_setattr()
984 status = nfsd4_set_nfs4_acl(rqstp, &cstate->current_fh, in nfsd4_setattr()
989 status = nfsd4_set_nfs4_label(rqstp, &cstate->current_fh, in nfsd4_setattr()
993 status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr, in nfsd4_setattr()
996 fh_drop_write(&cstate->current_fh); in nfsd4_setattr()
1001 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_write() argument
1016 trace_nfsd_write_start(rqstp, &cstate->current_fh, in nfsd4_write()
1018 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_write()
1031 status = nfsd_vfs_write(rqstp, &cstate->current_fh, nf, in nfsd4_write()
1038 trace_nfsd_write_done(rqstp, &cstate->current_fh, in nfsd4_write()
1044 nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify_copy() argument
1050 if (!cstate->save_fh.fh_dentry) in nfsd4_verify_copy()
1053 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh, in nfsd4_verify_copy()
1060 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_verify_copy()
1084 nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_clone() argument
1091 status = nfsd4_verify_copy(rqstp, cstate, &clone->cl_src_stateid, &src, in nfsd4_clone()
1098 EX_ISSYNC(cstate->current_fh.fh_export)); in nfsd4_clone()
1267 struct nfsd4_compound_state *cstate, in nfsd4_setup_inter_ssc() argument
1275 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_setup_inter_ssc()
1285 s_fh = &cstate->save_fh; in nfsd4_setup_inter_ssc()
1312 struct nfsd4_compound_state *cstate, in nfsd4_setup_inter_ssc() argument
1341 struct nfsd4_compound_state *cstate, in nfsd4_setup_intra_ssc() argument
1344 return nfsd4_verify_copy(rqstp, cstate, ©->cp_src_stateid, in nfsd4_setup_intra_ssc()
1505 nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_copy() argument
1517 status = nfsd4_setup_inter_ssc(rqstp, cstate, copy, in nfsd4_copy()
1522 status = nfsd4_setup_intra_ssc(rqstp, cstate, copy); in nfsd4_copy()
1527 copy->cp_clp = cstate->clp; in nfsd4_copy()
1528 memcpy(©->fh, &cstate->current_fh.fh_handle, in nfsd4_copy()
1586 struct nfsd4_compound_state *cstate, in nfsd4_offload_cancel() argument
1591 struct nfs4_client *clp = cstate->clp; in nfsd4_offload_cancel()
1605 nfsd4_copy_notify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_copy_notify() argument
1613 struct nfs4_client *clp = cstate->clp; in nfsd4_copy_notify()
1615 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_copy_notify()
1649 nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_fallocate() argument
1655 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_fallocate()
1663 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, nf->nf_file, in nfsd4_fallocate()
1672 struct nfsd4_compound_state *cstate, in nfsd4_offload_status() argument
1678 struct nfs4_client *clp = cstate->clp; in nfsd4_offload_status()
1691 nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_allocate() argument
1694 return nfsd4_fallocate(rqstp, cstate, &u->allocate, 0); in nfsd4_allocate()
1698 nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_deallocate() argument
1701 return nfsd4_fallocate(rqstp, cstate, &u->deallocate, in nfsd4_deallocate()
1706 nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_seek() argument
1714 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_seek()
1755 _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in _nfsd4_verify() argument
1762 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in _nfsd4_verify()
1766 status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); in _nfsd4_verify()
1785 status = nfsd4_encode_fattr_to_buf(&p, count, &cstate->current_fh, in _nfsd4_verify()
1786 cstate->current_fh.fh_export, in _nfsd4_verify()
1787 cstate->current_fh.fh_dentry, in _nfsd4_verify()
1813 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_nverify() argument
1818 status = _nfsd4_verify(rqstp, cstate, &u->verify); in nfsd4_nverify()
1823 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify() argument
1828 status = _nfsd4_verify(rqstp, cstate, &u->nverify); in nfsd4_verify()
1853 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_getdeviceinfo() argument
1888 rqstp, cstate->session->se_client, gdp); in nfsd4_getdeviceinfo()
1905 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutget() argument
1908 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutget()
1958 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lgp->lg_sid, in nfsd4_layoutget()
1991 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutcommit() argument
1995 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutcommit()
2026 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lcp->lc_sid, in nfsd4_layoutcommit()
2055 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutreturn() argument
2058 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutreturn()
2083 nfserr = nfsd4_return_file_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
2087 nfserr = nfsd4_return_client_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
2101 nfsd4_getxattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getxattr() argument
2106 return nfsd_getxattr(rqstp, &cstate->current_fh, in nfsd4_getxattr()
2112 nfsd4_setxattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setxattr() argument
2121 ret = nfsd_setxattr(rqstp, &cstate->current_fh, setxattr->setxa_name, in nfsd4_setxattr()
2126 set_change_info(&setxattr->setxa_cinfo, &cstate->current_fh); in nfsd4_setxattr()
2132 nfsd4_listxattrs(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_listxattrs() argument
2139 return nfsd_listxattr(rqstp, &cstate->current_fh, in nfsd4_listxattrs()
2144 nfsd4_removexattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_removexattr() argument
2153 ret = nfsd_removexattr(rqstp, &cstate->current_fh, in nfsd4_removexattr()
2157 set_change_info(&removexattr->rmxa_cinfo, &cstate->current_fh); in nfsd4_removexattr()
2331 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_proc_compound() local
2332 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_proc_compound()
2333 struct svc_fh *save_fh = &cstate->save_fh; in nfsd4_proc_compound()
2344 cstate->minorversion = args->minorversion; in nfsd4_proc_compound()
2372 rqstp->rq_lease_breaker = (void **)&cstate->clp; in nfsd4_proc_compound()
2385 op->status = nfsd4_open_omfg(rqstp, cstate, op); in nfsd4_proc_compound()
2423 op->opdesc->op_get_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
2424 op->status = op->opdesc->op_func(rqstp, cstate, &op->u); in nfsd4_proc_compound()
2427 if (cstate->status == nfserr_replay_cache) { in nfsd4_proc_compound()
2434 op->opdesc->op_set_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
2437 clear_current_stateid(cstate); in nfsd4_proc_compound()
2445 op->replay = &cstate->replay_owner->so_replay; in nfsd4_proc_compound()
2456 nfsd4_cstate_clear_replay(cstate); in nfsd4_proc_compound()
2462 BUG_ON(cstate->replay_owner); in nfsd4_proc_compound()
2464 cstate->status = status; in nfsd4_proc_compound()
3247 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_spo_must_allow() local
3248 struct nfs4_op_map *allow = &cstate->clp->cl_spo_must_allow; in nfsd4_spo_must_allow()
3251 if (!cstate->minorversion) in nfsd4_spo_must_allow()
3254 if (cstate->spo_must_allowed) in nfsd4_spo_must_allow()
3261 cstate->clp->cl_mach_cred && in nfsd4_spo_must_allow()
3262 nfsd4_mach_creds_match(cstate->clp, rqstp)) { in nfsd4_spo_must_allow()
3263 cstate->spo_must_allowed = true; in nfsd4_spo_must_allow()
3267 cstate->spo_must_allowed = false; in nfsd4_spo_must_allow()