提交 c9ed51c9 编写于 作者: I Ilya Dryomov

libceph: change ceph_pagelist_encode_string() to take u32

The wire format dictates that the length of string fits into 4 bytes.
Take u32 instead of size_t to reflect that.

We were already truncating len in ceph_pagelist_encode_32() -- this
just pushes that truncation one level up.
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
上级 6d54228f
...@@ -68,7 +68,7 @@ static inline int ceph_pagelist_encode_8(struct ceph_pagelist *pl, u8 v) ...@@ -68,7 +68,7 @@ static inline int ceph_pagelist_encode_8(struct ceph_pagelist *pl, u8 v)
return ceph_pagelist_append(pl, &v, 1); return ceph_pagelist_append(pl, &v, 1);
} }
static inline int ceph_pagelist_encode_string(struct ceph_pagelist *pl, static inline int ceph_pagelist_encode_string(struct ceph_pagelist *pl,
char *s, size_t len) char *s, u32 len)
{ {
int ret = ceph_pagelist_encode_32(pl, len); int ret = ceph_pagelist_encode_32(pl, len);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册