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
381 if (nfsd4_has_session(cstate) && in nfsd4_open()
383 &cstate->session->se_client->cl_flags) && in nfsd4_open()
387 if (nfsd4_has_session(cstate)) in nfsd4_open()
388 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
391 status = nfsd4_process_open1(cstate, open, nn); in nfsd4_open()
394 fh_put(&cstate->current_fh); in nfsd4_open()
395 fh_copy_shallow(&cstate->current_fh.fh_handle, in nfsd4_open()
397 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_open()
411 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
427 status = do_open_lookup(rqstp, cstate, open, &resfh); in nfsd4_open()
433 cstate, nn); in nfsd4_open()
439 status = do_open_fhandle(rqstp, cstate, open); in nfsd4_open()
442 resfh = &cstate->current_fh; in nfsd4_open()
466 if (resfh && resfh != &cstate->current_fh) { in nfsd4_open()
467 fh_dup2(&cstate->current_fh, resfh); in nfsd4_open()
471 nfsd4_cleanup_open_state(cstate, open); in nfsd4_open()
472 nfsd4_bump_seqid(cstate, status); in nfsd4_open()
482 static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct n… in nfsd4_open_omfg() argument
488 if (nfsd4_has_session(cstate)) in nfsd4_open_omfg()
491 return nfsd4_open(rqstp, cstate, open); in nfsd4_open_omfg()
498 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getfh() argument
501 if (!cstate->current_fh.fh_dentry) in nfsd4_getfh()
504 *getfh = &cstate->current_fh; in nfsd4_getfh()
509 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putfh() argument
512 fh_put(&cstate->current_fh); in nfsd4_putfh()
513 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; in nfsd4_putfh()
514 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, in nfsd4_putfh()
516 return fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_BYPASS_GSS); in nfsd4_putfh()
520 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putrootfh() argument
525 fh_put(&cstate->current_fh); in nfsd4_putrootfh()
526 status = exp_pseudoroot(rqstp, &cstate->current_fh); in nfsd4_putrootfh()
531 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_restorefh() argument
534 if (!cstate->save_fh.fh_dentry) in nfsd4_restorefh()
537 fh_dup2(&cstate->current_fh, &cstate->save_fh); in nfsd4_restorefh()
538 if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) { in nfsd4_restorefh()
539 memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); in nfsd4_restorefh()
540 SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); in nfsd4_restorefh()
546 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_savefh() argument
549 if (!cstate->current_fh.fh_dentry) in nfsd4_savefh()
552 fh_dup2(&cstate->save_fh, &cstate->current_fh); in nfsd4_savefh()
553 if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { in nfsd4_savefh()
554 memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); in nfsd4_savefh()
555 SET_STATE_ID(cstate, SAVED_STATE_ID_FLAG); in nfsd4_savefh()
564 nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_access() argument
571 return nfsd_access(rqstp, &cstate->current_fh, &access->ac_resp_access, in nfsd4_access()
590 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_commit() argument
594 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, in nfsd4_commit()
599 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_create() argument
608 status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, in nfsd4_create()
613 status = check_attr_support(rqstp, cstate, create->cr_bmval, in nfsd4_create()
620 status = nfsd_symlink(rqstp, &cstate->current_fh, in nfsd4_create()
630 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
640 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
646 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
652 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
659 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
678 fh_unlock(&cstate->current_fh); in nfsd4_create()
679 set_change_info(&create->cr_cinfo, &cstate->current_fh); in nfsd4_create()
680 fh_dup2(&cstate->current_fh, &resfh); in nfsd4_create()
687 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getattr() argument
692 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_getattr()
699 getattr->ga_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_getattr()
700 getattr->ga_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_getattr()
701 getattr->ga_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_getattr()
703 getattr->ga_fhp = &cstate->current_fh; in nfsd4_getattr()
708 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_link() argument
713 if (!cstate->save_fh.fh_dentry) in nfsd4_link()
715 status = nfsd_link(rqstp, &cstate->current_fh, in nfsd4_link()
716 link->li_name, link->li_namelen, &cstate->save_fh); in nfsd4_link()
718 set_change_info(&link->li_cinfo, &cstate->current_fh); in nfsd4_link()
740 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookupp() argument
743 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_lookupp()
747 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookup() argument
750 return nfsd_lookup(rqstp, &cstate->current_fh, in nfsd4_lookup()
752 &cstate->current_fh); in nfsd4_lookup()
756 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_read() argument
777 status = nfs4_preprocess_stateid_op(rqstp, cstate, &read->rd_stateid, in nfsd4_read()
786 read->rd_fhp = &cstate->current_fh; in nfsd4_read()
791 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readdir() argument
802 readdir->rd_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_readdir()
803 readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_readdir()
804 readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_readdir()
811 readdir->rd_fhp = &cstate->current_fh; in nfsd4_readdir()
816 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readlink() argument
820 readlink->rl_fhp = &cstate->current_fh; in nfsd4_readlink()
825 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_remove() argument
832 status = nfsd_unlink(rqstp, &cstate->current_fh, 0, in nfsd4_remove()
835 fh_unlock(&cstate->current_fh); in nfsd4_remove()
836 set_change_info(&remove->rm_cinfo, &cstate->current_fh); in nfsd4_remove()
842 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_rename() argument
847 if (!cstate->save_fh.fh_dentry) in nfsd4_rename()
850 !(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK)) in nfsd4_rename()
852 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, in nfsd4_rename()
853 rename->rn_snamelen, &cstate->current_fh, in nfsd4_rename()
857 set_change_info(&rename->rn_sinfo, &cstate->current_fh); in nfsd4_rename()
858 set_change_info(&rename->rn_tinfo, &cstate->save_fh); in nfsd4_rename()
863 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo() argument
872 err = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_EXEC); in nfsd4_secinfo()
875 err = nfsd_lookup_dentry(rqstp, &cstate->current_fh, in nfsd4_secinfo()
880 fh_unlock(&cstate->current_fh); in nfsd4_secinfo()
887 if (cstate->minorversion) in nfsd4_secinfo()
889 fh_put(&cstate->current_fh); in nfsd4_secinfo()
894 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo_no_name() argument
903 err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_secinfo_no_name()
911 sin->sin_exp = exp_get(cstate->current_fh.fh_export); in nfsd4_secinfo_no_name()
912 fh_put(&cstate->current_fh); in nfsd4_secinfo_no_name()
917 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setattr() argument
924 status = nfs4_preprocess_stateid_op(rqstp, cstate, in nfsd4_setattr()
931 err = fh_want_write(&cstate->current_fh); in nfsd4_setattr()
936 status = check_attr_support(rqstp, cstate, setattr->sa_bmval, in nfsd4_setattr()
942 status = nfsd4_set_nfs4_acl(rqstp, &cstate->current_fh, in nfsd4_setattr()
947 status = nfsd4_set_nfs4_label(rqstp, &cstate->current_fh, in nfsd4_setattr()
951 status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr, in nfsd4_setattr()
954 fh_drop_write(&cstate->current_fh); in nfsd4_setattr()
977 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_write() argument
989 status = nfs4_preprocess_stateid_op(rqstp, cstate, stateid, WR_STATE, in nfsd4_write()
1003 status = nfsd_vfs_write(rqstp, &cstate->current_fh, filp, in nfsd4_write()
1014 nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_fallocate() argument
1020 status = nfs4_preprocess_stateid_op(rqstp, cstate, in nfsd4_fallocate()
1028 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file, in nfsd4_fallocate()
1037 nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_allocate() argument
1040 return nfsd4_fallocate(rqstp, cstate, fallocate, 0); in nfsd4_allocate()
1044 nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_deallocate() argument
1047 return nfsd4_fallocate(rqstp, cstate, fallocate, in nfsd4_deallocate()
1052 nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_seek() argument
1059 status = nfs4_preprocess_stateid_op(rqstp, cstate, in nfsd4_seek()
1100 _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in _nfsd4_verify() argument
1107 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in _nfsd4_verify()
1111 status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); in _nfsd4_verify()
1130 status = nfsd4_encode_fattr_to_buf(&p, count, &cstate->current_fh, in _nfsd4_verify()
1131 cstate->current_fh.fh_export, in _nfsd4_verify()
1132 cstate->current_fh.fh_dentry, in _nfsd4_verify()
1158 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_nverify() argument
1163 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_nverify()
1168 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify() argument
1173 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_verify()
1197 struct nfsd4_compound_state *cstate, in nfsd4_getdeviceinfo() argument
1241 struct nfsd4_compound_state *cstate, in nfsd4_layoutget() argument
1244 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutget()
1294 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lgp->lg_sid, in nfsd4_layoutget()
1321 struct nfsd4_compound_state *cstate, in nfsd4_layoutcommit() argument
1325 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutcommit()
1356 nfserr = nfsd4_preprocess_layout_stateid(rqstp, cstate, &lcp->lc_sid, in nfsd4_layoutcommit()
1385 struct nfsd4_compound_state *cstate, in nfsd4_layoutreturn() argument
1388 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_layoutreturn()
1413 nfserr = nfsd4_return_file_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
1417 nfserr = nfsd4_return_client_layouts(rqstp, cstate, lrp); in nfsd4_layoutreturn()
1603 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_proc_compound() local
1604 struct svc_fh *current_fh = &cstate->current_fh; in nfsd4_proc_compound()
1605 struct svc_fh *save_fh = &cstate->save_fh; in nfsd4_proc_compound()
1615 cstate->minorversion = args->minorversion; in nfsd4_proc_compound()
1651 op->status = nfsd4_open_omfg(rqstp, cstate, op); in nfsd4_proc_compound()
1690 opdesc->op_get_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1691 op->status = opdesc->op_func(rqstp, cstate, &op->u); in nfsd4_proc_compound()
1695 opdesc->op_set_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1698 clear_current_stateid(cstate); in nfsd4_proc_compound()
1706 if (cstate->status == nfserr_replay_cache) { in nfsd4_proc_compound()
1712 op->replay = &cstate->replay_owner->so_replay; in nfsd4_proc_compound()
1724 nfsd4_cstate_clear_replay(cstate); in nfsd4_proc_compound()
1728 cstate->status = status; in nfsd4_proc_compound()
1731 BUG_ON(cstate->replay_owner); in nfsd4_proc_compound()