summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/xdr.h
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2020-11-03 13:19:51 -0500
committerChuck Lever <chuck.lever@oracle.com>2020-11-30 14:46:36 -0500
commitcbd9abb3706e96563b36af67595707a7054ab693 (patch)
tree37112e24696559f82b65dd37fe072d652064d68b /include/linux/sunrpc/xdr.h
parentd3d2f38154571e70d5806b5c5264bf61c101ea15 (diff)
NFSD: Replace READ* macros in nfsd4_decode_commit()
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/linux/sunrpc/xdr.h')
-rw-r--r--include/linux/sunrpc/xdr.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index cc64cd0891f1..cc669d95c484 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -572,6 +572,27 @@ xdr_stream_decode_u32(struct xdr_stream *xdr, __u32 *ptr)
}
/**
+ * xdr_stream_decode_u64 - Decode a 64-bit integer
+ * @xdr: pointer to xdr_stream
+ * @ptr: location to store 64-bit integer
+ *
+ * Return values:
+ * %0 on success
+ * %-EBADMSG on XDR buffer overflow
+ */
+static inline ssize_t
+xdr_stream_decode_u64(struct xdr_stream *xdr, __u64 *ptr)
+{
+ const size_t count = sizeof(*ptr);
+ __be32 *p = xdr_inline_decode(xdr, count);
+
+ if (unlikely(!p))
+ return -EBADMSG;
+ xdr_decode_hyper(p, ptr);
+ return 0;
+}
+
+/**
* xdr_stream_decode_opaque_fixed - Decode fixed length opaque xdr data
* @xdr: pointer to xdr_stream
* @ptr: location to store data