summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2019-06-17 13:57:25 +0300
committerIlya Dryomov <idryomov@gmail.com>2019-07-08 15:01:43 +0300
commitd3c3c0a841d5dafc5395be363996d619255a732f (patch)
tree866bd73f26ee2e136bfe11b6fb83b4d5e56d97c5 /include
parent2f9800c899dc1f4ad0ca32105069bfa83e80a05b (diff)
downloadlinux-d3c3c0a841d5dafc5395be363996d619255a732f.tar.xz
libceph: use TYPE_LEGACY for entity addrs instead of TYPE_NONE
Going forward, we'll have different address types so let's use the addr2 TYPE_LEGACY for internal tracking rather than TYPE_NONE. Also, make ceph_pr_addr print the address type value as well. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ceph/decode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index 1c0a665bfc03..ce488d95be89 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -218,16 +218,23 @@ static inline void ceph_encode_timespec64(struct ceph_timespec *tv,
/*
* sockaddr_storage <-> ceph_sockaddr
*/
+#define CEPH_ENTITY_ADDR_TYPE_NONE 0
+#define CEPH_ENTITY_ADDR_TYPE_LEGACY __cpu_to_le32(1)
+
static inline void ceph_encode_addr(struct ceph_entity_addr *a)
{
__be16 ss_family = htons(a->in_addr.ss_family);
a->in_addr.ss_family = *(__u16 *)&ss_family;
+
+ /* Banner addresses require TYPE_NONE */
+ a->type = CEPH_ENTITY_ADDR_TYPE_NONE;
}
static inline void ceph_decode_addr(struct ceph_entity_addr *a)
{
__be16 ss_family = *(__be16 *)&a->in_addr.ss_family;
a->in_addr.ss_family = ntohs(ss_family);
WARN_ON(a->in_addr.ss_family == 512);
+ a->type = CEPH_ENTITY_ADDR_TYPE_LEGACY;
}
extern int ceph_decode_entity_addr(void **p, void *end,