Lines Matching refs:cstate

82 check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,  in check_attr_support()  argument
85 struct dentry *dentry = cstate->current_fh.fh_dentry; in check_attr_support()
86 struct svc_export *exp = cstate->current_fh.fh_export; in check_attr_support()
88 if (!nfsd_attrs_supported(cstate->minorversion, bmval)) in check_attr_support()
105 struct nfsd4_compound_state *cstate, struct nfsd4_open *open) in nfsd4_check_open_attributes() argument
112 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
115 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
179 static void nfsd4_set_open_owner_reply_cache(struct nfsd4_compound_state *cstate, struct nfsd4_open… in nfsd4_set_open_owner_reply_cache() argument
181 if (nfsd4_has_session(cstate)) in nfsd4_set_open_owner_reply_cache()
418 do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open… in do_open_lookup() argument
420 struct svc_fh *current_fh = &cstate->current_fh; in do_open_lookup()
473 nfsd4_set_open_owner_reply_cache(cstate, open, *resfh); in do_open_lookup()
485 do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *ope… in do_open_fhandle() argument
487 struct svc_fh *current_fh = &cstate->current_fh; in do_open_fhandle()
496 nfsd4_set_open_owner_reply_cache(cstate, open, current_fh); in do_open_fhandle()
526 nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_open() argument
552 if (nfsd4_has_session(cstate) && in nfsd4_open()
553 !test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &cstate->clp->cl_flags) && in nfsd4_open()
557 if (nfsd4_has_session(cstate)) in nfsd4_open()
558 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
561 status = nfsd4_process_open1(cstate, open, nn); in nfsd4_open()
564 fh_put(&cstate->current_fh); in nfsd4_open()
565 fh_copy_shallow(&cstate->current_fh.fh_handle, in nfsd4_open()
567 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_open()
581 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
597 status = do_open_lookup(rqstp, cstate, open, &resfh); in nfsd4_open()
602 status = nfs4_check_open_reclaim(cstate->clp); in nfsd4_open()
610 status = do_open_fhandle(rqstp, cstate, open); in nfsd4_open()
613 resfh = &cstate->current_fh; in nfsd4_open()
635 if (resfh && resfh != &cstate->current_fh) { in nfsd4_open()
636 fh_dup2(&cstate->current_fh, resfh); in nfsd4_open()
640 nfsd4_cleanup_open_state(cstate, open); in nfsd4_open()
641 nfsd4_bump_seqid(cstate, status); in nfsd4_open()
651 static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct n… in nfsd4_open_omfg() argument
657 if (nfsd4_has_session(cstate)) in nfsd4_open_omfg()
660 return nfsd4_open(rqstp, cstate, &op->u); in nfsd4_open_omfg()
667 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getfh() argument
670 u->getfh = &cstate->current_fh; in nfsd4_getfh()
675 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putfh() argument
681 fh_put(&cstate->current_fh); in nfsd4_putfh()
682 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; in nfsd4_putfh()
683 memcpy(&cstate->current_fh.fh_handle.fh_raw, putfh->pf_fhval, in nfsd4_putfh()
685 ret = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_BYPASS_GSS); in nfsd4_putfh()
688 SET_FH_FLAG(&cstate->current_fh, NFSD4_FH_FOREIGN); in nfsd4_putfh()
696 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putrootfh() argument
699 fh_put(&cstate->current_fh); in nfsd4_putrootfh()
701 return exp_pseudoroot(rqstp, &cstate->current_fh); in nfsd4_putrootfh()
705 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_restorefh() argument
708 if (!cstate->save_fh.fh_dentry) in nfsd4_restorefh()
711 fh_dup2(&cstate->current_fh, &cstate->save_fh); in nfsd4_restorefh()
712 if (HAS_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG)) { in nfsd4_restorefh()
713 memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); in nfsd4_restorefh()
714 SET_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG); in nfsd4_restorefh()
720 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_savefh() argument
723 fh_dup2(&cstate->save_fh, &cstate->current_fh); in nfsd4_savefh()
724 if (HAS_CSTATE_FLAG(cstate, CURRENT_STATE_ID_FLAG)) { in nfsd4_savefh()
725 memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); in nfsd4_savefh()
726 SET_CSTATE_FLAG(cstate, SAVED_STATE_ID_FLAG); in nfsd4_savefh()
735 nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_access() argument
742 if (cstate->minorversion >= 2) in nfsd4_access()
750 return nfsd_access(rqstp, &cstate->current_fh, &access->ac_resp_access, in nfsd4_access()
764 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_commit() argument
771 status = nfsd_file_acquire(rqstp, &cstate->current_fh, NFSD_MAY_WRITE | in nfsd4_commit()
776 status = nfsd_commit(rqstp, &cstate->current_fh, nf, commit->co_offset, in nfsd4_commit()
784 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_create() argument
798 status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_NOP); in nfsd4_create()
802 status = check_attr_support(rqstp, cstate, create->cr_bmval, in nfsd4_create()
811 status = nfsd_symlink(rqstp, &cstate->current_fh, in nfsd4_create()
822 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
833 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
839 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
845 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
852 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
868 set_change_info(&create->cr_cinfo, &cstate->current_fh); in nfsd4_create()
869 fh_dup2(&cstate->current_fh, &resfh); in nfsd4_create()
879 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getattr() argument
885 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_getattr()
892 getattr->ga_bmval[0] &= nfsd_suppattrs[cstate->minorversion][0]; in nfsd4_getattr()
893 getattr->ga_bmval[1] &= nfsd_suppattrs[cstate->minorversion][1]; in nfsd4_getattr()
894 getattr->ga_bmval[2] &= nfsd_suppattrs[cstate->minorversion][2]; in nfsd4_getattr()
896 getattr->ga_fhp = &cstate->current_fh; in nfsd4_getattr()
901 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_link() argument
907 status = nfsd_link(rqstp, &cstate->current_fh, in nfsd4_link()
908 link->li_name, link->li_namelen, &cstate->save_fh); in nfsd4_link()
910 set_change_info(&link->li_cinfo, &cstate->current_fh); in nfsd4_link()
932 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookupp() argument
935 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_lookupp()
939 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookup() argument
942 return nfsd_lookup(rqstp, &cstate->current_fh, in nfsd4_lookup()
944 &cstate->current_fh); in nfsd4_lookup()
948 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_read() argument
956 trace_nfsd_read_start(rqstp, &cstate->current_fh, in nfsd4_read()
977 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_read()
982 read->rd_fhp = &cstate->current_fh; in nfsd4_read()
997 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readdir() argument
1009 readdir->rd_bmval[0] &= nfsd_suppattrs[cstate->minorversion][0]; in nfsd4_readdir()
1010 readdir->rd_bmval[1] &= nfsd_suppattrs[cstate->minorversion][1]; in nfsd4_readdir()
1011 readdir->rd_bmval[2] &= nfsd_suppattrs[cstate->minorversion][2]; in nfsd4_readdir()
1018 readdir->rd_fhp = &cstate->current_fh; in nfsd4_readdir()
1023 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readlink() argument
1027 u->readlink.rl_fhp = &cstate->current_fh; in nfsd4_readlink()
1032 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_remove() argument
1040 status = nfsd_unlink(rqstp, &cstate->current_fh, 0, in nfsd4_remove()
1043 set_change_info(&remove->rm_cinfo, &cstate->current_fh); in nfsd4_remove()
1048 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_rename() argument
1056 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, in nfsd4_rename()
1057 rename->rn_snamelen, &cstate->current_fh, in nfsd4_rename()
1061 set_change_info(&rename->rn_sinfo, &cstate->save_fh); in nfsd4_rename()
1062 set_change_info(&rename->rn_tinfo, &cstate->current_fh); in nfsd4_rename()
1067 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo() argument
1075 err = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_EXEC); in nfsd4_secinfo()
1078 err = nfsd_lookup_dentry(rqstp, &cstate->current_fh, in nfsd4_secinfo()
1089 if (cstate->minorversion) in nfsd4_secinfo()
1091 fh_put(&cstate->current_fh); in nfsd4_secinfo()
1096 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo_no_name() argument
1105 err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_secinfo_no_name()
1113 u->secinfo_no_name.sin_exp = exp_get(cstate->current_fh.fh_export); in nfsd4_secinfo_no_name()
1114 fh_put(&cstate->current_fh); in nfsd4_secinfo_no_name()
1133 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setattr() argument
1146 status = nfs4_preprocess_stateid_op(rqstp, cstate, in nfsd4_setattr()
1147 &cstate->current_fh, &setattr->sa_stateid, in nfsd4_setattr()
1152 err = fh_want_write(&cstate->current_fh); in nfsd4_setattr()
1157 status = check_attr_support(rqstp, cstate, setattr->sa_bmval, in nfsd4_setattr()
1162 inode = cstate->current_fh.fh_dentry->d_inode; in nfsd4_setattr()
1168 status = nfsd_setattr(rqstp, &cstate->current_fh, &attrs, in nfsd4_setattr()
1176 fh_drop_write(&cstate->current_fh); in nfsd4_setattr()
1181 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_write() argument
1196 trace_nfsd_write_start(rqstp, &cstate->current_fh, in nfsd4_write()
1198 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_write()
1208 status = nfsd_vfs_write(rqstp, &cstate->current_fh, nf, in nfsd4_write()
1215 trace_nfsd_write_done(rqstp, &cstate->current_fh, in nfsd4_write()
1221 nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify_copy() argument
1227 if (!cstate->save_fh.fh_dentry) in nfsd4_verify_copy()
1230 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh, in nfsd4_verify_copy()
1235 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_verify_copy()
1259 nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_clone() argument
1266 status = nfsd4_verify_copy(rqstp, cstate, &clone->cl_src_stateid, &src, in nfsd4_clone()
1273 EX_ISSYNC(cstate->current_fh.fh_export)); in nfsd4_clone()
1509 struct nfsd4_compound_state *cstate, in nfsd4_setup_inter_ssc() argument
1517 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_setup_inter_ssc()
1527 s_fh = &cstate->save_fh; in nfsd4_setup_inter_ssc()
1567 struct nfsd4_compound_state *cstate, in nfsd4_setup_inter_ssc() argument
1589 struct nfsd4_compound_state *cstate, in nfsd4_setup_intra_ssc() argument
1592 return nfsd4_verify_copy(rqstp, cstate, &copy->cp_src_stateid, in nfsd4_setup_intra_ssc()
1794 nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_copy() argument
1806 status = nfsd4_setup_inter_ssc(rqstp, cstate, copy); in nfsd4_copy()
1810 status = nfsd4_setup_intra_ssc(rqstp, cstate, copy); in nfsd4_copy()
1815 copy->cp_clp = cstate->clp; in nfsd4_copy()
1816 memcpy(&copy->fh, &cstate->current_fh.fh_handle, in nfsd4_copy()
1897 struct nfsd4_compound_state *cstate, in nfsd4_offload_cancel() argument
1902 struct nfs4_client *clp = cstate->clp; in nfsd4_offload_cancel()
1916 nfsd4_copy_notify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_copy_notify() argument
1924 struct nfs4_client *clp = cstate->clp; in nfsd4_copy_notify()
1926 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_copy_notify()
1960 nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_fallocate() argument
1966 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_fallocate()
1972 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, nf->nf_file, in nfsd4_fallocate()
1982 struct nfsd4_compound_state *cstate, in nfsd4_offload_status() argument
1988 struct nfs4_client *clp = cstate->clp; in nfsd4_offload_status()
2002 nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_allocate() argument
2005 return nfsd4_fallocate(rqstp, cstate, &u->allocate, 0); in nfsd4_allocate()
2009 nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_deallocate() argument
2012 return nfsd4_fallocate(rqstp, cstate, &u->deallocate, in nfsd4_deallocate()
2017 nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_seek() argument
2025 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh, in nfsd4_seek()
2064 _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in _nfsd4_verify() argument
2071 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in _nfsd4_verify()
2075 status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); in _nfsd4_verify()
2094 status = nfsd4_encode_fattr_to_buf(&p, count, &cstate->current_fh, in _nfsd4_verify()
2095 cstate->current_fh.fh_export, in _nfsd4_verify()
2096 cstate->current_fh.fh_dentry, in _nfsd4_verify()
2122 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_nverify() argument
2127 status = _nfsd4_verify(rqstp, cstate, &u->verify); in nfsd4_nverify()
2132 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify() argument
2137 status = _nfsd4_verify(rqstp, cstate, &u->nverify); in nfsd4_verify()
2162 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_getdeviceinfo() argument
2197 rqstp, cstate->clp, gdp); in nfsd4_getdeviceinfo()
2214 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutget() argument
2217 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutget()
2267 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lgp->lg_sid, in nfsd4_layoutget()
2300 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutcommit() argument
2304 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutcommit()
2335 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lcp->lc_sid, in nfsd4_layoutcommit()
2364 struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) in nfsd4_layoutreturn() argument
2367 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutreturn()
2392 nfserr = nfsd4_return_file_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
2396 nfserr = nfsd4_return_client_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
2410 nfsd4_getxattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getxattr() argument
2415 return nfsd_getxattr(rqstp, &cstate->current_fh, in nfsd4_getxattr()
2421 nfsd4_setxattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setxattr() argument
2430 ret = nfsd_setxattr(rqstp, &cstate->current_fh, setxattr->setxa_name, in nfsd4_setxattr()
2435 set_change_info(&setxattr->setxa_cinfo, &cstate->current_fh); in nfsd4_setxattr()
2441 nfsd4_listxattrs(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_listxattrs() argument
2448 return nfsd_listxattr(rqstp, &cstate->current_fh, in nfsd4_listxattrs()
2453 nfsd4_removexattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_removexattr() argument
2462 ret = nfsd_removexattr(rqstp, &cstate->current_fh, in nfsd4_removexattr()
2466 set_change_info(&removexattr->rmxa_cinfo, &cstate->current_fh); in nfsd4_removexattr()
2621 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_proc_compound() local
2622 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_proc_compound()
2623 struct svc_fh *save_fh = &cstate->save_fh; in nfsd4_proc_compound()
2638 cstate->minorversion = args->minorversion; in nfsd4_proc_compound()
2663 rqstp->rq_lease_breaker = (void **)&cstate->clp; in nfsd4_proc_compound()
2672 if (cstate->minorversion == 0 && in nfsd4_proc_compound()
2686 op->status = nfsd4_open_omfg(rqstp, cstate, op); in nfsd4_proc_compound()
2724 op->opdesc->op_get_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
2725 op->status = op->opdesc->op_func(rqstp, cstate, &op->u); in nfsd4_proc_compound()
2728 if (cstate->status == nfserr_replay_cache) { in nfsd4_proc_compound()
2735 op->opdesc->op_set_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
2738 clear_current_stateid(cstate); in nfsd4_proc_compound()
2746 op->replay = &cstate->replay_owner->so_replay; in nfsd4_proc_compound()
2757 nfsd4_cstate_clear_replay(cstate); in nfsd4_proc_compound()
2763 BUG_ON(cstate->replay_owner); in nfsd4_proc_compound()
2765 cstate->status = status; in nfsd4_proc_compound()
3577 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_spo_must_allow() local
3578 struct nfs4_op_map *allow = &cstate->clp->cl_spo_must_allow; in nfsd4_spo_must_allow()
3581 if (!cstate->minorversion) in nfsd4_spo_must_allow()
3584 if (cstate->spo_must_allowed) in nfsd4_spo_must_allow()
3591 cstate->clp->cl_mach_cred && in nfsd4_spo_must_allow()
3592 nfsd4_mach_creds_match(cstate->clp, rqstp)) { in nfsd4_spo_must_allow()
3593 cstate->spo_must_allowed = true; in nfsd4_spo_must_allow()
3597 cstate->spo_must_allowed = false; in nfsd4_spo_must_allow()