diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-02-19 22:08:26 +0100 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2017-02-21 22:56:16 +0100 |
commit | ab6e9aaf16cfdfca630f9745fd6d453818df7f64 (patch) | |
tree | 0518bb63cde9902f4686eea336d665f38aee182d /fs/nfs/callback_xdr.c | |
parent | SUNRPC: Add generic helpers for xdr_stream encode/decode (diff) | |
download | linux-ab6e9aaf16cfdfca630f9745fd6d453818df7f64.tar.xz linux-ab6e9aaf16cfdfca630f9745fd6d453818df7f64.zip |
NFSv4: Replace ad-hoc xdr encode/decode helpers with xdr_stream_* generics
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/callback_xdr.c')
-rw-r--r-- | fs/nfs/callback_xdr.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index eb094c6011d8..e732a65db546 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -582,12 +582,8 @@ out: static __be32 encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) { - __be32 *p; - - p = xdr_reserve_space(xdr, 4 + len); - if (unlikely(p == NULL)) - return htonl(NFS4ERR_RESOURCE); - xdr_encode_opaque(p, str, len); + if (unlikely(xdr_stream_encode_opaque(xdr, str, len) < 0)) + return cpu_to_be32(NFS4ERR_RESOURCE); return 0; } |