Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSD: Clean up nfsd4_check_open_attributes()

The @rqstp parameter was introduced in commit 3c8e03166ae2 ("NFSv4:
do exact check about attribute specified") but has never been used.

Reduce indentation in callers to improve readability.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+21 -19
+21 -19
fs/nfsd/nfs4proc.c
··· 81 81 }; 82 82 83 83 static __be32 84 - check_attr_support(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 85 - u32 *bmval, u32 *writable) 84 + check_attr_support(struct nfsd4_compound_state *cstate, u32 *bmval, 85 + u32 *writable) 86 86 { 87 87 struct dentry *dentry = cstate->current_fh.fh_dentry; 88 88 struct svc_export *exp = cstate->current_fh.fh_export; ··· 103 103 } 104 104 105 105 static __be32 106 - nfsd4_check_open_attributes(struct svc_rqst *rqstp, 107 - struct nfsd4_compound_state *cstate, struct nfsd4_open *open) 106 + nfsd4_check_open_attributes(struct nfsd4_compound_state *cstate, 107 + struct nfsd4_open *open) 108 108 { 109 109 __be32 status = nfs_ok; 110 110 111 - if (open->op_create == NFS4_OPEN_CREATE) { 112 - if (open->op_createmode == NFS4_CREATE_UNCHECKED 113 - || open->op_createmode == NFS4_CREATE_GUARDED) 114 - status = check_attr_support(rqstp, cstate, 115 - open->op_bmval, nfsd_attrmask); 116 - else if (open->op_createmode == NFS4_CREATE_EXCLUSIVE4_1) 117 - status = check_attr_support(rqstp, cstate, 118 - open->op_bmval, nfsd41_ex_attrmask); 119 - } 111 + if (open->op_create != NFS4_OPEN_CREATE) 112 + return status; 120 113 114 + switch (open->op_createmode) { 115 + case NFS4_CREATE_UNCHECKED: 116 + case NFS4_CREATE_GUARDED: 117 + status = check_attr_support(cstate, open->op_bmval, 118 + nfsd_attrmask); 119 + break; 120 + case NFS4_CREATE_EXCLUSIVE4_1: 121 + status = check_attr_support(cstate, open->op_bmval, 122 + nfsd41_ex_attrmask); 123 + break; 124 + } 121 125 return status; 122 126 } 123 127 ··· 583 579 goto out; 584 580 } 585 581 586 - status = nfsd4_check_open_attributes(rqstp, cstate, open); 582 + status = nfsd4_check_open_attributes(cstate, open); 587 583 if (status) 588 584 goto out; 589 585 ··· 795 791 if (status) 796 792 return status; 797 793 798 - status = check_attr_support(rqstp, cstate, create->cr_bmval, 799 - nfsd_attrmask); 794 + status = check_attr_support(cstate, create->cr_bmval, nfsd_attrmask); 800 795 if (status) 801 796 return status; 802 797 ··· 1215 1212 return nfserrno(err); 1216 1213 status = nfs_ok; 1217 1214 1218 - status = check_attr_support(rqstp, cstate, setattr->sa_bmval, 1219 - nfsd_attrmask); 1215 + status = check_attr_support(cstate, setattr->sa_bmval, nfsd_attrmask); 1220 1216 if (status) 1221 1217 goto out; 1222 1218 ··· 2268 2266 if (status) 2269 2267 return status; 2270 2268 2271 - status = check_attr_support(rqstp, cstate, verify->ve_bmval, NULL); 2269 + status = check_attr_support(cstate, verify->ve_bmval, NULL); 2272 2270 if (status) 2273 2271 return status; 2274 2272