Skip to content

Commit

Permalink
SUNRPC: define xdr_decode_opaque_fixed
Browse files Browse the repository at this point in the history
A helper for decoding a fixed length opaque value.
Returns a pointer to the next item in the xdr stream.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Oct 24, 2010
1 parent 3c9101a commit 35b61e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp)
return p + 2;
}

static inline __be32 *
xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len)
{
memcpy(ptr, p, len);
return p + XDR_QUADLEN(len);
}

/*
* Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
*/
Expand Down

0 comments on commit 35b61e6

Please sign in to comment.