提交 52748819 编写于 作者: F Fred Isaman 提交者: Linus Torvalds

[PATCH] nfsd4: clean up settattr code

Clean up some unnecessary special-casing in the setattr code..
Signed-off-by: NFred Isaman <iisaman@citi.umich.edu>
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 34081efc
...@@ -594,10 +594,6 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_se ...@@ -594,10 +594,6 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_se
{ {
int status = nfs_ok; int status = nfs_ok;
if (!current_fh->fh_dentry)
return nfserr_nofilehandle;
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();
status = nfs4_preprocess_stateid_op(current_fh, status = nfs4_preprocess_stateid_op(current_fh,
...@@ -799,17 +795,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, ...@@ -799,17 +795,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
/* All operations except RENEW, SETCLIENTID, RESTOREFH /* All operations except RENEW, SETCLIENTID, RESTOREFH
* SETCLIENTID_CONFIRM, PUTFH and PUTROOTFH * SETCLIENTID_CONFIRM, PUTFH and PUTROOTFH
* require a valid current filehandle * require a valid current filehandle
*
* SETATTR NOFILEHANDLE error handled in nfsd4_setattr
* due to required returned bitmap argument
*/ */
if ((!current_fh->fh_dentry) && if ((!current_fh->fh_dentry) &&
!((op->opnum == OP_PUTFH) || (op->opnum == OP_PUTROOTFH) || !((op->opnum == OP_PUTFH) || (op->opnum == OP_PUTROOTFH) ||
(op->opnum == OP_SETCLIENTID) || (op->opnum == OP_SETCLIENTID) ||
(op->opnum == OP_SETCLIENTID_CONFIRM) || (op->opnum == OP_SETCLIENTID_CONFIRM) ||
(op->opnum == OP_RENEW) || (op->opnum == OP_RESTOREFH) || (op->opnum == OP_RENEW) || (op->opnum == OP_RESTOREFH) ||
(op->opnum == OP_RELEASE_LOCKOWNER) || (op->opnum == OP_RELEASE_LOCKOWNER))) {
(op->opnum == OP_SETATTR))) {
op->status = nfserr_nofilehandle; op->status = nfserr_nofilehandle;
goto encode_op; goto encode_op;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册