Skip to content

Commit

Permalink
tipc: Eliminate trivial buffer manipulation helper routines
Browse files Browse the repository at this point in the history
Gets rid of two inlined routines that simply call existing sk_buff
manipulation routines, since there is no longer any extra processing
done by the helper routines.

Note that these changes are essentially cosmetic in nature, and have
no impact on the actual operation of TIPC.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 24, 2012
1 parent a635b46 commit 5f6d912
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 91 deletions.
12 changes: 6 additions & 6 deletions net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked)
if (bcbuf_acks(crs) == 0) {
bcl->first_out = next;
bcl->out_queue_size--;
buf_discard(crs);
kfree_skb(crs);
released = 1;
}
crs = next;
Expand Down Expand Up @@ -330,7 +330,7 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent)
tipc_bearer_send(&bcbearer->bearer, buf, NULL);
bcl->stats.sent_nacks++;
spin_unlock_bh(&bc_lock);
buf_discard(buf);
kfree_skb(buf);

n_ptr->bclink.oos_state++;
}
Expand Down Expand Up @@ -374,7 +374,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)

if (!bclink->bcast_nodes.count) {
res = msg_data_sz(buf_msg(buf));
buf_discard(buf);
kfree_skb(buf);
goto exit;
}

Expand Down Expand Up @@ -480,7 +480,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
if (likely(msg_mcast(msg)))
tipc_port_recv_mcast(buf, NULL);
else
buf_discard(buf);
kfree_skb(buf);
} else if (msg_user(msg) == MSG_BUNDLER) {
spin_lock_bh(&bc_lock);
bclink_accept_pkt(node, seqno);
Expand Down Expand Up @@ -513,7 +513,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
bclink_accept_pkt(node, seqno);
spin_unlock_bh(&bc_lock);
tipc_node_unlock(node);
buf_discard(buf);
kfree_skb(buf);
}
buf = NULL;

Expand Down Expand Up @@ -569,7 +569,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
unlock:
tipc_node_unlock(node);
exit:
buf_discard(buf);
kfree_skb(buf);
}

u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr)
Expand Down
24 changes: 0 additions & 24 deletions net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,28 +269,4 @@ static inline struct tipc_msg *buf_msg(struct sk_buff *skb)

extern struct sk_buff *tipc_buf_acquire(u32 size);

/**
* buf_discard - frees a TIPC message buffer
* @skb: message buffer
*
* Frees a message buffer. If passed NULL, just returns.
*/

static inline void buf_discard(struct sk_buff *skb)
{
kfree_skb(skb);
}

/**
* buf_linearize - convert a TIPC message buffer into a single contiguous piece
* @skb: message buffer
*
* Returns 0 on success.
*/

static inline int buf_linearize(struct sk_buff *skb)
{
return skb_linearize(skb);
}

#endif
6 changes: 3 additions & 3 deletions net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)

media_addr.broadcast = 1;
b_ptr->media->msg2addr(&media_addr, msg_media_addr(msg));
buf_discard(buf);
kfree_skb(buf);

/* Ensure message from node is valid and communication is permitted */
if (net_id != tipc_net_id)
Expand Down Expand Up @@ -250,7 +250,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
rbuf = tipc_disc_init_msg(DSC_RESP_MSG, orig, b_ptr);
if (rbuf) {
b_ptr->media->send_msg(rbuf, b_ptr, &media_addr);
buf_discard(rbuf);
kfree_skb(rbuf);
}
}

Expand Down Expand Up @@ -396,7 +396,7 @@ void tipc_disc_delete(struct tipc_link_req *req)
{
k_cancel_timer(&req->timer);
k_term_timer(&req->timer);
buf_discard(req->buf);
kfree_skb(req->buf);
kfree(req);
}

Loading

0 comments on commit 5f6d912

Please sign in to comment.