Lines Matching refs:cstate
59 check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in check_attr_support() argument
62 struct dentry *dentry = cstate->current_fh.fh_dentry; in check_attr_support()
68 if ((bmval[0] & ~nfsd_suppattrs0(cstate->minorversion)) || in check_attr_support()
69 (bmval[1] & ~nfsd_suppattrs1(cstate->minorversion)) || in check_attr_support()
70 (bmval[2] & ~nfsd_suppattrs2(cstate->minorversion))) in check_attr_support()
96 struct nfsd4_compound_state *cstate, struct nfsd4_open *open) in nfsd4_check_open_attributes() argument
103 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
106 status = check_attr_support(rqstp, cstate, in nfsd4_check_open_attributes()
315 nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_open() argument
334 if (nfsd4_has_session(cstate) && in nfsd4_open()
336 &cstate->session->se_client->cl_flags) && in nfsd4_open()
340 if (nfsd4_has_session(cstate)) in nfsd4_open()
341 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
347 status = nfsd4_process_open1(&resp->cstate, open); in nfsd4_open()
350 fh_put(&cstate->current_fh); in nfsd4_open()
351 fh_copy_shallow(&cstate->current_fh.fh_handle, in nfsd4_open()
353 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_open()
363 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
379 status = do_open_lookup(rqstp, &cstate->current_fh, in nfsd4_open()
391 status = do_open_fhandle(rqstp, &cstate->current_fh, in nfsd4_open()
414 status = nfsd4_process_open2(rqstp, &cstate->current_fh, open); in nfsd4_open()
419 cstate->replay_owner = &open->op_openowner->oo_owner; in nfsd4_open()
429 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getfh() argument
432 if (!cstate->current_fh.fh_dentry) in nfsd4_getfh()
435 *getfh = &cstate->current_fh; in nfsd4_getfh()
440 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putfh() argument
443 fh_put(&cstate->current_fh); in nfsd4_putfh()
444 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; in nfsd4_putfh()
445 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, in nfsd4_putfh()
447 return fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_BYPASS_GSS); in nfsd4_putfh()
451 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_putrootfh() argument
456 fh_put(&cstate->current_fh); in nfsd4_putrootfh()
457 status = exp_pseudoroot(rqstp, &cstate->current_fh); in nfsd4_putrootfh()
462 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_restorefh() argument
465 if (!cstate->save_fh.fh_dentry) in nfsd4_restorefh()
468 fh_dup2(&cstate->current_fh, &cstate->save_fh); in nfsd4_restorefh()
469 if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) { in nfsd4_restorefh()
470 memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); in nfsd4_restorefh()
471 SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); in nfsd4_restorefh()
477 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_savefh() argument
480 if (!cstate->current_fh.fh_dentry) in nfsd4_savefh()
483 fh_dup2(&cstate->save_fh, &cstate->current_fh); in nfsd4_savefh()
484 if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { in nfsd4_savefh()
485 memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); in nfsd4_savefh()
486 SET_STATE_ID(cstate, SAVED_STATE_ID_FLAG); in nfsd4_savefh()
495 nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_access() argument
502 return nfsd_access(rqstp, &cstate->current_fh, &access->ac_resp_access, in nfsd4_access()
516 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_commit() argument
520 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, in nfsd4_commit()
525 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_create() argument
534 status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, in nfsd4_create()
539 status = check_attr_support(rqstp, cstate, create->cr_bmval, in nfsd4_create()
555 status = nfsd_symlink(rqstp, &cstate->current_fh, in nfsd4_create()
566 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
576 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
582 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
588 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
595 status = nfsd_create(rqstp, &cstate->current_fh, in nfsd4_create()
611 fh_unlock(&cstate->current_fh); in nfsd4_create()
612 set_change_info(&create->cr_cinfo, &cstate->current_fh); in nfsd4_create()
613 fh_dup2(&cstate->current_fh, &resfh); in nfsd4_create()
620 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_getattr() argument
625 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in nfsd4_getattr()
632 getattr->ga_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_getattr()
633 getattr->ga_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_getattr()
634 getattr->ga_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_getattr()
636 getattr->ga_fhp = &cstate->current_fh; in nfsd4_getattr()
641 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_link() argument
646 if (!cstate->save_fh.fh_dentry) in nfsd4_link()
648 status = nfsd_link(rqstp, &cstate->current_fh, in nfsd4_link()
649 link->li_name, link->li_namelen, &cstate->save_fh); in nfsd4_link()
651 set_change_info(&link->li_cinfo, &cstate->current_fh); in nfsd4_link()
673 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookupp() argument
676 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_lookupp()
680 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_lookup() argument
683 return nfsd_lookup(rqstp, &cstate->current_fh, in nfsd4_lookup()
685 &cstate->current_fh); in nfsd4_lookup()
689 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_read() argument
702 if ((status = nfs4_preprocess_stateid_op(cstate, &read->rd_stateid, in nfsd4_read()
713 read->rd_fhp = &cstate->current_fh; in nfsd4_read()
718 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readdir() argument
729 readdir->rd_bmval[0] &= nfsd_suppattrs0(cstate->minorversion); in nfsd4_readdir()
730 readdir->rd_bmval[1] &= nfsd_suppattrs1(cstate->minorversion); in nfsd4_readdir()
731 readdir->rd_bmval[2] &= nfsd_suppattrs2(cstate->minorversion); in nfsd4_readdir()
738 readdir->rd_fhp = &cstate->current_fh; in nfsd4_readdir()
743 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_readlink() argument
747 readlink->rl_fhp = &cstate->current_fh; in nfsd4_readlink()
752 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_remove() argument
759 status = nfsd_unlink(rqstp, &cstate->current_fh, 0, in nfsd4_remove()
762 fh_unlock(&cstate->current_fh); in nfsd4_remove()
763 set_change_info(&remove->rm_cinfo, &cstate->current_fh); in nfsd4_remove()
769 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_rename() argument
774 if (!cstate->save_fh.fh_dentry) in nfsd4_rename()
776 if (locks_in_grace() && !(cstate->save_fh.fh_export->ex_flags in nfsd4_rename()
779 status = nfsd_rename(rqstp, &cstate->save_fh, rename->rn_sname, in nfsd4_rename()
780 rename->rn_snamelen, &cstate->current_fh, in nfsd4_rename()
788 (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mode) && in nfsd4_rename()
789 S_ISDIR(cstate->current_fh.fh_dentry->d_inode->i_mode))) in nfsd4_rename()
793 set_change_info(&rename->rn_sinfo, &cstate->current_fh); in nfsd4_rename()
794 set_change_info(&rename->rn_tinfo, &cstate->save_fh); in nfsd4_rename()
800 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo() argument
809 err = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_EXEC); in nfsd4_secinfo()
812 err = nfsd_lookup_dentry(rqstp, &cstate->current_fh, in nfsd4_secinfo()
823 if (cstate->minorversion) in nfsd4_secinfo()
825 fh_put(&cstate->current_fh); in nfsd4_secinfo()
830 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_secinfo_no_name() argument
839 err = nfsd4_do_lookupp(rqstp, &cstate->current_fh); in nfsd4_secinfo_no_name()
846 exp_get(cstate->current_fh.fh_export); in nfsd4_secinfo_no_name()
847 sin->sin_exp = cstate->current_fh.fh_export; in nfsd4_secinfo_no_name()
848 fh_put(&cstate->current_fh); in nfsd4_secinfo_no_name()
853 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_setattr() argument
861 status = nfs4_preprocess_stateid_op(cstate, in nfsd4_setattr()
869 err = fh_want_write(&cstate->current_fh); in nfsd4_setattr()
874 status = check_attr_support(rqstp, cstate, setattr->sa_bmval, in nfsd4_setattr()
880 status = nfsd4_set_nfs4_acl(rqstp, &cstate->current_fh, in nfsd4_setattr()
884 status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr, in nfsd4_setattr()
887 fh_drop_write(&cstate->current_fh); in nfsd4_setattr()
892 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_write() argument
906 status = nfs4_preprocess_stateid_op(cstate, stateid, WR_STATE, &filp); in nfsd4_write()
920 status = nfsd_write(rqstp, &cstate->current_fh, filp, in nfsd4_write()
937 _nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in _nfsd4_verify() argument
944 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); in _nfsd4_verify()
948 status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); in _nfsd4_verify()
966 status = nfsd4_encode_fattr(&cstate->current_fh, in _nfsd4_verify()
967 cstate->current_fh.fh_export, in _nfsd4_verify()
968 cstate->current_fh.fh_dentry, buf, in _nfsd4_verify()
992 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_nverify() argument
997 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_nverify()
1002 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, in nfsd4_verify() argument
1007 status = _nfsd4_verify(rqstp, cstate, verify); in nfsd4_verify()
1164 struct nfsd4_compound_state *cstate = &resp->cstate; in nfsd4_proc_compound() local
1180 resp->cstate.minorversion = args->minorversion; in nfsd4_proc_compound()
1181 resp->cstate.replay_owner = NULL; in nfsd4_proc_compound()
1182 resp->cstate.session = NULL; in nfsd4_proc_compound()
1183 fh_init(&resp->cstate.current_fh, NFS4_FHSIZE); in nfsd4_proc_compound()
1184 fh_init(&resp->cstate.save_fh, NFS4_FHSIZE); in nfsd4_proc_compound()
1234 if (!cstate->current_fh.fh_dentry) { in nfsd4_proc_compound()
1239 } else if (cstate->current_fh.fh_export->ex_fslocs.migrated && in nfsd4_proc_compound()
1256 opdesc->op_get_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1257 op->status = opdesc->op_func(rqstp, cstate, &op->u); in nfsd4_proc_compound()
1263 opdesc->op_set_currentstateid(cstate, &op->u); in nfsd4_proc_compound()
1266 clear_current_stateid(cstate); in nfsd4_proc_compound()
1269 op->status = check_nfsd_access(cstate->current_fh.fh_export, rqstp); in nfsd4_proc_compound()
1274 if (resp->cstate.status == nfserr_replay_cache) { in nfsd4_proc_compound()
1280 op->replay = &cstate->replay_owner->so_replay; in nfsd4_proc_compound()
1292 if (cstate->replay_owner) { in nfsd4_proc_compound()
1294 cstate->replay_owner = NULL; in nfsd4_proc_compound()
1303 resp->cstate.status = status; in nfsd4_proc_compound()
1304 fh_put(&resp->cstate.current_fh); in nfsd4_proc_compound()
1305 fh_put(&resp->cstate.save_fh); in nfsd4_proc_compound()
1306 BUG_ON(resp->cstate.replay_owner); in nfsd4_proc_compound()