[PATCH 09/10] SQUASHME: pnfsd-exofs: Convert XDR API to return enum nfsstat4

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

 



Remove error translation from export.c, now that XDR API returns
the proper constants

Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
---
 fs/exofs/export.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/fs/exofs/export.c b/fs/exofs/export.c
index 88be441..c153ad6 100644
--- a/fs/exofs/export.c
+++ b/fs/exofs/export.c
@@ -86,7 +86,7 @@ static enum nfsstat4 exofs_layout_get(
 	struct pnfs_osd_layout layout;
 	__be32 *start;
 	bool in_recall;
-	int i, err;
+	int i;
 	enum nfsstat4 nfserr;
 
 	res->lg_seg.offset = 0;
@@ -107,11 +107,9 @@ static enum nfsstat4 exofs_layout_get(
 	layout.olo_num_comps = el->s_numdevs;
 	layout.olo_comps = creds;
 
-	err = pnfs_osd_xdr_encode_layout_hdr(xdr, &layout);
-	if (err) {
-		nfserr = NFS4ERR_TOOSMALL;
+	nfserr = pnfs_osd_xdr_encode_layout_hdr(xdr, &layout);
+	if (unlikely(nfserr))
 		goto out;
-	}
 
 	/* Encode layout components */
 	for (i = 0; i < el->s_numdevs; i++) {
@@ -133,11 +131,9 @@ static enum nfsstat4 exofs_layout_get(
 
 		cred.oc_cap.cred_len	= OSD_CAP_LEN;
 		cred.oc_cap.cred	= oi->i_cred;
-		err = pnfs_osd_xdr_encode_layout_cred(xdr, &cred);
-		if (err) {
-			nfserr = NFS4ERR_TOOSMALL;
+		nfserr = pnfs_osd_xdr_encode_layout_cred(xdr, &cred);
+		if (unlikely(nfserr))
 			goto out;
-		}
 	}
 
 	exp_xdr_encode_opaque_len(start, xdr->p);
@@ -303,13 +299,15 @@ int exofs_get_device_info(struct super_block *sb, struct exp_xdr_stream *xdr,
 	/* skip opaque size, will be filled-in later */
 	start = exp_xdr_reserve_qwords(xdr, 1);
 	if (!start) {
-		err = -E2BIG;
+		err = -ETOOSMALL;
 		goto err;
 	}
 
 	err = pnfs_osd_xdr_encode_deviceaddr(xdr, &devaddr);
-	if (err)
+	if (err) {
+		err = -ETOOSMALL;
 		goto err;
+	}
 
 	exp_xdr_encode_opaque_len(start, xdr->p);
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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