• Home
  • Raw
  • Download

Lines Matching refs:open

491 find_openstateowner_str_locked(unsigned int hashval, struct nfsd4_open *open,  in find_openstateowner_str_locked()  argument
502 if (same_owner_str(so, &open->op_owner)) in find_openstateowner_str_locked()
509 find_openstateowner_str(unsigned int hashval, struct nfsd4_open *open, in find_openstateowner_str() argument
515 oo = find_openstateowner_str_locked(hashval, open, clp); in find_openstateowner_str()
2435 .open = client_info_open,
2693 .open = client_states_open,
4328 nfsd4_find_existing_open(struct nfs4_file *fp, struct nfsd4_open *open) in nfsd4_find_existing_open() argument
4331 struct nfs4_openowner *oo = open->op_openowner; in nfsd4_find_existing_open()
4383 nfsd4_find_and_lock_existing_open(struct nfs4_file *fp, struct nfsd4_open *open) in nfsd4_find_and_lock_existing_open() argument
4388 stp = nfsd4_find_existing_open(fp, open); in nfsd4_find_and_lock_existing_open()
4398 alloc_init_open_stateowner(unsigned int strhashval, struct nfsd4_open *open, in alloc_init_open_stateowner() argument
4404 oo = alloc_stateowner(openowner_slab, &open->op_owner, clp); in alloc_init_open_stateowner()
4409 oo->oo_owner.so_seqid = open->op_seqid; in alloc_init_open_stateowner()
4417 ret = find_openstateowner_str_locked(strhashval, open, clp); in alloc_init_open_stateowner()
4429 init_open_stateid(struct nfs4_file *fp, struct nfsd4_open *open) in init_open_stateid() argument
4432 struct nfs4_openowner *oo = open->op_openowner; in init_open_stateid()
4436 stp = open->op_stp; in init_open_stateid()
4445 retstp = nfsd4_find_existing_open(fp, open); in init_open_stateid()
4449 open->op_stp = NULL; in init_open_stateid()
4800 struct nfsd4_open *open, struct nfsd_net *nn) in nfsd4_process_open1() argument
4802 clientid_t *clientid = &open->op_clientid; in nfsd4_process_open1()
4812 open->op_file = nfsd4_alloc_file(); in nfsd4_process_open1()
4813 if (open->op_file == NULL) in nfsd4_process_open1()
4821 strhashval = ownerstr_hashval(&open->op_owner); in nfsd4_process_open1()
4822 oo = find_openstateowner_str(strhashval, open, clp); in nfsd4_process_open1()
4823 open->op_openowner = oo; in nfsd4_process_open1()
4830 open->op_openowner = NULL; in nfsd4_process_open1()
4833 status = nfsd4_check_seqid(cstate, &oo->oo_owner, open->op_seqid); in nfsd4_process_open1()
4838 oo = alloc_init_open_stateowner(strhashval, open, cstate); in nfsd4_process_open1()
4841 open->op_openowner = oo; in nfsd4_process_open1()
4843 open->op_stp = nfs4_alloc_open_stateid(clp); in nfsd4_process_open1()
4844 if (!open->op_stp) in nfsd4_process_open1()
4849 open->op_odstate = alloc_clnt_odstate(clp); in nfsd4_process_open1()
4850 if (!open->op_odstate) in nfsd4_process_open1()
4882 static bool nfsd4_is_deleg_cur(struct nfsd4_open *open) in nfsd4_is_deleg_cur() argument
4884 return open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR || in nfsd4_is_deleg_cur()
4885 open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH; in nfsd4_is_deleg_cur()
4889 nfs4_check_deleg(struct nfs4_client *cl, struct nfsd4_open *open, in nfs4_check_deleg() argument
4896 deleg = find_deleg_stateid(cl, &open->op_delegate_stateid); in nfs4_check_deleg()
4905 flags = share_access_to_flags(open->op_share_access); in nfs4_check_deleg()
4913 if (!nfsd4_is_deleg_cur(open)) in nfs4_check_deleg()
4917 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; in nfs4_check_deleg()
4934 struct nfsd4_open *open) in nfsd4_truncate() argument
4940 if (!open->op_truncate) in nfsd4_truncate()
4942 if (!(open->op_share_access & NFS4_SHARE_ACCESS_WRITE)) in nfsd4_truncate()
4949 struct nfsd4_open *open) in nfs4_get_vfs_file() argument
4953 int oflag = nfs4_access_to_omode(open->op_share_access); in nfs4_get_vfs_file()
4954 int access = nfs4_access_to_access(open->op_share_access); in nfs4_get_vfs_file()
4963 status = nfs4_file_check_deny(fp, open->op_share_deny); in nfs4_get_vfs_file()
4970 status = nfs4_file_get_access(fp, open->op_share_access); in nfs4_get_vfs_file()
4978 set_access(open->op_share_access, stp); in nfs4_get_vfs_file()
4982 set_deny(open->op_share_deny, stp); in nfs4_get_vfs_file()
4983 fp->fi_share_deny |= (open->op_share_deny & NFS4_SHARE_DENY_BOTH); in nfs4_get_vfs_file()
5005 status = nfsd4_truncate(rqstp, cur_fh, open); in nfs4_get_vfs_file()
5012 nfs4_file_put_access(fp, open->op_share_access); in nfs4_get_vfs_file()
5018 … struct nfs4_file *fp, struct svc_fh *cur_fh, struct nfs4_ol_stateid *stp, struct nfsd4_open *open) in nfs4_upgrade_open() argument
5023 if (!test_access(open->op_share_access, stp)) in nfs4_upgrade_open()
5024 return nfs4_get_vfs_file(rqstp, fp, cur_fh, stp, open); in nfs4_upgrade_open()
5028 status = nfs4_file_check_deny(fp, open->op_share_deny); in nfs4_upgrade_open()
5030 set_deny(open->op_share_deny, stp); in nfs4_upgrade_open()
5032 (open->op_share_deny & NFS4_SHARE_DENY_BOTH); in nfs4_upgrade_open()
5039 status = nfsd4_truncate(rqstp, cur_fh, open); in nfs4_upgrade_open()
5221 static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status) in nfsd4_open_deleg_none_ext() argument
5223 open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE_EXT; in nfsd4_open_deleg_none_ext()
5225 open->op_why_no_deleg = WND4_CONTENTION; in nfsd4_open_deleg_none_ext()
5227 open->op_why_no_deleg = WND4_RESOURCE; in nfsd4_open_deleg_none_ext()
5228 switch (open->op_deleg_want) { in nfsd4_open_deleg_none_ext()
5234 open->op_why_no_deleg = WND4_CANCELLED; in nfsd4_open_deleg_none_ext()
5249 nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, in nfs4_open_delegation() argument
5259 open->op_recall = 0; in nfs4_open_delegation()
5260 switch (open->op_claim_type) { in nfs4_open_delegation()
5263 open->op_recall = 1; in nfs4_open_delegation()
5264 if (open->op_delegate_type != NFS4_OPEN_DELEGATE_READ) in nfs4_open_delegation()
5286 memcpy(&open->op_delegate_stateid, &dp->dl_stid.sc_stateid, sizeof(dp->dl_stid.sc_stateid)); in nfs4_open_delegation()
5289 open->op_delegate_type = NFS4_OPEN_DELEGATE_READ; in nfs4_open_delegation()
5293 open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE; in nfs4_open_delegation()
5294 if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS && in nfs4_open_delegation()
5295 open->op_delegate_type != NFS4_OPEN_DELEGATE_NONE) { in nfs4_open_delegation()
5297 open->op_recall = 1; in nfs4_open_delegation()
5301 if (open->op_deleg_want) in nfs4_open_delegation()
5302 nfsd4_open_deleg_none_ext(open, status); in nfs4_open_delegation()
5306 static void nfsd4_deleg_xgrade_none_ext(struct nfsd4_open *open, in nfsd4_deleg_xgrade_none_ext() argument
5309 if (open->op_deleg_want == NFS4_SHARE_WANT_READ_DELEG && in nfsd4_deleg_xgrade_none_ext()
5311 open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE_EXT; in nfsd4_deleg_xgrade_none_ext()
5312 open->op_why_no_deleg = WND4_NOT_SUPP_DOWNGRADE; in nfsd4_deleg_xgrade_none_ext()
5313 } else if (open->op_deleg_want == NFS4_SHARE_WANT_WRITE_DELEG && in nfsd4_deleg_xgrade_none_ext()
5315 open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE_EXT; in nfsd4_deleg_xgrade_none_ext()
5316 open->op_why_no_deleg = WND4_NOT_SUPP_UPGRADE; in nfsd4_deleg_xgrade_none_ext()
5325 nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open) in nfsd4_process_open2() argument
5328 struct nfs4_client *cl = open->op_openowner->oo_owner.so_client; in nfsd4_process_open2()
5340 fp = find_or_add_file(open->op_file, current_fh); in nfsd4_process_open2()
5341 if (fp != open->op_file) { in nfsd4_process_open2()
5342 status = nfs4_check_deleg(cl, open, &dp); in nfsd4_process_open2()
5345 stp = nfsd4_find_and_lock_existing_open(fp, open); in nfsd4_process_open2()
5347 open->op_file = NULL; in nfsd4_process_open2()
5349 if (nfsd4_is_deleg_cur(open)) in nfsd4_process_open2()
5354 stp = init_open_stateid(fp, open); in nfsd4_process_open2()
5355 if (!open->op_stp) in nfsd4_process_open2()
5367 status = nfs4_upgrade_open(rqstp, fp, current_fh, stp, open); in nfsd4_process_open2()
5373 status = nfs4_get_vfs_file(rqstp, fp, current_fh, stp, open); in nfsd4_process_open2()
5382 open->op_odstate); in nfsd4_process_open2()
5383 if (stp->st_clnt_odstate == open->op_odstate) in nfsd4_process_open2()
5384 open->op_odstate = NULL; in nfsd4_process_open2()
5387 nfs4_inc_and_copy_stateid(&open->op_stateid, &stp->st_stid); in nfsd4_process_open2()
5391 if (open->op_deleg_want & NFS4_SHARE_WANT_NO_DELEG) { in nfsd4_process_open2()
5392 open->op_delegate_type = NFS4_OPEN_DELEGATE_NONE_EXT; in nfsd4_process_open2()
5393 open->op_why_no_deleg = WND4_NOT_WANTED; in nfsd4_process_open2()
5402 nfs4_open_delegation(current_fh, open, stp); in nfsd4_process_open2()
5408 if (open->op_delegate_type == NFS4_OPEN_DELEGATE_NONE && dp && in nfsd4_process_open2()
5409 open->op_deleg_want) in nfsd4_process_open2()
5410 nfsd4_deleg_xgrade_none_ext(open, dp); in nfsd4_process_open2()
5414 if (status == 0 && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) in nfsd4_process_open2()
5415 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; in nfsd4_process_open2()
5419 open->op_rflags = NFS4_OPEN_RESULT_LOCKTYPE_POSIX; in nfsd4_process_open2()
5421 open->op_rflags |= NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK; in nfsd4_process_open2()
5422 else if (!(open->op_openowner->oo_flags & NFS4_OO_CONFIRMED)) in nfsd4_process_open2()
5423 open->op_rflags |= NFS4_OPEN_RESULT_CONFIRM; in nfsd4_process_open2()
5434 struct nfsd4_open *open) in nfsd4_cleanup_open_state() argument
5436 if (open->op_openowner) { in nfsd4_cleanup_open_state()
5437 struct nfs4_stateowner *so = &open->op_openowner->oo_owner; in nfsd4_cleanup_open_state()
5442 if (open->op_file) in nfsd4_cleanup_open_state()
5443 kmem_cache_free(file_slab, open->op_file); in nfsd4_cleanup_open_state()
5444 if (open->op_stp) in nfsd4_cleanup_open_state()
5445 nfs4_put_stid(&open->op_stp->st_stid); in nfsd4_cleanup_open_state()
5446 if (open->op_odstate) in nfsd4_cleanup_open_state()
5447 kmem_cache_free(odstate_slab, open->op_odstate); in nfsd4_cleanup_open_state()
7681 put_stateid(cstate, &u->open.op_stateid); in nfsd4_set_openstateid()