From: Marek Lindner <lindner_marek@yahoo.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: [B.A.T.M.A.N.] [PATCH 7/8] batman-adv: rename batadv_claim struct to make clear it is used by bla
Date: Tue, 25 Dec 2012 17:03:25 +0800 [thread overview]
Message-ID: <1356426206-8667-7-git-send-email-lindner_marek@yahoo.de> (raw)
In-Reply-To: <1356426206-8667-1-git-send-email-lindner_marek@yahoo.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
bridge_loop_avoidance.c | 41 +++++++++++++++++++++--------------------
types.h | 2 +-
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 3bcb1de..2b8deec 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -41,7 +41,7 @@ batadv_bla_send_announce(struct batadv_priv *bat_priv,
/* return the index of the claim */
static inline uint32_t batadv_choose_claim(const void *data, uint32_t size)
{
- struct batadv_claim *claim = (struct batadv_claim *)data;
+ struct batadv_bla_claim *claim = (struct batadv_bla_claim *)data;
uint32_t hash = 0;
hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr));
@@ -58,7 +58,7 @@ static inline uint32_t batadv_choose_claim(const void *data, uint32_t size)
static inline uint32_t batadv_choose_backbone_gw(const void *data,
uint32_t size)
{
- const struct batadv_claim *claim = (struct batadv_claim *)data;
+ const struct batadv_bla_claim *claim = (struct batadv_bla_claim *)data;
uint32_t hash = 0;
hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr));
@@ -93,9 +93,9 @@ static int batadv_compare_backbone_gw(const struct hlist_node *node,
static int batadv_compare_claim(const struct hlist_node *node,
const void *data2)
{
- const void *data1 = container_of(node, struct batadv_claim,
+ const void *data1 = container_of(node, struct batadv_bla_claim,
hash_entry);
- const struct batadv_claim *cl1 = data1, *cl2 = data2;
+ const struct batadv_bla_claim *cl1 = data1, *cl2 = data2;
if (!batadv_compare_eth(cl1->addr, cl2->addr))
return 0;
@@ -117,16 +117,16 @@ batadv_backbone_gw_free_ref(struct batadv_bla_backbone_gw *backbone_gw)
/* finally deinitialize the claim */
static void batadv_claim_free_rcu(struct rcu_head *rcu)
{
- struct batadv_claim *claim;
+ struct batadv_bla_claim *claim;
- claim = container_of(rcu, struct batadv_claim, rcu);
+ claim = container_of(rcu, struct batadv_bla_claim, rcu);
batadv_backbone_gw_free_ref(claim->backbone_gw);
kfree(claim);
}
/* free a claim, call claim_free_rcu if its the last reference */
-static void batadv_claim_free_ref(struct batadv_claim *claim)
+static void batadv_claim_free_ref(struct batadv_bla_claim *claim)
{
if (atomic_dec_and_test(&claim->refcount))
call_rcu(&claim->rcu, batadv_claim_free_rcu);
@@ -138,14 +138,15 @@ static void batadv_claim_free_ref(struct batadv_claim *claim)
* looks for a claim in the hash, and returns it if found
* or NULL otherwise.
*/
-static struct batadv_claim *batadv_claim_hash_find(struct batadv_priv *bat_priv,
- struct batadv_claim *data)
+static struct batadv_bla_claim
+*batadv_claim_hash_find(struct batadv_priv *bat_priv,
+ struct batadv_bla_claim *data)
{
struct batadv_hashtable *hash = bat_priv->bla.claim_hash;
struct hlist_head *head;
struct hlist_node *node;
- struct batadv_claim *claim;
- struct batadv_claim *claim_tmp = NULL;
+ struct batadv_bla_claim *claim;
+ struct batadv_bla_claim *claim_tmp = NULL;
int index;
if (!hash)
@@ -222,7 +223,7 @@ batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw)
struct batadv_hashtable *hash;
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
- struct batadv_claim *claim;
+ struct batadv_bla_claim *claim;
int i;
spinlock_t *list_lock; /* protects write access to the hash lists */
@@ -462,7 +463,7 @@ static void batadv_bla_answer_request(struct batadv_priv *bat_priv,
struct hlist_node *node;
struct hlist_head *head;
struct batadv_hashtable *hash;
- struct batadv_claim *claim;
+ struct batadv_bla_claim *claim;
struct batadv_bla_backbone_gw *backbone_gw;
int i;
@@ -552,8 +553,8 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
const uint8_t *mac, const short vid,
struct batadv_bla_backbone_gw *backbone_gw)
{
- struct batadv_claim *claim;
- struct batadv_claim search_claim;
+ struct batadv_bla_claim *claim;
+ struct batadv_bla_claim search_claim;
int hash_added;
memcpy(search_claim.addr, mac, ETH_ALEN);
@@ -615,7 +616,7 @@ claim_free_ref:
static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
const uint8_t *mac, const short vid)
{
- struct batadv_claim search_claim, *claim;
+ struct batadv_bla_claim search_claim, *claim;
memcpy(search_claim.addr, mac, ETH_ALEN);
search_claim.vid = vid;
@@ -1011,7 +1012,7 @@ static void batadv_bla_purge_claims(struct batadv_priv *bat_priv,
struct batadv_hard_iface *primary_if,
int now)
{
- struct batadv_claim *claim;
+ struct batadv_bla_claim *claim;
struct hlist_node *node;
struct hlist_head *head;
struct batadv_hashtable *hash;
@@ -1440,7 +1441,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid,
bool is_bcast)
{
struct ethhdr *ethhdr;
- struct batadv_claim search_claim, *claim = NULL;
+ struct batadv_bla_claim search_claim, *claim = NULL;
struct batadv_hard_iface *primary_if;
int ret;
@@ -1534,7 +1535,7 @@ out:
int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
{
struct ethhdr *ethhdr;
- struct batadv_claim search_claim, *claim = NULL;
+ struct batadv_bla_claim search_claim, *claim = NULL;
struct batadv_hard_iface *primary_if;
int ret = 0;
@@ -1610,7 +1611,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
struct net_device *net_dev = (struct net_device *)seq->private;
struct batadv_priv *bat_priv = netdev_priv(net_dev);
struct batadv_hashtable *hash = bat_priv->bla.claim_hash;
- struct batadv_claim *claim;
+ struct batadv_bla_claim *claim;
struct batadv_hard_iface *primary_if;
struct hlist_node *node;
struct hlist_head *head;
diff --git a/types.h b/types.h
index eb3d129..549ba56 100644
--- a/types.h
+++ b/types.h
@@ -353,7 +353,7 @@ struct batadv_bla_backbone_gw {
uint16_t crc; /* crc checksum over all claims */
};
-struct batadv_claim {
+struct batadv_bla_claim {
uint8_t addr[ETH_ALEN];
short vid;
struct batadv_bla_backbone_gw *backbone_gw;
--
1.7.10.4
next prev parent reply other threads:[~2012-12-25 9:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-25 9:03 [B.A.T.M.A.N.] [PATCH 1/8] batman-adv: align kernel doc properly Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: mark debug_log struct as bat_priv only struct Marek Lindner
2013-01-02 7:02 ` Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 3/8] batman-adv: group tt type definitions together Marek Lindner
2013-01-02 7:04 ` Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 4/8] batman-adv: rename batadv_if_list_entry struct to make clear it is used by vis Marek Lindner
2013-01-02 7:06 ` Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 5/8] batman-adv: rename batadv_recvlist_node " Marek Lindner
2013-01-02 7:09 ` Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 6/8] batman-adv: rename batadv_backbone_gw struct to make clear it is used by bla Marek Lindner
2013-01-02 7:13 ` Marek Lindner
2012-12-25 9:03 ` Marek Lindner [this message]
2013-01-02 7:53 ` [B.A.T.M.A.N.] [PATCH 7/8] batman-adv: rename batadv_claim " Marek Lindner
2012-12-25 9:03 ` [B.A.T.M.A.N.] [PATCH 8/8] batman-adv: kernel doc for types.h Marek Lindner
2012-12-25 9:11 ` [B.A.T.M.A.N.] [PATCHv2 " Marek Lindner
2012-12-25 13:45 ` [B.A.T.M.A.N.] [PATCHv3 " Marek Lindner
2013-01-02 7:56 ` Marek Lindner
2013-01-02 6:59 ` [B.A.T.M.A.N.] [PATCH 1/8] batman-adv: align kernel doc properly Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356426206-8667-7-git-send-email-lindner_marek@yahoo.de \
--to=lindner_marek@yahoo.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).