hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/include/linux/ceph/decode.h
....@@ -218,18 +218,27 @@
218218 /*
219219 * sockaddr_storage <-> ceph_sockaddr
220220 */
221
-static inline void ceph_encode_addr(struct ceph_entity_addr *a)
221
+#define CEPH_ENTITY_ADDR_TYPE_NONE 0
222
+#define CEPH_ENTITY_ADDR_TYPE_LEGACY __cpu_to_le32(1)
223
+
224
+static inline void ceph_encode_banner_addr(struct ceph_entity_addr *a)
222225 {
223226 __be16 ss_family = htons(a->in_addr.ss_family);
224227 a->in_addr.ss_family = *(__u16 *)&ss_family;
228
+
229
+ /* Banner addresses require TYPE_NONE */
230
+ a->type = CEPH_ENTITY_ADDR_TYPE_NONE;
225231 }
226
-static inline void ceph_decode_addr(struct ceph_entity_addr *a)
232
+static inline void ceph_decode_banner_addr(struct ceph_entity_addr *a)
227233 {
228234 __be16 ss_family = *(__be16 *)&a->in_addr.ss_family;
229235 a->in_addr.ss_family = ntohs(ss_family);
230236 WARN_ON(a->in_addr.ss_family == 512);
237
+ a->type = CEPH_ENTITY_ADDR_TYPE_LEGACY;
231238 }
232239
240
+extern int ceph_decode_entity_addr(void **p, void *end,
241
+ struct ceph_entity_addr *addr);
233242 /*
234243 * encoders
235244 */