[sheepdog] [PATCH 3/6] net: enlarge connect_to_addr() scope
Liu Yuan
namei.unix at gmail.com
Thu Mar 28 16:38:49 CET 2013
From: Liu Yuan <tailai.ly at taobao.com>
This is a prepare patch.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
include/net.h | 8 ++++++++
sheep/sockfd_cache.c | 8 --------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/net.h b/include/net.h
index a68c880..75ac197 100644
--- a/include/net.h
+++ b/include/net.h
@@ -72,4 +72,12 @@ int set_rcv_timeout(int fd);
int get_local_addr(uint8_t *bytes);
bool inetaddr_is_valid(char *addr);
+static inline int connect_to_addr(const uint8_t *addr, int port)
+{
+ char name[INET6_ADDRSTRLEN];
+
+ addr_to_str(name, sizeof(name), addr, 0);
+ return connect_to(name, port);
+}
+
#endif
diff --git a/sheep/sockfd_cache.c b/sheep/sockfd_cache.c
index ddefbf2..1e0d6cf 100644
--- a/sheep/sockfd_cache.c
+++ b/sheep/sockfd_cache.c
@@ -337,14 +337,6 @@ static inline void check_idx(int idx)
queue_work(sys->sockfd_wqueue, w);
}
-static inline int connect_to_addr(const uint8_t *addr, int port)
-{
- char name[INET6_ADDRSTRLEN];
-
- addr_to_str(name, sizeof(name), addr, 0);
- return connect_to(name, port);
-}
-
/* Add the node back if it is still alive */
static inline int revalidate_node(const struct node_id *nid)
{
--
1.7.9.5
More information about the sheepdog
mailing list