Lines Matching refs:open

133 	struct nfsd4_compound_state *cstate, struct nfsd4_open *open)  in nfsd4_check_open_attributes()  argument
137 if (open->op_create == NFS4_OPEN_CREATE) { in nfsd4_check_open_attributes()
138 if (open->op_createmode == NFS4_CREATE_UNCHECKED in nfsd4_check_open_attributes()
139 || open->op_createmode == NFS4_CREATE_GUARDED) in nfsd4_check_open_attributes()
141 open->op_bmval, nfsd_attrmask); in nfsd4_check_open_attributes()
142 else if (open->op_createmode == NFS4_CREATE_EXCLUSIVE4_1) in nfsd4_check_open_attributes()
144 open->op_bmval, nfsd41_ex_attrmask); in nfsd4_check_open_attributes()
151 is_create_with_attrs(struct nfsd4_open *open) in is_create_with_attrs() argument
153 return open->op_create == NFS4_OPEN_CREATE in is_create_with_attrs()
154 && (open->op_createmode == NFS4_CREATE_UNCHECKED in is_create_with_attrs()
155 || open->op_createmode == NFS4_CREATE_GUARDED in is_create_with_attrs()
156 || open->op_createmode == NFS4_CREATE_EXCLUSIVE4_1); in is_create_with_attrs()
190 do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int … in do_open_permission() argument
194 if (open->op_truncate && in do_open_permission()
195 !(open->op_share_access & NFS4_SHARE_ACCESS_WRITE)) in do_open_permission()
200 if (open->op_share_access & NFS4_SHARE_ACCESS_READ) in do_open_permission()
202 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) in do_open_permission()
204 if (open->op_share_deny & NFS4_SHARE_DENY_READ) in do_open_permission()
230 …owner_reply_cache(struct nfsd4_compound_state *cstate, struct nfsd4_open *open, struct svc_fh *res… in nfsd4_set_open_owner_reply_cache() argument
234 fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh, in nfsd4_set_open_owner_reply_cache()
239 do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open in do_open_lookup() argument
249 open->op_truncate = false; in do_open_lookup()
251 if (open->op_create) { in do_open_lookup()
271 current->fs->umask = open->op_umask; in do_open_lookup()
272 status = do_nfsd_create(rqstp, current_fh, open->op_fname, in do_open_lookup()
273 open->op_fnamelen, &open->op_iattr, in do_open_lookup()
274 *resfh, open->op_createmode, in do_open_lookup()
275 (u32 *)open->op_verf.data, in do_open_lookup()
276 &open->op_truncate, &open->op_created); in do_open_lookup()
279 if (!status && open->op_label.len) in do_open_lookup()
280 nfsd4_security_inode_setsecctx(*resfh, &open->op_label, open->op_bmval); in do_open_lookup()
287 if (nfsd_create_is_exclusive(open->op_createmode) && status == 0) in do_open_lookup()
288 open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS | in do_open_lookup()
298 open->op_fname, open->op_fnamelen, *resfh); in do_open_lookup()
305 if (is_create_with_attrs(open) && open->op_acl != NULL) in do_open_lookup()
306 do_set_nfs4_acl(rqstp, *resfh, open->op_acl, open->op_bmval); in do_open_lookup()
308 nfsd4_set_open_owner_reply_cache(cstate, open, *resfh); in do_open_lookup()
310 if (open->op_created || in do_open_lookup()
311 open->op_claim_type == NFS4_OPEN_CLAIM_DELEGATE_CUR) in do_open_lookup()
313 status = do_open_permission(rqstp, *resfh, open, accmode); in do_open_lookup()
314 set_change_info(&open->op_cinfo, current_fh); in do_open_lookup()
320 …_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open) in do_open_fhandle() argument
330 memset(&open->op_cinfo, 0, sizeof(struct nfsd4_change_info)); in do_open_fhandle()
332 nfsd4_set_open_owner_reply_cache(cstate, open, current_fh); in do_open_fhandle()
334 open->op_truncate = (open->op_iattr.ia_valid & ATTR_SIZE) && in do_open_fhandle()
335 (open->op_iattr.ia_size == 0); in do_open_fhandle()
345 if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH) in do_open_fhandle()
348 status = do_open_permission(rqstp, current_fh, open, accmode); in do_open_fhandle()
367 struct nfsd4_open *open = &u->open; in nfsd4_open() local
375 (int)open->op_fnamelen, open->op_fname, in nfsd4_open()
376 open->op_openowner); in nfsd4_open()
379 if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) in nfsd4_open()
382 open->op_created = false; in nfsd4_open()
389 open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) in nfsd4_open()
393 copy_clientid(&open->op_clientid, cstate->session); in nfsd4_open()
396 status = nfsd4_process_open1(cstate, open, nn); in nfsd4_open()
398 struct nfs4_replay *rp = &open->op_openowner->oo_owner.so_replay; in nfsd4_open()
411 if (open->op_xdr_error) { in nfsd4_open()
412 status = open->op_xdr_error; in nfsd4_open()
416 status = nfsd4_check_open_attributes(rqstp, cstate, open); in nfsd4_open()
423 if (opens_in_grace(net) && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) in nfsd4_open()
426 if (!opens_in_grace(net) && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) in nfsd4_open()
429 switch (open->op_claim_type) { in nfsd4_open()
432 status = do_open_lookup(rqstp, cstate, open, &resfh); in nfsd4_open()
440 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; in nfsd4_open()
445 status = do_open_fhandle(rqstp, cstate, open); in nfsd4_open()
453 open->op_claim_type); in nfsd4_open()
458 open->op_claim_type); in nfsd4_open()
467 status = nfsd4_process_open2(rqstp, resfh, open); in nfsd4_open()
468 WARN(status && open->op_created, in nfsd4_open()
479 nfsd4_cleanup_open_state(cstate, open); in nfsd4_open()
492 struct nfsd4_open *open = &op->u.open; in nfsd4_open_omfg() local
498 open->op_xdr_error = op->status; in nfsd4_open_omfg()