[12/13] SQUASHME: XDR API changes to pnfs_osd_xdr_decode_ioerr()
diff mbox

Message ID 1305974046-17556-1-git-send-email-bharrosh@panasas.com
State New, archived
Headers show

Commit Message

Boaz Harrosh May 21, 2011, 10:34 a.m. UTC
Now accepts an exp_xdr_stream. And returns a bool when
done. Easier on the coding.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/exofs/export.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

Patch
diff mbox

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);