Commit cb17e556 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Add a helper for encoding opaque data

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d0b496d2
...@@ -885,6 +885,14 @@ static __be32 *reserve_space(struct xdr_stream *xdr, size_t nbytes) ...@@ -885,6 +885,14 @@ static __be32 *reserve_space(struct xdr_stream *xdr, size_t nbytes)
return p; return p;
} }
static void encode_opaque_fixed(struct xdr_stream *xdr, const void *buf, size_t len)
{
__be32 *p;
p = xdr_reserve_space(xdr, len);
xdr_encode_opaque_fixed(p, buf, len);
}
static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str)
{ {
__be32 *p; __be32 *p;
...@@ -922,11 +930,7 @@ static void encode_nops(struct compound_hdr *hdr) ...@@ -922,11 +930,7 @@ static void encode_nops(struct compound_hdr *hdr)
static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf) static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf)
{ {
__be32 *p; encode_opaque_fixed(xdr, verf->data, NFS4_VERIFIER_SIZE);
p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE);
BUG_ON(p == NULL);
xdr_encode_opaque_fixed(p, verf->data, NFS4_VERIFIER_SIZE);
} }
static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server) static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment