Commit 375c5547 authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Linus Torvalds

[PATCH] nfsd4: nfs4state.c miscellaneous goto removals

Remove some goto's that made the logic here a little more tortuous than
necessary.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ae8b6253
...@@ -592,25 +592,21 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_se ...@@ -592,25 +592,21 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_se
status = nfs_ok; status = nfs_ok;
if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { if (setattr->sa_iattr.ia_valid & ATTR_SIZE) {
nfs4_lock_state(); nfs4_lock_state();
if ((status = nfs4_preprocess_stateid_op(current_fh, status = nfs4_preprocess_stateid_op(current_fh,
&setattr->sa_stateid, &setattr->sa_stateid, CHECK_FH | WR_STATE, NULL);
CHECK_FH | WR_STATE, NULL))) {
dprintk("NFSD: nfsd4_setattr: couldn't process stateid!\n");
goto out_unlock;
}
nfs4_unlock_state(); nfs4_unlock_state();
if (status) {
dprintk("NFSD: nfsd4_setattr: couldn't process stateid!");
return status;
}
} }
status = nfs_ok; status = nfs_ok;
if (setattr->sa_acl != NULL) if (setattr->sa_acl != NULL)
status = nfsd4_set_nfs4_acl(rqstp, current_fh, setattr->sa_acl); status = nfsd4_set_nfs4_acl(rqstp, current_fh, setattr->sa_acl);
if (status) if (status)
goto out; return status;
status = nfsd_setattr(rqstp, current_fh, &setattr->sa_iattr, status = nfsd_setattr(rqstp, current_fh, &setattr->sa_iattr,
0, (time_t)0); 0, (time_t)0);
out:
return status;
out_unlock:
nfs4_unlock_state();
return status; return status;
} }
...@@ -628,15 +624,17 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ ...@@ -628,15 +624,17 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ
return nfserr_inval; return nfserr_inval;
nfs4_lock_state(); nfs4_lock_state();
if ((status = nfs4_preprocess_stateid_op(current_fh, stateid, status = nfs4_preprocess_stateid_op(current_fh, stateid,
CHECK_FH | WR_STATE, &filp))) { CHECK_FH | WR_STATE, &filp);
dprintk("NFSD: nfsd4_write: couldn't process stateid!\n");
goto out;
}
if (filp) if (filp)
get_file(filp); get_file(filp);
nfs4_unlock_state(); nfs4_unlock_state();
if (status) {
dprintk("NFSD: nfsd4_write: couldn't process stateid!\n");
return status;
}
write->wr_bytes_written = write->wr_buflen; write->wr_bytes_written = write->wr_buflen;
write->wr_how_written = write->wr_stable_how; write->wr_how_written = write->wr_stable_how;
p = (u32 *)write->wr_verifier.data; p = (u32 *)write->wr_verifier.data;
...@@ -652,9 +650,6 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ ...@@ -652,9 +650,6 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ
if (status == nfserr_symlink) if (status == nfserr_symlink)
status = nfserr_inval; status = nfserr_inval;
return status; return status;
out:
nfs4_unlock_state();
return status;
} }
/* This routine never returns NFS_OK! If there are no other errors, it /* This routine never returns NFS_OK! If there are no other errors, it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment