diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2020-11-06 21:15:09 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-21 15:53:00 +0300 |
| commit | 349d96b070de15376b3db8fb0c8da4e1f46a0eab (patch) | |
| tree | 1fa2f88a7c73e9b14ac9ecfb94d892e65ddd70f6 /include/linux | |
| parent | 4c06f831d28b8ffb436818440202c5795ed242e1 (diff) | |
| download | linux-349d96b070de15376b3db8fb0c8da4e1f46a0eab.tar.xz | |
NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream
[ Upstream commit ded04a587f6ceaaba3caefad4021f2212b46c9ff ]
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 237b78146c7d..927f1458bcab 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -395,7 +395,21 @@ static inline int xdr_stream_encode_item_absent(struct xdr_stream *xdr) } /** - * xdr_stream_encode_bool - Encode a "not present" list item + * xdr_encode_bool - Encode a boolean item + * @p: address in a buffer into which to encode + * @n: boolean value to encode + * + * Return value: + * Address of item following the encoded boolean + */ +static inline __be32 *xdr_encode_bool(__be32 *p, u32 n) +{ + *p = n ? xdr_one : xdr_zero; + return p++; +} + +/** + * xdr_stream_encode_bool - Encode a boolean item * @xdr: pointer to xdr_stream * @n: boolean value to encode * @@ -410,7 +424,7 @@ static inline int xdr_stream_encode_bool(struct xdr_stream *xdr, __u32 n) if (unlikely(!p)) return -EMSGSIZE; - *p = n ? xdr_one : xdr_zero; + xdr_encode_bool(p, n); return len; } |
