Commit 2c66de56 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov

libceph: rename ceph_encode_addr to ceph_encode_banner_addr

...ditto for the decode function. We only use these functions to fix
up banner addresses now, so let's name them more appropriately.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatar"Yan, Zheng" <zyan@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent d3c3c0a8
...@@ -221,7 +221,7 @@ static inline void ceph_encode_timespec64(struct ceph_timespec *tv, ...@@ -221,7 +221,7 @@ static inline void ceph_encode_timespec64(struct ceph_timespec *tv,
#define CEPH_ENTITY_ADDR_TYPE_NONE 0 #define CEPH_ENTITY_ADDR_TYPE_NONE 0
#define CEPH_ENTITY_ADDR_TYPE_LEGACY __cpu_to_le32(1) #define CEPH_ENTITY_ADDR_TYPE_LEGACY __cpu_to_le32(1)
static inline void ceph_encode_addr(struct ceph_entity_addr *a) static inline void ceph_encode_banner_addr(struct ceph_entity_addr *a)
{ {
__be16 ss_family = htons(a->in_addr.ss_family); __be16 ss_family = htons(a->in_addr.ss_family);
a->in_addr.ss_family = *(__u16 *)&ss_family; a->in_addr.ss_family = *(__u16 *)&ss_family;
...@@ -229,7 +229,7 @@ static inline void ceph_encode_addr(struct ceph_entity_addr *a) ...@@ -229,7 +229,7 @@ static inline void ceph_encode_addr(struct ceph_entity_addr *a)
/* Banner addresses require TYPE_NONE */ /* Banner addresses require TYPE_NONE */
a->type = CEPH_ENTITY_ADDR_TYPE_NONE; a->type = CEPH_ENTITY_ADDR_TYPE_NONE;
} }
static inline void ceph_decode_addr(struct ceph_entity_addr *a) static inline void ceph_decode_banner_addr(struct ceph_entity_addr *a)
{ {
__be16 ss_family = *(__be16 *)&a->in_addr.ss_family; __be16 ss_family = *(__be16 *)&a->in_addr.ss_family;
a->in_addr.ss_family = ntohs(ss_family); a->in_addr.ss_family = ntohs(ss_family);
......
...@@ -222,7 +222,7 @@ EXPORT_SYMBOL(ceph_pr_addr); ...@@ -222,7 +222,7 @@ EXPORT_SYMBOL(ceph_pr_addr);
static void encode_my_addr(struct ceph_messenger *msgr) static void encode_my_addr(struct ceph_messenger *msgr)
{ {
memcpy(&msgr->my_enc_addr, &msgr->inst.addr, sizeof(msgr->my_enc_addr)); memcpy(&msgr->my_enc_addr, &msgr->inst.addr, sizeof(msgr->my_enc_addr));
ceph_encode_addr(&msgr->my_enc_addr); ceph_encode_banner_addr(&msgr->my_enc_addr);
} }
/* /*
...@@ -1734,14 +1734,14 @@ static int read_partial_banner(struct ceph_connection *con) ...@@ -1734,14 +1734,14 @@ static int read_partial_banner(struct ceph_connection *con)
ret = read_partial(con, end, size, &con->actual_peer_addr); ret = read_partial(con, end, size, &con->actual_peer_addr);
if (ret <= 0) if (ret <= 0)
goto out; goto out;
ceph_decode_addr(&con->actual_peer_addr); ceph_decode_banner_addr(&con->actual_peer_addr);
size = sizeof (con->peer_addr_for_me); size = sizeof (con->peer_addr_for_me);
end += size; end += size;
ret = read_partial(con, end, size, &con->peer_addr_for_me); ret = read_partial(con, end, size, &con->peer_addr_for_me);
if (ret <= 0) if (ret <= 0)
goto out; goto out;
ceph_decode_addr(&con->peer_addr_for_me); ceph_decode_banner_addr(&con->peer_addr_for_me);
out: out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment