From 35b61e63323ccf5fdcdd74b11751b58392c9cce1 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 20 Oct 2010 00:17:54 -0400 Subject: [PATCH] SUNRPC: define xdr_decode_opaque_fixed 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 Signed-off-by: Fred Isaman Signed-off-by: Trond Myklebust --- include/linux/sunrpc/xdr.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index ab91d86565fd..498ab93a81e4 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -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) */ -- 2.20.1