[PATCH v1 7/7] NFSD: Clean up nfsd4_encode_open()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chuck Lever <chuck.lever@xxxxxxxxxx>

Finish cleaning up nfsd4_encode_open().

Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---
 fs/nfsd/nfs4xdr.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index f37c370ceded..143efc24551d 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -4208,20 +4208,23 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
 	struct nfsd4_open *open = &u->open;
 	struct xdr_stream *xdr = resp->xdr;
 
+	/* stateid */
 	nfserr = nfsd4_encode_stateid4(xdr, &open->op_stateid);
-	if (nfserr)
+	if (nfserr != nfs_ok)
 		return nfserr;
+	/* cinfo */
 	nfserr = nfsd4_encode_change_info4(xdr, &open->op_cinfo);
-	if (nfserr)
+	if (nfserr != nfs_ok)
 		return nfserr;
-	if (xdr_stream_encode_u32(xdr, open->op_rflags) < 0)
-		return nfserr_resource;
-
+	/* rflags */
+	nfserr = nfsd4_encode_uint32_t(xdr, open->op_rflags);
+	if (nfserr != nfs_ok)
+		return nfserr;
+	/* attrset */
 	nfserr = nfsd4_encode_bitmap4(xdr, open->op_bmval[0],
 				      open->op_bmval[1], open->op_bmval[2]);
-	if (nfserr)
+	if (nfserr != nfs_ok)
 		return nfserr;
-
 	/* delegation */
 	return nfsd4_encode_open_delegation4(xdr, open);
 }





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux