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

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

 



Now accepts an exp_xdr_stream. And returns a bool when
done. Easier on the coding.

Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
---
 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);
-- 
1.7.2.3

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