You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
tipc: cleanup function namespace
Do some cleanups of TIPC based on make namespacecheck 1. Don't export unused symbols 2. Eliminate dead code 3. Make functions and variables local 4. Rename buf_acquire to tipc_buf_acquire since it is used in several files Compile tested only. This make break out of tree kernel modules that depend on TIPC routines. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
15419227f7
commit
31e3c3f6f1
@@ -50,8 +50,6 @@
|
||||
* TIPC operating mode routines
|
||||
*/
|
||||
|
||||
u32 tipc_get_addr(void);
|
||||
|
||||
#define TIPC_NOT_RUNNING 0
|
||||
#define TIPC_NODE_MODE 1
|
||||
#define TIPC_NET_MODE 2
|
||||
@@ -62,8 +60,6 @@ int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle);
|
||||
|
||||
void tipc_detach(unsigned int userref);
|
||||
|
||||
int tipc_get_mode(void);
|
||||
|
||||
/*
|
||||
* TIPC port manipulation routines
|
||||
*/
|
||||
@@ -153,12 +149,6 @@ int tipc_disconnect(u32 portref);
|
||||
|
||||
int tipc_shutdown(u32 ref);
|
||||
|
||||
int tipc_isconnected(u32 portref, int *isconnected);
|
||||
|
||||
int tipc_peer(u32 portref, struct tipc_portid *peer);
|
||||
|
||||
int tipc_ref_valid(u32 portref);
|
||||
|
||||
/*
|
||||
* TIPC messaging routines
|
||||
*/
|
||||
@@ -170,38 +160,12 @@ int tipc_send(u32 portref,
|
||||
unsigned int num_sect,
|
||||
struct iovec const *msg_sect);
|
||||
|
||||
int tipc_send_buf(u32 portref,
|
||||
struct sk_buff *buf,
|
||||
unsigned int dsz);
|
||||
|
||||
int tipc_send2name(u32 portref,
|
||||
struct tipc_name const *name,
|
||||
u32 domain,
|
||||
unsigned int num_sect,
|
||||
struct iovec const *msg_sect);
|
||||
|
||||
int tipc_send_buf2name(u32 portref,
|
||||
struct tipc_name const *name,
|
||||
u32 domain,
|
||||
struct sk_buff *buf,
|
||||
unsigned int dsz);
|
||||
|
||||
int tipc_forward2name(u32 portref,
|
||||
struct tipc_name const *name,
|
||||
u32 domain,
|
||||
unsigned int section_count,
|
||||
struct iovec const *msg_sect,
|
||||
struct tipc_portid const *origin,
|
||||
unsigned int importance);
|
||||
|
||||
int tipc_forward_buf2name(u32 portref,
|
||||
struct tipc_name const *name,
|
||||
u32 domain,
|
||||
struct sk_buff *buf,
|
||||
unsigned int dsz,
|
||||
struct tipc_portid const *orig,
|
||||
unsigned int importance);
|
||||
|
||||
int tipc_send2port(u32 portref,
|
||||
struct tipc_portid const *dest,
|
||||
unsigned int num_sect,
|
||||
@@ -212,46 +176,11 @@ int tipc_send_buf2port(u32 portref,
|
||||
struct sk_buff *buf,
|
||||
unsigned int dsz);
|
||||
|
||||
int tipc_forward2port(u32 portref,
|
||||
struct tipc_portid const *dest,
|
||||
unsigned int num_sect,
|
||||
struct iovec const *msg_sect,
|
||||
struct tipc_portid const *origin,
|
||||
unsigned int importance);
|
||||
|
||||
int tipc_forward_buf2port(u32 portref,
|
||||
struct tipc_portid const *dest,
|
||||
struct sk_buff *buf,
|
||||
unsigned int dsz,
|
||||
struct tipc_portid const *orig,
|
||||
unsigned int importance);
|
||||
|
||||
int tipc_multicast(u32 portref,
|
||||
struct tipc_name_seq const *seq,
|
||||
u32 domain, /* currently unused */
|
||||
unsigned int section_count,
|
||||
struct iovec const *msg);
|
||||
|
||||
#if 0
|
||||
int tipc_multicast_buf(u32 portref,
|
||||
struct tipc_name_seq const *seq,
|
||||
u32 domain,
|
||||
void *buf,
|
||||
unsigned int size);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TIPC subscription routines
|
||||
*/
|
||||
|
||||
int tipc_ispublished(struct tipc_name const *name);
|
||||
|
||||
/*
|
||||
* Get number of available nodes within specified domain (excluding own node)
|
||||
*/
|
||||
|
||||
unsigned int tipc_available_nodes(const u32 domain);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,8 +88,6 @@ void tipc_acknowledge(u32 port_ref,u32 ack);
|
||||
|
||||
struct tipc_port *tipc_get_port(const u32 ref);
|
||||
|
||||
void *tipc_get_handle(const u32 ref);
|
||||
|
||||
/*
|
||||
* The following routines require that the port be locked on entry
|
||||
*/
|
||||
|
||||
@@ -41,11 +41,6 @@
|
||||
#include "cluster.h"
|
||||
#include "net.h"
|
||||
|
||||
u32 tipc_get_addr(void)
|
||||
{
|
||||
return tipc_own_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* tipc_addr_domain_valid - validates a network domain address
|
||||
*
|
||||
|
||||
+7
-3
@@ -121,6 +121,9 @@ static DEFINE_SPINLOCK(bc_lock);
|
||||
|
||||
const char tipc_bclink_name[] = "broadcast-link";
|
||||
|
||||
static void tipc_nmap_diff(struct tipc_node_map *nm_a,
|
||||
struct tipc_node_map *nm_b,
|
||||
struct tipc_node_map *nm_diff);
|
||||
|
||||
static u32 buf_seqno(struct sk_buff *buf)
|
||||
{
|
||||
@@ -287,7 +290,7 @@ static void bclink_send_nack(struct tipc_node *n_ptr)
|
||||
if (!less(n_ptr->bclink.gap_after, n_ptr->bclink.gap_to))
|
||||
return;
|
||||
|
||||
buf = buf_acquire(INT_H_SIZE);
|
||||
buf = tipc_buf_acquire(INT_H_SIZE);
|
||||
if (buf) {
|
||||
msg = buf_msg(buf);
|
||||
tipc_msg_init(msg, BCAST_PROTOCOL, STATE_MSG,
|
||||
@@ -871,8 +874,9 @@ void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node)
|
||||
* @nm_diff: output node map A-B (i.e. nodes of A that are not in B)
|
||||
*/
|
||||
|
||||
void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
|
||||
struct tipc_node_map *nm_diff)
|
||||
static void tipc_nmap_diff(struct tipc_node_map *nm_a,
|
||||
struct tipc_node_map *nm_b,
|
||||
struct tipc_node_map *nm_diff)
|
||||
{
|
||||
int stop = ARRAY_SIZE(nm_a->map);
|
||||
int w;
|
||||
|
||||
@@ -84,9 +84,6 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_m
|
||||
return !memcmp(nm_a, nm_b, sizeof(*nm_a));
|
||||
}
|
||||
|
||||
void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b,
|
||||
struct tipc_node_map *nm_diff);
|
||||
|
||||
void tipc_port_list_add(struct port_list *pl_ptr, u32 port);
|
||||
void tipc_port_list_free(struct port_list *pl_ptr);
|
||||
|
||||
|
||||
+1
-20
@@ -113,25 +113,6 @@ void tipc_cltr_delete(struct cluster *c_ptr)
|
||||
kfree(c_ptr);
|
||||
}
|
||||
|
||||
u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
|
||||
{
|
||||
struct tipc_node *n_ptr;
|
||||
u32 n_num = tipc_node(addr) + 1;
|
||||
|
||||
if (!c_ptr)
|
||||
return addr;
|
||||
for (; n_num <= c_ptr->highest_node; n_num++) {
|
||||
n_ptr = c_ptr->nodes[n_num];
|
||||
if (n_ptr && tipc_node_has_active_links(n_ptr))
|
||||
return n_ptr->addr;
|
||||
}
|
||||
for (n_num = 1; n_num < tipc_node(addr); n_num++) {
|
||||
n_ptr = c_ptr->nodes[n_num];
|
||||
if (n_ptr && tipc_node_has_active_links(n_ptr))
|
||||
return n_ptr->addr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
|
||||
{
|
||||
@@ -232,7 +213,7 @@ struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
|
||||
static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest)
|
||||
{
|
||||
u32 size = INT_H_SIZE + data_size;
|
||||
struct sk_buff *buf = buf_acquire(size);
|
||||
struct sk_buff *buf = tipc_buf_acquire(size);
|
||||
struct tipc_msg *msg;
|
||||
|
||||
if (buf) {
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr);
|
||||
void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest);
|
||||
void tipc_cltr_broadcast(struct sk_buff *buf);
|
||||
int tipc_cltr_init(void);
|
||||
u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr);
|
||||
|
||||
void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
|
||||
void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest);
|
||||
void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
|
||||
|
||||
+6
-1
@@ -95,7 +95,7 @@ int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
|
||||
static struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
|
||||
{
|
||||
struct sk_buff *buf;
|
||||
__be32 value_net;
|
||||
@@ -109,6 +109,11 @@ struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
|
||||
{
|
||||
return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
|
||||
}
|
||||
|
||||
struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
|
||||
{
|
||||
struct sk_buff *buf;
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
struct sk_buff *tipc_cfg_reply_alloc(int payload_size);
|
||||
int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
|
||||
void *tlv_data, int tlv_data_size);
|
||||
struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value);
|
||||
struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string);
|
||||
|
||||
static inline struct sk_buff *tipc_cfg_reply_none(void)
|
||||
@@ -53,11 +52,6 @@ static inline struct sk_buff *tipc_cfg_reply_none(void)
|
||||
return tipc_cfg_reply_alloc(0);
|
||||
}
|
||||
|
||||
static inline struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
|
||||
{
|
||||
return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
|
||||
}
|
||||
|
||||
static inline struct sk_buff *tipc_cfg_reply_error_string(char *string)
|
||||
{
|
||||
return tipc_cfg_reply_string_type(TIPC_TLV_ERROR_STRING, string);
|
||||
|
||||
+6
-22
@@ -96,13 +96,13 @@ int tipc_net_id;
|
||||
int tipc_remote_management;
|
||||
|
||||
|
||||
int tipc_get_mode(void)
|
||||
static int tipc_get_mode(void)
|
||||
{
|
||||
return tipc_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* buf_acquire - creates a TIPC message buffer
|
||||
* tipc_buf_acquire - creates a TIPC message buffer
|
||||
* @size: message size (including TIPC header)
|
||||
*
|
||||
* Returns a new buffer with data pointers set to the specified size.
|
||||
@@ -111,7 +111,7 @@ int tipc_get_mode(void)
|
||||
* There may also be unrequested tailroom present at the buffer's end.
|
||||
*/
|
||||
|
||||
struct sk_buff *buf_acquire(u32 size)
|
||||
struct sk_buff *tipc_buf_acquire(u32 size)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u;
|
||||
@@ -129,7 +129,7 @@ struct sk_buff *buf_acquire(u32 size)
|
||||
* tipc_core_stop_net - shut down TIPC networking sub-systems
|
||||
*/
|
||||
|
||||
void tipc_core_stop_net(void)
|
||||
static void tipc_core_stop_net(void)
|
||||
{
|
||||
tipc_eth_media_stop();
|
||||
tipc_net_stop();
|
||||
@@ -154,7 +154,7 @@ int tipc_core_start_net(unsigned long addr)
|
||||
* tipc_core_stop - switch TIPC from SINGLE NODE to NOT RUNNING mode
|
||||
*/
|
||||
|
||||
void tipc_core_stop(void)
|
||||
static void tipc_core_stop(void)
|
||||
{
|
||||
if (tipc_mode != TIPC_NODE_MODE)
|
||||
return;
|
||||
@@ -176,7 +176,7 @@ void tipc_core_stop(void)
|
||||
* tipc_core_start - switch TIPC from NOT RUNNING to SINGLE NODE mode
|
||||
*/
|
||||
|
||||
int tipc_core_start(void)
|
||||
static int tipc_core_start(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
@@ -246,7 +246,6 @@ MODULE_VERSION(TIPC_MOD_VER);
|
||||
|
||||
EXPORT_SYMBOL(tipc_attach);
|
||||
EXPORT_SYMBOL(tipc_detach);
|
||||
EXPORT_SYMBOL(tipc_get_addr);
|
||||
EXPORT_SYMBOL(tipc_get_mode);
|
||||
EXPORT_SYMBOL(tipc_createport);
|
||||
EXPORT_SYMBOL(tipc_deleteport);
|
||||
@@ -262,23 +261,10 @@ EXPORT_SYMBOL(tipc_withdraw);
|
||||
EXPORT_SYMBOL(tipc_connect2port);
|
||||
EXPORT_SYMBOL(tipc_disconnect);
|
||||
EXPORT_SYMBOL(tipc_shutdown);
|
||||
EXPORT_SYMBOL(tipc_isconnected);
|
||||
EXPORT_SYMBOL(tipc_peer);
|
||||
EXPORT_SYMBOL(tipc_ref_valid);
|
||||
EXPORT_SYMBOL(tipc_send);
|
||||
EXPORT_SYMBOL(tipc_send_buf);
|
||||
EXPORT_SYMBOL(tipc_send2name);
|
||||
EXPORT_SYMBOL(tipc_forward2name);
|
||||
EXPORT_SYMBOL(tipc_send_buf2name);
|
||||
EXPORT_SYMBOL(tipc_forward_buf2name);
|
||||
EXPORT_SYMBOL(tipc_send2port);
|
||||
EXPORT_SYMBOL(tipc_forward2port);
|
||||
EXPORT_SYMBOL(tipc_send_buf2port);
|
||||
EXPORT_SYMBOL(tipc_forward_buf2port);
|
||||
EXPORT_SYMBOL(tipc_multicast);
|
||||
/* EXPORT_SYMBOL(tipc_multicast_buf); not available yet */
|
||||
EXPORT_SYMBOL(tipc_ispublished);
|
||||
EXPORT_SYMBOL(tipc_available_nodes);
|
||||
|
||||
/* TIPC API for external bearers (see tipc_bearer.h) */
|
||||
|
||||
@@ -295,6 +281,4 @@ EXPORT_SYMBOL(tipc_createport_raw);
|
||||
EXPORT_SYMBOL(tipc_reject_msg);
|
||||
EXPORT_SYMBOL(tipc_send_buf_fast);
|
||||
EXPORT_SYMBOL(tipc_acknowledge);
|
||||
EXPORT_SYMBOL(tipc_get_port);
|
||||
EXPORT_SYMBOL(tipc_get_handle);
|
||||
|
||||
|
||||
+2
-7
@@ -83,9 +83,7 @@
|
||||
* Note: TIPC_LOG is configured to echo its output to the system console;
|
||||
* user-defined buffers can be configured to do the same thing.
|
||||
*/
|
||||
|
||||
extern struct print_buf *const TIPC_NULL;
|
||||
extern struct print_buf *const TIPC_CONS;
|
||||
extern struct print_buf *const TIPC_LOG;
|
||||
|
||||
void tipc_printf(struct print_buf *, const char *fmt, ...);
|
||||
@@ -204,10 +202,7 @@ extern atomic_t tipc_user_count;
|
||||
* Routines available to privileged subsystems
|
||||
*/
|
||||
|
||||
extern int tipc_core_start(void);
|
||||
extern void tipc_core_stop(void);
|
||||
extern int tipc_core_start_net(unsigned long addr);
|
||||
extern void tipc_core_stop_net(void);
|
||||
extern int tipc_core_start_net(unsigned long);
|
||||
extern int tipc_handler_start(void);
|
||||
extern void tipc_handler_stop(void);
|
||||
extern int tipc_netlink_start(void);
|
||||
@@ -328,7 +323,7 @@ static inline struct tipc_msg *buf_msg(struct sk_buff *skb)
|
||||
return (struct tipc_msg *)skb->data;
|
||||
}
|
||||
|
||||
extern struct sk_buff *buf_acquire(u32 size);
|
||||
extern struct sk_buff *tipc_buf_acquire(u32 size);
|
||||
|
||||
/**
|
||||
* buf_discard - frees a TIPC message buffer
|
||||
|
||||
+9
-4
@@ -52,7 +52,7 @@ static struct print_buf null_buf = { NULL, 0, NULL, 0 };
|
||||
struct print_buf *const TIPC_NULL = &null_buf;
|
||||
|
||||
static struct print_buf cons_buf = { NULL, 0, NULL, 1 };
|
||||
struct print_buf *const TIPC_CONS = &cons_buf;
|
||||
static struct print_buf *const TIPC_CONS = &cons_buf;
|
||||
|
||||
static struct print_buf log_buf = { NULL, 0, NULL, 1 };
|
||||
struct print_buf *const TIPC_LOG = &log_buf;
|
||||
@@ -76,6 +76,10 @@ struct print_buf *const TIPC_LOG = &log_buf;
|
||||
static char print_string[TIPC_PB_MAX_STR];
|
||||
static DEFINE_SPINLOCK(print_lock);
|
||||
|
||||
static void tipc_printbuf_reset(struct print_buf *pb);
|
||||
static int tipc_printbuf_empty(struct print_buf *pb);
|
||||
static void tipc_printbuf_move(struct print_buf *pb_to,
|
||||
struct print_buf *pb_from);
|
||||
|
||||
#define FORMAT(PTR,LEN,FMT) \
|
||||
{\
|
||||
@@ -116,7 +120,7 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size)
|
||||
* @pb: pointer to print buffer structure
|
||||
*/
|
||||
|
||||
void tipc_printbuf_reset(struct print_buf *pb)
|
||||
static void tipc_printbuf_reset(struct print_buf *pb)
|
||||
{
|
||||
if (pb->buf) {
|
||||
pb->crs = pb->buf;
|
||||
@@ -132,7 +136,7 @@ void tipc_printbuf_reset(struct print_buf *pb)
|
||||
* Returns non-zero if print buffer is empty.
|
||||
*/
|
||||
|
||||
int tipc_printbuf_empty(struct print_buf *pb)
|
||||
static int tipc_printbuf_empty(struct print_buf *pb)
|
||||
{
|
||||
return !pb->buf || (pb->crs == pb->buf);
|
||||
}
|
||||
@@ -181,7 +185,8 @@ int tipc_printbuf_validate(struct print_buf *pb)
|
||||
* Source print buffer becomes empty if a successful move occurs.
|
||||
*/
|
||||
|
||||
void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from)
|
||||
static void tipc_printbuf_move(struct print_buf *pb_to,
|
||||
struct print_buf *pb_from)
|
||||
{
|
||||
int len;
|
||||
|
||||
|
||||
@@ -56,10 +56,7 @@ struct print_buf {
|
||||
#define TIPC_PB_MAX_STR 512 /* max printable string (with trailing NUL) */
|
||||
|
||||
void tipc_printbuf_init(struct print_buf *pb, char *buf, u32 size);
|
||||
void tipc_printbuf_reset(struct print_buf *pb);
|
||||
int tipc_printbuf_empty(struct print_buf *pb);
|
||||
int tipc_printbuf_validate(struct print_buf *pb);
|
||||
void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from);
|
||||
|
||||
int tipc_log_resize(int log_size);
|
||||
|
||||
|
||||
+1
-15
@@ -68,20 +68,6 @@ struct link_req {
|
||||
unsigned int timer_intv;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* disc_lost_link(): A link has lost contact
|
||||
*/
|
||||
|
||||
void tipc_disc_link_event(u32 addr, char *name, int up)
|
||||
{
|
||||
if (in_own_cluster(addr))
|
||||
return;
|
||||
/*
|
||||
* Code for inter cluster link setup here
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* tipc_disc_init_msg - initialize a link setup message
|
||||
* @type: message type (request or response)
|
||||
@@ -95,7 +81,7 @@ static struct sk_buff *tipc_disc_init_msg(u32 type,
|
||||
u32 dest_domain,
|
||||
struct bearer *b_ptr)
|
||||
{
|
||||
struct sk_buff *buf = buf_acquire(DSC_H_SIZE);
|
||||
struct sk_buff *buf = tipc_buf_acquire(DSC_H_SIZE);
|
||||
struct tipc_msg *msg;
|
||||
|
||||
if (buf) {
|
||||
|
||||
@@ -50,6 +50,4 @@ void tipc_disc_stop_link_req(struct link_req *req);
|
||||
|
||||
void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr);
|
||||
|
||||
void tipc_disc_link_event(u32 addr, char *name, int up);
|
||||
|
||||
#endif
|
||||
|
||||
+24
-21
@@ -112,6 +112,9 @@ static void link_state_event(struct link *l_ptr, u32 event);
|
||||
static void link_reset_statistics(struct link *l_ptr);
|
||||
static void link_print(struct link *l_ptr, struct print_buf *buf,
|
||||
const char *str);
|
||||
static void link_start(struct link *l_ptr);
|
||||
static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
|
||||
|
||||
|
||||
/*
|
||||
* Debugging code used by link routines only
|
||||
@@ -442,7 +445,7 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer,
|
||||
|
||||
k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr);
|
||||
list_add_tail(&l_ptr->link_list, &b_ptr->links);
|
||||
tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr);
|
||||
tipc_k_signal((Handler)link_start, (unsigned long)l_ptr);
|
||||
|
||||
dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n",
|
||||
l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit);
|
||||
@@ -482,9 +485,9 @@ void tipc_link_delete(struct link *l_ptr)
|
||||
kfree(l_ptr);
|
||||
}
|
||||
|
||||
void tipc_link_start(struct link *l_ptr)
|
||||
static void link_start(struct link *l_ptr)
|
||||
{
|
||||
dbg("tipc_link_start %x\n", l_ptr);
|
||||
dbg("link_start %x\n", l_ptr);
|
||||
link_state_event(l_ptr, STARTING_EVT);
|
||||
}
|
||||
|
||||
@@ -1000,7 +1003,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
|
||||
/* Fragmentation needed ? */
|
||||
|
||||
if (size > max_packet)
|
||||
return tipc_link_send_long_buf(l_ptr, buf);
|
||||
return link_send_long_buf(l_ptr, buf);
|
||||
|
||||
/* Packet can be queued or sent: */
|
||||
|
||||
@@ -1036,7 +1039,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
|
||||
/* Try creating a new bundle */
|
||||
|
||||
if (size <= max_packet * 2 / 3) {
|
||||
struct sk_buff *bundler = buf_acquire(max_packet);
|
||||
struct sk_buff *bundler = tipc_buf_acquire(max_packet);
|
||||
struct tipc_msg bundler_hdr;
|
||||
|
||||
if (bundler) {
|
||||
@@ -1312,7 +1315,7 @@ again:
|
||||
|
||||
/* Prepare header of first fragment: */
|
||||
|
||||
buf_chain = buf = buf_acquire(max_pkt);
|
||||
buf_chain = buf = tipc_buf_acquire(max_pkt);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
buf->next = NULL;
|
||||
@@ -1369,7 +1372,7 @@ error:
|
||||
msg_set_size(&fragm_hdr, fragm_sz + INT_H_SIZE);
|
||||
msg_set_fragm_no(&fragm_hdr, ++fragm_no);
|
||||
prev = buf;
|
||||
buf = buf_acquire(fragm_sz + INT_H_SIZE);
|
||||
buf = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
|
||||
if (!buf)
|
||||
goto error;
|
||||
|
||||
@@ -2145,7 +2148,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
|
||||
if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) {
|
||||
if (!l_ptr->proto_msg_queue) {
|
||||
l_ptr->proto_msg_queue =
|
||||
buf_acquire(sizeof(l_ptr->proto_msg));
|
||||
tipc_buf_acquire(sizeof(l_ptr->proto_msg));
|
||||
}
|
||||
buf = l_ptr->proto_msg_queue;
|
||||
if (!buf)
|
||||
@@ -2159,7 +2162,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
|
||||
|
||||
msg_dbg(msg, ">>");
|
||||
|
||||
buf = buf_acquire(msg_size);
|
||||
buf = tipc_buf_acquire(msg_size);
|
||||
if (!buf)
|
||||
return;
|
||||
|
||||
@@ -2318,10 +2321,10 @@ exit:
|
||||
* tipc_link_tunnel(): Send one message via a link belonging to
|
||||
* another bearer. Owner node is locked.
|
||||
*/
|
||||
void tipc_link_tunnel(struct link *l_ptr,
|
||||
struct tipc_msg *tunnel_hdr,
|
||||
struct tipc_msg *msg,
|
||||
u32 selector)
|
||||
static void tipc_link_tunnel(struct link *l_ptr,
|
||||
struct tipc_msg *tunnel_hdr,
|
||||
struct tipc_msg *msg,
|
||||
u32 selector)
|
||||
{
|
||||
struct link *tunnel;
|
||||
struct sk_buff *buf;
|
||||
@@ -2334,7 +2337,7 @@ void tipc_link_tunnel(struct link *l_ptr,
|
||||
return;
|
||||
}
|
||||
msg_set_size(tunnel_hdr, length + INT_H_SIZE);
|
||||
buf = buf_acquire(length + INT_H_SIZE);
|
||||
buf = tipc_buf_acquire(length + INT_H_SIZE);
|
||||
if (!buf) {
|
||||
warn("Link changeover error, "
|
||||
"unable to send tunnel msg\n");
|
||||
@@ -2380,7 +2383,7 @@ void tipc_link_changeover(struct link *l_ptr)
|
||||
if (!l_ptr->first_out) {
|
||||
struct sk_buff *buf;
|
||||
|
||||
buf = buf_acquire(INT_H_SIZE);
|
||||
buf = tipc_buf_acquire(INT_H_SIZE);
|
||||
if (buf) {
|
||||
skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE);
|
||||
msg_set_size(&tunnel_hdr, INT_H_SIZE);
|
||||
@@ -2441,7 +2444,7 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *tunnel)
|
||||
msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); /* Update */
|
||||
msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
|
||||
msg_set_size(&tunnel_hdr, length + INT_H_SIZE);
|
||||
outbuf = buf_acquire(length + INT_H_SIZE);
|
||||
outbuf = tipc_buf_acquire(length + INT_H_SIZE);
|
||||
if (outbuf == NULL) {
|
||||
warn("Link changeover error, "
|
||||
"unable to send duplicate msg\n");
|
||||
@@ -2477,7 +2480,7 @@ static struct sk_buff *buf_extract(struct sk_buff *skb, u32 from_pos)
|
||||
u32 size = msg_size(msg);
|
||||
struct sk_buff *eb;
|
||||
|
||||
eb = buf_acquire(size);
|
||||
eb = tipc_buf_acquire(size);
|
||||
if (eb)
|
||||
skb_copy_to_linear_data(eb, msg, size);
|
||||
return eb;
|
||||
@@ -2605,11 +2608,11 @@ void tipc_link_recv_bundle(struct sk_buff *buf)
|
||||
|
||||
|
||||
/*
|
||||
* tipc_link_send_long_buf: Entry for buffers needing fragmentation.
|
||||
* link_send_long_buf: Entry for buffers needing fragmentation.
|
||||
* The buffer is complete, inclusive total message length.
|
||||
* Returns user data length.
|
||||
*/
|
||||
int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
|
||||
static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
|
||||
{
|
||||
struct tipc_msg *inmsg = buf_msg(buf);
|
||||
struct tipc_msg fragm_hdr;
|
||||
@@ -2648,7 +2651,7 @@ int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf)
|
||||
fragm_sz = rest;
|
||||
msg_set_type(&fragm_hdr, LAST_FRAGMENT);
|
||||
}
|
||||
fragm = buf_acquire(fragm_sz + INT_H_SIZE);
|
||||
fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
|
||||
if (fragm == NULL) {
|
||||
warn("Link unable to fragment message\n");
|
||||
dsz = -ENOMEM;
|
||||
@@ -2753,7 +2756,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
|
||||
buf_discard(fbuf);
|
||||
return 0;
|
||||
}
|
||||
pbuf = buf_acquire(msg_size(imsg));
|
||||
pbuf = tipc_buf_acquire(msg_size(imsg));
|
||||
if (pbuf != NULL) {
|
||||
pbuf->next = *pending;
|
||||
*pending = pbuf;
|
||||
|
||||
@@ -225,7 +225,6 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *dest);
|
||||
void tipc_link_reset_fragments(struct link *l_ptr);
|
||||
int tipc_link_is_up(struct link *l_ptr);
|
||||
int tipc_link_is_active(struct link *l_ptr);
|
||||
void tipc_link_start(struct link *l_ptr);
|
||||
u32 tipc_link_push_packet(struct link *l_ptr);
|
||||
void tipc_link_stop(struct link *l_ptr);
|
||||
struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space, u16 cmd);
|
||||
@@ -239,9 +238,6 @@ int tipc_link_send_sections_fast(struct port* sender,
|
||||
struct iovec const *msg_sect,
|
||||
const u32 num_sect,
|
||||
u32 destnode);
|
||||
int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf);
|
||||
void tipc_link_tunnel(struct link *l_ptr, struct tipc_msg *tnl_hdr,
|
||||
struct tipc_msg *msg, u32 selector);
|
||||
void tipc_link_recv_bundle(struct sk_buff *buf);
|
||||
int tipc_link_recv_fragment(struct sk_buff **pending,
|
||||
struct sk_buff **fb,
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ int tipc_msg_build(struct tipc_msg *hdr,
|
||||
return dsz;
|
||||
}
|
||||
|
||||
*buf = buf_acquire(sz);
|
||||
*buf = tipc_buf_acquire(sz);
|
||||
if (!(*buf))
|
||||
return -ENOMEM;
|
||||
skb_copy_to_linear_data(*buf, hdr, hsz);
|
||||
|
||||
@@ -98,7 +98,7 @@ static void publ_to_item(struct distr_item *i, struct publication *p)
|
||||
|
||||
static struct sk_buff *named_prepare_buf(u32 type, u32 size, u32 dest)
|
||||
{
|
||||
struct sk_buff *buf = buf_acquire(LONG_H_SIZE + size);
|
||||
struct sk_buff *buf = tipc_buf_acquire(LONG_H_SIZE + size);
|
||||
struct tipc_msg *msg;
|
||||
|
||||
if (buf != NULL) {
|
||||
|
||||
+2
-17
@@ -50,7 +50,8 @@ void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str);
|
||||
static void node_lost_contact(struct tipc_node *n_ptr);
|
||||
static void node_established_contact(struct tipc_node *n_ptr);
|
||||
|
||||
struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */
|
||||
/* sorted list of nodes within cluster */
|
||||
static struct tipc_node *tipc_nodes = NULL;
|
||||
|
||||
static DEFINE_SPINLOCK(node_create_lock);
|
||||
|
||||
@@ -587,22 +588,6 @@ void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router)
|
||||
node_lost_contact(n_ptr);
|
||||
}
|
||||
|
||||
u32 tipc_available_nodes(const u32 domain)
|
||||
{
|
||||
struct tipc_node *n_ptr;
|
||||
u32 cnt = 0;
|
||||
|
||||
read_lock_bh(&tipc_net_lock);
|
||||
for (n_ptr = tipc_nodes; n_ptr; n_ptr = n_ptr->next) {
|
||||
if (!tipc_in_scope(domain, n_ptr->addr))
|
||||
continue;
|
||||
if (tipc_node_is_up(n_ptr))
|
||||
cnt++;
|
||||
}
|
||||
read_unlock_bh(&tipc_net_lock);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
|
||||
{
|
||||
u32 domain;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user