From patchwork Tue Jun 14 21:36:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 880332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5ELZrMW017004 for ; Tue, 14 Jun 2011 21:37:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122Ab1FNVg5 (ORCPT ); Tue, 14 Jun 2011 17:36:57 -0400 Received: from daytona.panasas.com ([67.152.220.89]:38181 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044Ab1FNVg5 (ORCPT ); Tue, 14 Jun 2011 17:36:57 -0400 Received: from yafyuf.citi.umich.edu ([172.17.33.117]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 14 Jun 2011 17:36:56 -0400 From: Boaz Harrosh To: Benny Halevy , open-osd , NFS list Subject: [PATCH 09/10] SQUASHME: pnfsd-exofs: Convert XDR API to return enum nfsstat4 Date: Tue, 14 Jun 2011 17:36:56 -0400 Message-Id: <1308087416-13293-1-git-send-email-bharrosh@panasas.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <4DF7D36F.9070602@panasas.com> References: <4DF7D36F.9070602@panasas.com> X-OriginalArrivalTime: 14 Jun 2011 21:36:56.0488 (UTC) FILETIME=[2F318280:01CC2ADB] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Jun 2011 21:37:26 +0000 (UTC) Remove error translation from export.c, now that XDR API returns the proper constants Signed-off-by: Boaz Harrosh --- 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);