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