From patchwork Sat May 21 10:34:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 805662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4LAXjBU020791 for ; Sat, 21 May 2011 10:34:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753940Ab1EUKeR (ORCPT ); Sat, 21 May 2011 06:34:17 -0400 Received: from daytona.panasas.com ([67.152.220.89]:19800 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753913Ab1EUKeR (ORCPT ); Sat, 21 May 2011 06:34:17 -0400 Received: from fs2.bhalevy.com ([172.17.33.46]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 21 May 2011 06:34:16 -0400 From: Boaz Harrosh To: Benny Halevy , Trond Myklebust , NFS list Subject: [PATCH 12/13] SQUASHME: XDR API changes to pnfs_osd_xdr_decode_ioerr() Date: Sat, 21 May 2011 13:34:06 +0300 Message-Id: <1305974046-17556-1-git-send-email-bharrosh@panasas.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4DD79273.9030202@panasas.com> References: <4DD79273.9030202@panasas.com> X-OriginalArrivalTime: 21 May 2011 10:34:16.0366 (UTC) FILETIME=[A2665CE0:01CC17A2] 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]); Sat, 21 May 2011 10:34:18 +0000 (UTC) Now accepts an exp_xdr_stream. And returns a bool when done. Easier on the coding. Signed-off-by: Boaz Harrosh --- fs/exofs/export.c | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/exofs/export.c b/fs/exofs/export.c index 69bce46..31e16b4 100644 --- a/fs/exofs/export.c +++ b/fs/exofs/export.c @@ -246,19 +246,17 @@ static int exofs_layout_return( struct inode *inode, const struct nfsd4_pnfs_layoutreturn_arg *args) { - __be32 *p = args->lrf_body; - unsigned len = exp_xdr_qwords(args->lrf_body_len); + struct exp_xdr_stream xdr = { + .p = args->lrf_body, + .end = args->lrf_body + exp_xdr_qwords(args->lrf_body_len), + }; + struct pnfs_osd_ioerr ioerr; - EXOFS_DBGMSG("(0x%lx) cookie %p xdr_len %d\n", - inode->i_ino, args->lr_cookie, len); + EXOFS_DBGMSG("(0x%lx) cookie %p body_len %d\n", + inode->i_ino, args->lr_cookie, args->lrf_body_len); - while (len >= pnfs_osd_ioerr_xdr_sz()) { - struct pnfs_osd_ioerr ioerr; - - p = pnfs_osd_xdr_decode_ioerr(&ioerr, p); - len -= pnfs_osd_ioerr_xdr_sz(); + while (pnfs_osd_xdr_decode_ioerr(&ioerr, &xdr)) exofs_handle_error(&ioerr); - } if (args->lr_cookie) { struct exofs_i_info *oi = exofs_i(inode);