Commit 1a90632d authored by Jon Paul Maloy's avatar Jon Paul Maloy Committed by David S. Miller

tipc: eliminate remnants of hungarian notation

The number of variables with Hungarian notation (l_ptr, n_ptr etc.)
has been significantly reduced over the last couple of years.

We now root out the last traces of this practice.
There are no functional changes in this commit.
Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38206d59
...@@ -71,7 +71,7 @@ static const struct nla_policy tipc_nl_media_policy[TIPC_NLA_MEDIA_MAX + 1] = { ...@@ -71,7 +71,7 @@ static const struct nla_policy tipc_nl_media_policy[TIPC_NLA_MEDIA_MAX + 1] = {
[TIPC_NLA_MEDIA_PROP] = { .type = NLA_NESTED } [TIPC_NLA_MEDIA_PROP] = { .type = NLA_NESTED }
}; };
static void bearer_disable(struct net *net, struct tipc_bearer *b_ptr); static void bearer_disable(struct net *net, struct tipc_bearer *b);
/** /**
* tipc_media_find - locates specified media object by name * tipc_media_find - locates specified media object by name
...@@ -107,13 +107,13 @@ static struct tipc_media *media_find_id(u8 type) ...@@ -107,13 +107,13 @@ static struct tipc_media *media_find_id(u8 type)
void tipc_media_addr_printf(char *buf, int len, struct tipc_media_addr *a) void tipc_media_addr_printf(char *buf, int len, struct tipc_media_addr *a)
{ {
char addr_str[MAX_ADDR_STR]; char addr_str[MAX_ADDR_STR];
struct tipc_media *m_ptr; struct tipc_media *m;
int ret; int ret;
m_ptr = media_find_id(a->media_id); m = media_find_id(a->media_id);
if (m_ptr && !m_ptr->addr2str(a, addr_str, sizeof(addr_str))) if (m && !m->addr2str(a, addr_str, sizeof(addr_str)))
ret = scnprintf(buf, len, "%s(%s)", m_ptr->name, addr_str); ret = scnprintf(buf, len, "%s(%s)", m->name, addr_str);
else { else {
u32 i; u32 i;
...@@ -175,13 +175,13 @@ static int bearer_name_validate(const char *name, ...@@ -175,13 +175,13 @@ static int bearer_name_validate(const char *name,
struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name) struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
u32 i; u32 i;
for (i = 0; i < MAX_BEARERS; i++) { for (i = 0; i < MAX_BEARERS; i++) {
b_ptr = rtnl_dereference(tn->bearer_list[i]); b = rtnl_dereference(tn->bearer_list[i]);
if (b_ptr && (!strcmp(b_ptr->name, name))) if (b && (!strcmp(b->name, name)))
return b_ptr; return b;
} }
return NULL; return NULL;
} }
...@@ -189,24 +189,24 @@ struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name) ...@@ -189,24 +189,24 @@ struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name)
void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest) void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
rcu_read_lock(); rcu_read_lock();
b_ptr = rcu_dereference_rtnl(tn->bearer_list[bearer_id]); b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b_ptr) if (b)
tipc_disc_add_dest(b_ptr->link_req); tipc_disc_add_dest(b->link_req);
rcu_read_unlock(); rcu_read_unlock();
} }
void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest) void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
rcu_read_lock(); rcu_read_lock();
b_ptr = rcu_dereference_rtnl(tn->bearer_list[bearer_id]); b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b_ptr) if (b)
tipc_disc_remove_dest(b_ptr->link_req); tipc_disc_remove_dest(b->link_req);
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -218,8 +218,8 @@ static int tipc_enable_bearer(struct net *net, const char *name, ...@@ -218,8 +218,8 @@ static int tipc_enable_bearer(struct net *net, const char *name,
struct nlattr *attr[]) struct nlattr *attr[])
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
struct tipc_media *m_ptr; struct tipc_media *m;
struct tipc_bearer_names b_names; struct tipc_bearer_names b_names;
char addr_string[16]; char addr_string[16];
u32 bearer_id; u32 bearer_id;
...@@ -255,31 +255,31 @@ static int tipc_enable_bearer(struct net *net, const char *name, ...@@ -255,31 +255,31 @@ static int tipc_enable_bearer(struct net *net, const char *name,
return -EINVAL; return -EINVAL;
} }
m_ptr = tipc_media_find(b_names.media_name); m = tipc_media_find(b_names.media_name);
if (!m_ptr) { if (!m) {
pr_warn("Bearer <%s> rejected, media <%s> not registered\n", pr_warn("Bearer <%s> rejected, media <%s> not registered\n",
name, b_names.media_name); name, b_names.media_name);
return -EINVAL; return -EINVAL;
} }
if (priority == TIPC_MEDIA_LINK_PRI) if (priority == TIPC_MEDIA_LINK_PRI)
priority = m_ptr->priority; priority = m->priority;
restart: restart:
bearer_id = MAX_BEARERS; bearer_id = MAX_BEARERS;
with_this_prio = 1; with_this_prio = 1;
for (i = MAX_BEARERS; i-- != 0; ) { for (i = MAX_BEARERS; i-- != 0; ) {
b_ptr = rtnl_dereference(tn->bearer_list[i]); b = rtnl_dereference(tn->bearer_list[i]);
if (!b_ptr) { if (!b) {
bearer_id = i; bearer_id = i;
continue; continue;
} }
if (!strcmp(name, b_ptr->name)) { if (!strcmp(name, b->name)) {
pr_warn("Bearer <%s> rejected, already enabled\n", pr_warn("Bearer <%s> rejected, already enabled\n",
name); name);
return -EINVAL; return -EINVAL;
} }
if ((b_ptr->priority == priority) && if ((b->priority == priority) &&
(++with_this_prio > 2)) { (++with_this_prio > 2)) {
if (priority-- == 0) { if (priority-- == 0) {
pr_warn("Bearer <%s> rejected, duplicate priority\n", pr_warn("Bearer <%s> rejected, duplicate priority\n",
...@@ -297,35 +297,35 @@ static int tipc_enable_bearer(struct net *net, const char *name, ...@@ -297,35 +297,35 @@ static int tipc_enable_bearer(struct net *net, const char *name,
return -EINVAL; return -EINVAL;
} }
b_ptr = kzalloc(sizeof(*b_ptr), GFP_ATOMIC); b = kzalloc(sizeof(*b), GFP_ATOMIC);
if (!b_ptr) if (!b)
return -ENOMEM; return -ENOMEM;
strcpy(b_ptr->name, name); strcpy(b->name, name);
b_ptr->media = m_ptr; b->media = m;
res = m_ptr->enable_media(net, b_ptr, attr); res = m->enable_media(net, b, attr);
if (res) { if (res) {
pr_warn("Bearer <%s> rejected, enable failure (%d)\n", pr_warn("Bearer <%s> rejected, enable failure (%d)\n",
name, -res); name, -res);
return -EINVAL; return -EINVAL;
} }
b_ptr->identity = bearer_id; b->identity = bearer_id;
b_ptr->tolerance = m_ptr->tolerance; b->tolerance = m->tolerance;
b_ptr->window = m_ptr->window; b->window = m->window;
b_ptr->domain = disc_domain; b->domain = disc_domain;
b_ptr->net_plane = bearer_id + 'A'; b->net_plane = bearer_id + 'A';
b_ptr->priority = priority; b->priority = priority;
res = tipc_disc_create(net, b_ptr, &b_ptr->bcast_addr); res = tipc_disc_create(net, b, &b->bcast_addr);
if (res) { if (res) {
bearer_disable(net, b_ptr); bearer_disable(net, b);
pr_warn("Bearer <%s> rejected, discovery object creation failed\n", pr_warn("Bearer <%s> rejected, discovery object creation failed\n",
name); name);
return -EINVAL; return -EINVAL;
} }
rcu_assign_pointer(tn->bearer_list[bearer_id], b_ptr); rcu_assign_pointer(tn->bearer_list[bearer_id], b);
pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n", pr_info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
name, name,
...@@ -336,11 +336,11 @@ static int tipc_enable_bearer(struct net *net, const char *name, ...@@ -336,11 +336,11 @@ static int tipc_enable_bearer(struct net *net, const char *name,
/** /**
* tipc_reset_bearer - Reset all links established over this bearer * tipc_reset_bearer - Reset all links established over this bearer
*/ */
static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b_ptr) static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b)
{ {
pr_info("Resetting bearer <%s>\n", b_ptr->name); pr_info("Resetting bearer <%s>\n", b->name);
tipc_node_delete_links(net, b_ptr->identity); tipc_node_delete_links(net, b->identity);
tipc_disc_reset(net, b_ptr); tipc_disc_reset(net, b);
return 0; return 0;
} }
...@@ -349,26 +349,26 @@ static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b_ptr) ...@@ -349,26 +349,26 @@ static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b_ptr)
* *
* Note: This routine assumes caller holds RTNL lock. * Note: This routine assumes caller holds RTNL lock.
*/ */
static void bearer_disable(struct net *net, struct tipc_bearer *b_ptr) static void bearer_disable(struct net *net, struct tipc_bearer *b)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
u32 i; u32 i;
pr_info("Disabling bearer <%s>\n", b_ptr->name); pr_info("Disabling bearer <%s>\n", b->name);
b_ptr->media->disable_media(b_ptr); b->media->disable_media(b);
tipc_node_delete_links(net, b_ptr->identity); tipc_node_delete_links(net, b->identity);
RCU_INIT_POINTER(b_ptr->media_ptr, NULL); RCU_INIT_POINTER(b->media_ptr, NULL);
if (b_ptr->link_req) if (b->link_req)
tipc_disc_delete(b_ptr->link_req); tipc_disc_delete(b->link_req);
for (i = 0; i < MAX_BEARERS; i++) { for (i = 0; i < MAX_BEARERS; i++) {
if (b_ptr == rtnl_dereference(tn->bearer_list[i])) { if (b == rtnl_dereference(tn->bearer_list[i])) {
RCU_INIT_POINTER(tn->bearer_list[i], NULL); RCU_INIT_POINTER(tn->bearer_list[i], NULL);
break; break;
} }
} }
kfree_rcu(b_ptr, rcu); kfree_rcu(b, rcu);
} }
int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b, int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,
...@@ -411,7 +411,7 @@ void tipc_disable_l2_media(struct tipc_bearer *b) ...@@ -411,7 +411,7 @@ void tipc_disable_l2_media(struct tipc_bearer *b)
/** /**
* tipc_l2_send_msg - send a TIPC packet out over an L2 interface * tipc_l2_send_msg - send a TIPC packet out over an L2 interface
* @buf: the packet to be sent * @buf: the packet to be sent
* @b_ptr: the bearer through which the packet is to be sent * @b: the bearer through which the packet is to be sent
* @dest: peer destination address * @dest: peer destination address
*/ */
int tipc_l2_send_msg(struct net *net, struct sk_buff *skb, int tipc_l2_send_msg(struct net *net, struct sk_buff *skb,
...@@ -532,14 +532,14 @@ void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id, ...@@ -532,14 +532,14 @@ void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id,
static int tipc_l2_rcv_msg(struct sk_buff *buf, struct net_device *dev, static int tipc_l2_rcv_msg(struct sk_buff *buf, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev) struct packet_type *pt, struct net_device *orig_dev)
{ {
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
rcu_read_lock(); rcu_read_lock();
b_ptr = rcu_dereference_rtnl(dev->tipc_ptr); b = rcu_dereference_rtnl(dev->tipc_ptr);
if (likely(b_ptr)) { if (likely(b)) {
if (likely(buf->pkt_type <= PACKET_BROADCAST)) { if (likely(buf->pkt_type <= PACKET_BROADCAST)) {
buf->next = NULL; buf->next = NULL;
tipc_rcv(dev_net(dev), buf, b_ptr); tipc_rcv(dev_net(dev), buf, b);
rcu_read_unlock(); rcu_read_unlock();
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
} }
...@@ -564,13 +564,13 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt, ...@@ -564,13 +564,13 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
{ {
struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct net *net = dev_net(dev); struct net *net = dev_net(dev);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
b_ptr = rtnl_dereference(dev->tipc_ptr); b = rtnl_dereference(dev->tipc_ptr);
if (!b_ptr) if (!b)
return NOTIFY_DONE; return NOTIFY_DONE;
b_ptr->mtu = dev->mtu; b->mtu = dev->mtu;
switch (evt) { switch (evt) {
case NETDEV_CHANGE: case NETDEV_CHANGE:
...@@ -578,16 +578,16 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt, ...@@ -578,16 +578,16 @@ static int tipc_l2_device_event(struct notifier_block *nb, unsigned long evt,
break; break;
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
case NETDEV_CHANGEMTU: case NETDEV_CHANGEMTU:
tipc_reset_bearer(net, b_ptr); tipc_reset_bearer(net, b);
break; break;
case NETDEV_CHANGEADDR: case NETDEV_CHANGEADDR:
b_ptr->media->raw2addr(b_ptr, &b_ptr->addr, b->media->raw2addr(b, &b->addr,
(char *)dev->dev_addr); (char *)dev->dev_addr);
tipc_reset_bearer(net, b_ptr); tipc_reset_bearer(net, b);
break; break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
case NETDEV_CHANGENAME: case NETDEV_CHANGENAME:
bearer_disable(dev_net(dev), b_ptr); bearer_disable(dev_net(dev), b);
break; break;
} }
return NOTIFY_OK; return NOTIFY_OK;
...@@ -623,13 +623,13 @@ void tipc_bearer_cleanup(void) ...@@ -623,13 +623,13 @@ void tipc_bearer_cleanup(void)
void tipc_bearer_stop(struct net *net) void tipc_bearer_stop(struct net *net)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_bearer *b_ptr; struct tipc_bearer *b;
u32 i; u32 i;
for (i = 0; i < MAX_BEARERS; i++) { for (i = 0; i < MAX_BEARERS; i++) {
b_ptr = rtnl_dereference(tn->bearer_list[i]); b = rtnl_dereference(tn->bearer_list[i]);
if (b_ptr) { if (b) {
bearer_disable(net, b_ptr); bearer_disable(net, b);
tn->bearer_list[i] = NULL; tn->bearer_list[i] = NULL;
} }
} }
......
...@@ -103,11 +103,11 @@ struct tipc_bearer; ...@@ -103,11 +103,11 @@ struct tipc_bearer;
*/ */
struct tipc_media { struct tipc_media {
int (*send_msg)(struct net *net, struct sk_buff *buf, int (*send_msg)(struct net *net, struct sk_buff *buf,
struct tipc_bearer *b_ptr, struct tipc_bearer *b,
struct tipc_media_addr *dest); struct tipc_media_addr *dest);
int (*enable_media)(struct net *net, struct tipc_bearer *b_ptr, int (*enable_media)(struct net *net, struct tipc_bearer *b,
struct nlattr *attr[]); struct nlattr *attr[]);
void (*disable_media)(struct tipc_bearer *b_ptr); void (*disable_media)(struct tipc_bearer *b);
int (*addr2str)(struct tipc_media_addr *addr, int (*addr2str)(struct tipc_media_addr *addr,
char *strbuf, char *strbuf,
int bufsz); int bufsz);
...@@ -176,7 +176,7 @@ struct tipc_bearer_names { ...@@ -176,7 +176,7 @@ struct tipc_bearer_names {
* TIPC routines available to supported media types * TIPC routines available to supported media types
*/ */
void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b_ptr); void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b);
/* /*
* Routines made available to TIPC by supported media types * Routines made available to TIPC by supported media types
......
...@@ -75,14 +75,14 @@ struct tipc_link_req { ...@@ -75,14 +75,14 @@ struct tipc_link_req {
* tipc_disc_init_msg - initialize a link setup message * tipc_disc_init_msg - initialize a link setup message
* @net: the applicable net namespace * @net: the applicable net namespace
* @type: message type (request or response) * @type: message type (request or response)
* @b_ptr: ptr to bearer issuing message * @b: ptr to bearer issuing message
*/ */
static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type, static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type,
struct tipc_bearer *b_ptr) struct tipc_bearer *b)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_msg *msg; struct tipc_msg *msg;
u32 dest_domain = b_ptr->domain; u32 dest_domain = b->domain;
msg = buf_msg(buf); msg = buf_msg(buf);
tipc_msg_init(tn->own_addr, msg, LINK_CONFIG, type, tipc_msg_init(tn->own_addr, msg, LINK_CONFIG, type,
...@@ -92,16 +92,16 @@ static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type, ...@@ -92,16 +92,16 @@ static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type,
msg_set_node_capabilities(msg, TIPC_NODE_CAPABILITIES); msg_set_node_capabilities(msg, TIPC_NODE_CAPABILITIES);
msg_set_dest_domain(msg, dest_domain); msg_set_dest_domain(msg, dest_domain);
msg_set_bc_netid(msg, tn->net_id); msg_set_bc_netid(msg, tn->net_id);
b_ptr->media->addr2msg(msg_media_addr(msg), &b_ptr->addr); b->media->addr2msg(msg_media_addr(msg), &b->addr);
} }
/** /**
* disc_dupl_alert - issue node address duplication alert * disc_dupl_alert - issue node address duplication alert
* @b_ptr: pointer to bearer detecting duplication * @b: pointer to bearer detecting duplication
* @node_addr: duplicated node address * @node_addr: duplicated node address
* @media_addr: media address advertised by duplicated node * @media_addr: media address advertised by duplicated node
*/ */
static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, static void disc_dupl_alert(struct tipc_bearer *b, u32 node_addr,
struct tipc_media_addr *media_addr) struct tipc_media_addr *media_addr)
{ {
char node_addr_str[16]; char node_addr_str[16];
...@@ -111,7 +111,7 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr, ...@@ -111,7 +111,7 @@ static void disc_dupl_alert(struct tipc_bearer *b_ptr, u32 node_addr,
tipc_media_addr_printf(media_addr_str, sizeof(media_addr_str), tipc_media_addr_printf(media_addr_str, sizeof(media_addr_str),
media_addr); media_addr);
pr_warn("Duplicate %s using %s seen on <%s>\n", node_addr_str, pr_warn("Duplicate %s using %s seen on <%s>\n", node_addr_str,
media_addr_str, b_ptr->name); media_addr_str, b->name);
} }
/** /**
...@@ -261,13 +261,13 @@ static void disc_timeout(unsigned long data) ...@@ -261,13 +261,13 @@ static void disc_timeout(unsigned long data)
/** /**
* tipc_disc_create - create object to send periodic link setup requests * tipc_disc_create - create object to send periodic link setup requests
* @net: the applicable net namespace * @net: the applicable net namespace
* @b_ptr: ptr to bearer issuing requests * @b: ptr to bearer issuing requests
* @dest: destination address for request messages * @dest: destination address for request messages
* @dest_domain: network domain to which links can be established * @dest_domain: network domain to which links can be established
* *
* Returns 0 if successful, otherwise -errno. * Returns 0 if successful, otherwise -errno.
*/ */
int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr, int tipc_disc_create(struct net *net, struct tipc_bearer *b,
struct tipc_media_addr *dest) struct tipc_media_addr *dest)
{ {
struct tipc_link_req *req; struct tipc_link_req *req;
...@@ -282,17 +282,17 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr, ...@@ -282,17 +282,17 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr,
return -ENOMEM; return -ENOMEM;
} }
tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b_ptr); tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b);
memcpy(&req->dest, dest, sizeof(*dest)); memcpy(&req->dest, dest, sizeof(*dest));
req->net = net; req->net = net;
req->bearer_id = b_ptr->identity; req->bearer_id = b->identity;
req->domain = b_ptr->domain; req->domain = b->domain;
req->num_nodes = 0; req->num_nodes = 0;
req->timer_intv = TIPC_LINK_REQ_INIT; req->timer_intv = TIPC_LINK_REQ_INIT;
spin_lock_init(&req->lock); spin_lock_init(&req->lock);
setup_timer(&req->timer, disc_timeout, (unsigned long)req); setup_timer(&req->timer, disc_timeout, (unsigned long)req);
mod_timer(&req->timer, jiffies + req->timer_intv); mod_timer(&req->timer, jiffies + req->timer_intv);
b_ptr->link_req = req; b->link_req = req;
skb = skb_clone(req->buf, GFP_ATOMIC); skb = skb_clone(req->buf, GFP_ATOMIC);
if (skb) if (skb)
tipc_bearer_xmit_skb(net, req->bearer_id, skb, &req->dest); tipc_bearer_xmit_skb(net, req->bearer_id, skb, &req->dest);
...@@ -313,19 +313,19 @@ void tipc_disc_delete(struct tipc_link_req *req) ...@@ -313,19 +313,19 @@ void tipc_disc_delete(struct tipc_link_req *req)
/** /**
* tipc_disc_reset - reset object to send periodic link setup requests * tipc_disc_reset - reset object to send periodic link setup requests
* @net: the applicable net namespace * @net: the applicable net namespace
* @b_ptr: ptr to bearer issuing requests * @b: ptr to bearer issuing requests
* @dest_domain: network domain to which links can be established * @dest_domain: network domain to which links can be established
*/ */
void tipc_disc_reset(struct net *net, struct tipc_bearer *b_ptr) void tipc_disc_reset(struct net *net, struct tipc_bearer *b)
{ {
struct tipc_link_req *req = b_ptr->link_req; struct tipc_link_req *req = b->link_req;
struct sk_buff *skb; struct sk_buff *skb;
spin_lock_bh(&req->lock); spin_lock_bh(&req->lock);
tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b_ptr); tipc_disc_init_msg(net, req->buf, DSC_REQ_MSG, b);
req->net = net; req->net = net;
req->bearer_id = b_ptr->identity; req->bearer_id = b->identity;
req->domain = b_ptr->domain; req->domain = b->domain;
req->num_nodes = 0; req->num_nodes = 0;
req->timer_intv = TIPC_LINK_REQ_INIT; req->timer_intv = TIPC_LINK_REQ_INIT;
mod_timer(&req->timer, jiffies + req->timer_intv); mod_timer(&req->timer, jiffies + req->timer_intv);
......
...@@ -245,7 +245,7 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, ...@@ -245,7 +245,7 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe, static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe,
u16 rcvgap, int tolerance, int priority, u16 rcvgap, int tolerance, int priority,
struct sk_buff_head *xmitq); struct sk_buff_head *xmitq);
static void link_print(struct tipc_link *l_ptr, const char *str); static void link_print(struct tipc_link *l, const char *str);
static void tipc_link_build_nack_msg(struct tipc_link *l, static void tipc_link_build_nack_msg(struct tipc_link *l,
struct sk_buff_head *xmitq); struct sk_buff_head *xmitq);
static void tipc_link_build_bc_init_msg(struct tipc_link *l, static void tipc_link_build_bc_init_msg(struct tipc_link *l,
...@@ -1707,7 +1707,7 @@ void tipc_link_set_queue_limits(struct tipc_link *l, u32 win) ...@@ -1707,7 +1707,7 @@ void tipc_link_set_queue_limits(struct tipc_link *l, u32 win)
/** /**
* link_reset_stats - reset link statistics * link_reset_stats - reset link statistics
* @l_ptr: pointer to link * @l: pointer to link
*/ */
void tipc_link_reset_stats(struct tipc_link *l) void tipc_link_reset_stats(struct tipc_link *l)
{ {
......
...@@ -99,7 +99,7 @@ bool tipc_link_is_synching(struct tipc_link *l); ...@@ -99,7 +99,7 @@ bool tipc_link_is_synching(struct tipc_link *l);
bool tipc_link_is_failingover(struct tipc_link *l); bool tipc_link_is_failingover(struct tipc_link *l);
bool tipc_link_is_blocked(struct tipc_link *l); bool tipc_link_is_blocked(struct tipc_link *l);
void tipc_link_set_active(struct tipc_link *l, bool active); void tipc_link_set_active(struct tipc_link *l, bool active);
void tipc_link_reset(struct tipc_link *l_ptr); void tipc_link_reset(struct tipc_link *l);
void tipc_link_reset_stats(struct tipc_link *l); void tipc_link_reset_stats(struct tipc_link *l);
int tipc_link_xmit(struct tipc_link *link, struct sk_buff_head *list, int tipc_link_xmit(struct tipc_link *link, struct sk_buff_head *list,
struct sk_buff_head *xmitq); struct sk_buff_head *xmitq);
......
...@@ -319,62 +319,62 @@ static void tipc_node_write_unlock(struct tipc_node *n) ...@@ -319,62 +319,62 @@ static void tipc_node_write_unlock(struct tipc_node *n)
struct tipc_node *tipc_node_create(struct net *net, u32 addr, u16 capabilities) struct tipc_node *tipc_node_create(struct net *net, u32 addr, u16 capabilities)
{ {
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
struct tipc_node *n_ptr, *temp_node; struct tipc_node *n, *temp_node;
int i; int i;
spin_lock_bh(&tn->node_list_lock); spin_lock_bh(&tn->node_list_lock);
n_ptr = tipc_node_find(net, addr); n = tipc_node_find(net, addr);
if (n_ptr) if (n)
goto exit; goto exit;
n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC); n = kzalloc(sizeof(*n), GFP_ATOMIC);
if (!n_ptr) { if (!n) {
pr_warn("Node creation failed, no memory\n"); pr_warn("Node creation failed, no memory\n");
goto exit; goto exit;
} }
n_ptr->addr = addr; n->addr = addr;
n_ptr->net = net; n->net = net;
n_ptr->capabilities = capabilities; n->capabilities = capabilities;
kref_init(&n_ptr->kref); kref_init(&n->kref);
rwlock_init(&n_ptr->lock); rwlock_init(&n->lock);
INIT_HLIST_NODE(&n_ptr->hash); INIT_HLIST_NODE(&n->hash);
INIT_LIST_HEAD(&n_ptr->list); INIT_LIST_HEAD(&n->list);
INIT_LIST_HEAD(&n_ptr->publ_list); INIT_LIST_HEAD(&n->publ_list);
INIT_LIST_HEAD(&n_ptr->conn_sks); INIT_LIST_HEAD(&n->conn_sks);
skb_queue_head_init(&n_ptr->bc_entry.namedq); skb_queue_head_init(&n->bc_entry.namedq);
skb_queue_head_init(&n_ptr->bc_entry.inputq1); skb_queue_head_init(&n->bc_entry.inputq1);
__skb_queue_head_init(&n_ptr->bc_entry.arrvq); __skb_queue_head_init(&n->bc_entry.arrvq);
skb_queue_head_init(&n_ptr->bc_entry.inputq2); skb_queue_head_init(&n->bc_entry.inputq2);
for (i = 0; i < MAX_BEARERS; i++) for (i = 0; i < MAX_BEARERS; i++)
spin_lock_init(&n_ptr->links[i].lock); spin_lock_init(&n->links[i].lock);
hlist_add_head_rcu(&n_ptr->hash, &tn->node_htable[tipc_hashfn(addr)]); hlist_add_head_rcu(&n->hash, &tn->node_htable[tipc_hashfn(addr)]);
list_for_each_entry_rcu(temp_node, &tn->node_list, list) { list_for_each_entry_rcu(temp_node, &tn->node_list, list) {
if (n_ptr->addr < temp_node->addr) if (n->addr < temp_node->addr)
break; break;
} }
list_add_tail_rcu(&n_ptr->list, &temp_node->list); list_add_tail_rcu(&n->list, &temp_node->list);
n_ptr->state = SELF_DOWN_PEER_LEAVING; n->state = SELF_DOWN_PEER_LEAVING;
n_ptr->signature = INVALID_NODE_SIG; n->signature = INVALID_NODE_SIG;
n_ptr->active_links[0] = INVALID_BEARER_ID; n->active_links[0] = INVALID_BEARER_ID;
n_ptr->active_links[1] = INVALID_BEARER_ID; n->active_links[1] = INVALID_BEARER_ID;
if (!tipc_link_bc_create(net, tipc_own_addr(net), n_ptr->addr, if (!tipc_link_bc_create(net, tipc_own_addr(net), n->addr,
U16_MAX, U16_MAX,
tipc_link_window(tipc_bc_sndlink(net)), tipc_link_window(tipc_bc_sndlink(net)),
n_ptr->capabilities, n->capabilities,
&n_ptr->bc_entry.inputq1, &n->bc_entry.inputq1,
&n_ptr->bc_entry.namedq, &n->bc_entry.namedq,
tipc_bc_sndlink(net), tipc_bc_sndlink(net),
&n_ptr->bc_entry.link)) { &n->bc_entry.link)) {
pr_warn("Broadcast rcv link creation failed, no memory\n"); pr_warn("Broadcast rcv link creation failed, no memory\n");
kfree(n_ptr); kfree(n);
n_ptr = NULL; n = NULL;
goto exit; goto exit;
} }
tipc_node_get(n_ptr); tipc_node_get(n);
setup_timer(&n_ptr->timer, tipc_node_timeout, (unsigned long)n_ptr); setup_timer(&n->timer, tipc_node_timeout, (unsigned long)n);
n_ptr->keepalive_intv = U32_MAX; n->keepalive_intv = U32_MAX;
exit: exit:
spin_unlock_bh(&tn->node_list_lock); spin_unlock_bh(&tn->node_list_lock);
return n_ptr; return n;
} }
static void tipc_node_calculate_timer(struct tipc_node *n, struct tipc_link *l) static void tipc_node_calculate_timer(struct tipc_node *n, struct tipc_link *l)
......
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