]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
libceph: change ceph_pagelist_encode_string() to take u32
authorIlya Dryomov <idryomov@gmail.com>
Wed, 27 Jun 2018 14:42:51 +0000 (16:42 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 2 Aug 2018 19:26:11 +0000 (21:26 +0200)
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: Ilya Dryomov <idryomov@gmail.com>
include/linux/ceph/pagelist.h

index 7edcded0764185732adfb824c94770878201cbf0..d0223364349f772ae4086ddc1304e02cf53a9d89 100644 (file)
@@ -68,7 +68,7 @@ static inline int ceph_pagelist_encode_8(struct ceph_pagelist *pl, u8 v)
        return ceph_pagelist_append(pl, &v, 1);
 }
 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);
        if (ret)