Lines Matching refs:cstate
94 check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in check_attr_support() argument
97 struct dentry *dentry = cstate->current_fh.fh_dentry; in check_attr_support()
103 if ((bmval[0] & ~nfsd_suppattrs0(cstate->minorversion)) || in check_attr_support()
104 (bmval[1] & ~nfsd_suppattrs1(cstate->minorversion)) || in check_attr_support()
105 (bmval[2] & ~nfsd_suppattrs2(cstate->minorversion))) in check_attr_support()
131 struct nfsd4_compound_state *cstate, struct nfsd4_open *open) in nfsd4_check_open_attributes() argument
138 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
141 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
228 static void nfsd4_set_open_owner_reply_cache(struct nfsd4_compound_state *cstate, struct nfsd4_open… in nfsd4_set_open_owner_reply_cache() argument
230 if (nfsd4_has_session(cstate)) in nfsd4_set_open_owner_reply_cache()
237 do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open… in do_open_lookup() argument
239 struct svc_fh *current_fh = &cstate->current_fh; in do_open_lookup()
304 nfsd4_set_open_owner_reply_cache(cstate, open, *resfh); in do_open_lookup()
316 do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *ope… in do_open_fhandle() argument
318 struct svc_fh *current_fh = &cstate->current_fh; in do_open_fhandle()
328 nfsd4_set_open_owner_reply_cache(cstate, open, current_fh); in do_open_fhandle()
360 nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_open() argument
382 if (nfsd4_has_session(cstate) && in nfsd4_open()
384 &cstate->session->se_client->cl_flags) && in nfsd4_open()
388 if (nfsd4_has_session(cstate)) in nfsd4_open()
389 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
393 status = nfsd4_process_open1(&resp->cstate, open, nn); in nfsd4_open()
396 fh_put(&cstate->current_fh); in nfsd4_open()
397 fh_copy_shallow(&cstate->current_fh.fh_handle, in nfsd4_open()
399 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_open()
413 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
429 status = do_open_lookup(rqstp, cstate, open, &resfh); in nfsd4_open()
435 cstate, nn); in nfsd4_open()
441 status = do_open_fhandle(rqstp, cstate, open); in nfsd4_open()
444 resfh = &cstate->current_fh; in nfsd4_open()
468 if (resfh && resfh != &cstate->current_fh) { in nfsd4_open()
469 fh_dup2(&cstate->current_fh, resfh); in nfsd4_open()
473 nfsd4_cleanup_open_state(cstate, open); in nfsd4_open()
474 nfsd4_bump_seqid(cstate, status); in nfsd4_open()
484 static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct n… in nfsd4_open_omfg() argument
490 if (nfsd4_has_session(cstate)) in nfsd4_open_omfg()
493 return nfsd4_open(rqstp, cstate, open); in nfsd4_open_omfg()
500 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getfh() argument
503 if (!cstate->current_fh.fh_dentry) in nfsd4_getfh()
506 *getfh = &cstate->current_fh; in nfsd4_getfh()
511 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putfh() argument
514 fh_put(&cstate->current_fh); in nfsd4_putfh()
515 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; in nfsd4_putfh()
516 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, in nfsd4_putfh()
518 return fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_BYPASS_GSS); in nfsd4_putfh()
522 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putrootfh() argument
527 fh_put(&cstate->current_fh); in nfsd4_putrootfh()
528 status = exp_pseudoroot(rqstp, &cstate->current_fh); in nfsd4_putrootfh()
533 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_restorefh() argument
536 if (!cstate->save_fh.fh_dentry) in nfsd4_restorefh()
539 fh_dup2(&cstate->current_fh, &cstate->save_fh); in nfsd4_restorefh()
540 if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) { in nfsd4_restorefh()
541 memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); in nfsd4_restorefh()
542 SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); in nfsd4_restorefh()
548 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_savefh() argument
551 if (!cstate->current_fh.fh_dentry) in nfsd4_savefh()
554 fh_dup2(&cstate->save_fh, &cstate->current_fh); in nfsd4_savefh()
555 if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { in nfsd4_savefh()
556 memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); in nfsd4_savefh()
557 SET_STATE_ID(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 return nfsd_access(rqstp, &cstate->current_fh, &access->ac_resp_access, in nfsd4_access()
592 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_commit() argument
596 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, in nfsd4_commit()
601 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_create() argument
610 status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, in nfsd4_create()
615 status = check_attr_support(rqstp, cstate, create->cr_bmval, in nfsd4_create()
622 status = nfsd_symlink(rqstp, &cstate->current_fh, in nfsd4_create()
632 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
642 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
648 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
654 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
661 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
680 fh_unlock(&cstate->current_fh); in nfsd4_create()
681 set_change_info(&create->cr_cinfo, &cstate->current_fh); in nfsd4_create()
682 fh_dup2(&cstate->current_fh, &resfh); in nfsd4_create()
689 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getattr() argument
694 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_getattr()
701 getattr->ga_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_getattr()
702 getattr->ga_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_getattr()
703 getattr->ga_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_getattr()
705 getattr->ga_fhp = &cstate->current_fh; in nfsd4_getattr()
710 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_link() argument
715 if (!cstate->save_fh.fh_dentry) in nfsd4_link()
717 status = nfsd_link(rqstp, &cstate->current_fh, in nfsd4_link()
718 link->li_name, link->li_namelen, &cstate->save_fh); in nfsd4_link()
720 set_change_info(&link->li_cinfo, &cstate->current_fh); in nfsd4_link()
742 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookupp() argument
745 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_lookupp()
749 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookup() argument
752 return nfsd_lookup(rqstp, &cstate->current_fh, in nfsd4_lookup()
754 &cstate->current_fh); in nfsd4_lookup()
758 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_read() argument
782 cstate, &read->rd_stateid, in nfsd4_read()
790 read->rd_fhp = &cstate->current_fh; in nfsd4_read()
795 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readdir() argument
806 readdir->rd_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_readdir()
807 readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_readdir()
808 readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_readdir()
815 readdir->rd_fhp = &cstate->current_fh; in nfsd4_readdir()
820 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readlink() argument
824 readlink->rl_fhp = &cstate->current_fh; in nfsd4_readlink()
829 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_remove() argument
836 status = nfsd_unlink(rqstp, &cstate->current_fh, 0, in nfsd4_remove()
839 fh_unlock(&cstate->current_fh); in nfsd4_remove()
840 set_change_info(&remove->rm_cinfo, &cstate->current_fh); in nfsd4_remove()
846 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_rename() argument
851 if (!cstate->save_fh.fh_dentry) in nfsd4_rename()
854 !(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK)) in nfsd4_rename()
856 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, in nfsd4_rename()
857 rename->rn_snamelen, &cstate->current_fh, in nfsd4_rename()
861 set_change_info(&rename->rn_sinfo, &cstate->current_fh); in nfsd4_rename()
862 set_change_info(&rename->rn_tinfo, &cstate->save_fh); in nfsd4_rename()
867 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo() argument
876 err = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_EXEC); in nfsd4_secinfo()
879 err = nfsd_lookup_dentry(rqstp, &cstate->current_fh, in nfsd4_secinfo()
884 fh_unlock(&cstate->current_fh); in nfsd4_secinfo()
891 if (cstate->minorversion) in nfsd4_secinfo()
893 fh_put(&cstate->current_fh); in nfsd4_secinfo()
898 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo_no_name() argument
907 err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_secinfo_no_name()
915 sin->sin_exp = exp_get(cstate->current_fh.fh_export); in nfsd4_secinfo_no_name()
916 fh_put(&cstate->current_fh); in nfsd4_secinfo_no_name()
921 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setattr() argument
928 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), cstate, in nfsd4_setattr()
935 err = fh_want_write(&cstate->current_fh); in nfsd4_setattr()
940 status = check_attr_support(rqstp, cstate, setattr->sa_bmval, in nfsd4_setattr()
946 status = nfsd4_set_nfs4_acl(rqstp, &cstate->current_fh, in nfsd4_setattr()
951 status = nfsd4_set_nfs4_label(rqstp, &cstate->current_fh, in nfsd4_setattr()
955 status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr, in nfsd4_setattr()
958 fh_drop_write(&cstate->current_fh); in nfsd4_setattr()
981 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_write() argument
996 cstate, stateid, WR_STATE, &filp); in nfsd4_write()
1009 status = nfsd_write(rqstp, &cstate->current_fh, filp, in nfsd4_write()
1021 nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_fallocate() argument
1027 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), cstate, in nfsd4_fallocate()
1037 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file, in nfsd4_fallocate()
1046 nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_allocate() argument
1049 return nfsd4_fallocate(rqstp, cstate, fallocate, 0); in nfsd4_allocate()
1053 nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_deallocate() argument
1056 return nfsd4_fallocate(rqstp, cstate, fallocate, in nfsd4_deallocate()
1061 nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_seek() argument
1068 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), cstate, in nfsd4_seek()
1111 _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in _nfsd4_verify() argument
1118 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in _nfsd4_verify()
1122 status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); in _nfsd4_verify()
1141 status = nfsd4_encode_fattr_to_buf(&p, count, &cstate->current_fh, in _nfsd4_verify()
1142 cstate->current_fh.fh_export, in _nfsd4_verify()
1143 cstate->current_fh.fh_dentry, in _nfsd4_verify()
1169 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_nverify() argument
1174 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_nverify()
1179 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify() argument
1184 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_verify()
1208 struct nfsd4_compound_state *cstate, in nfsd4_getdeviceinfo() argument
1252 struct nfsd4_compound_state *cstate, in nfsd4_layoutget() argument
1255 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutget()
1305 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lgp->lg_sid, in nfsd4_layoutget()
1331 struct nfsd4_compound_state *cstate, in nfsd4_layoutcommit() argument
1335 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutcommit()
1366 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lcp->lc_sid, in nfsd4_layoutcommit()
1396 struct nfsd4_compound_state *cstate, in nfsd4_layoutreturn() argument
1399 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutreturn()
1424 nfserr = nfsd4_return_file_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
1428 nfserr = nfsd4_return_client_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
1614 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_proc_compound() local
1615 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_proc_compound()
1616 struct svc_fh *save_fh = &cstate->save_fh; in nfsd4_proc_compound()
1626 cstate->minorversion = args->minorversion; in nfsd4_proc_compound()
1662 op->status = nfsd4_open_omfg(rqstp, cstate, op); in nfsd4_proc_compound()
1701 opdesc->op_get_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1702 op->status = opdesc->op_func(rqstp, cstate, &op->u); in nfsd4_proc_compound()
1706 opdesc->op_set_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1709 clear_current_stateid(cstate); in nfsd4_proc_compound()
1717 if (cstate->status == nfserr_replay_cache) { in nfsd4_proc_compound()
1723 op->replay = &cstate->replay_owner->so_replay; in nfsd4_proc_compound()
1735 nfsd4_cstate_clear_replay(cstate); in nfsd4_proc_compound()
1743 cstate->status = status; in nfsd4_proc_compound()
1746 BUG_ON(cstate->replay_owner); in nfsd4_proc_compound()