aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/atm/mpoa_caches.c14
-rw-r--r--net/atm/mpoa_caches.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c
index 05e89e9930d5..4ccaa16b1eb1 100644
--- a/net/atm/mpoa_caches.c
+++ b/net/atm/mpoa_caches.c
@@ -339,7 +339,7 @@ static eg_cache_entry *eg_cache_get_by_cache_id(__be32 cache_id,
339 entry = mpc->eg_cache; 339 entry = mpc->eg_cache;
340 while (entry != NULL) { 340 while (entry != NULL) {
341 if (entry->ctrl_info.cache_id == cache_id) { 341 if (entry->ctrl_info.cache_id == cache_id) {
342 atomic_inc(&entry->use); 342 refcount_inc(&entry->use);
343 read_unlock_irq(&mpc->egress_lock); 343 read_unlock_irq(&mpc->egress_lock);
344 return entry; 344 return entry;
345 } 345 }
@@ -360,7 +360,7 @@ static eg_cache_entry *eg_cache_get_by_tag(__be32 tag, struct mpoa_client *mpc)
360 entry = mpc->eg_cache; 360 entry = mpc->eg_cache;
361 while (entry != NULL) { 361 while (entry != NULL) {
362 if (entry->ctrl_info.tag == tag) { 362 if (entry->ctrl_info.tag == tag) {
363 atomic_inc(&entry->use); 363 refcount_inc(&entry->use);
364 read_unlock_irqrestore(&mpc->egress_lock, flags); 364 read_unlock_irqrestore(&mpc->egress_lock, flags);
365 return entry; 365 return entry;
366 } 366 }
@@ -382,7 +382,7 @@ static eg_cache_entry *eg_cache_get_by_vcc(struct atm_vcc *vcc,
382 entry = mpc->eg_cache; 382 entry = mpc->eg_cache;
383 while (entry != NULL) { 383 while (entry != NULL) {
384 if (entry->shortcut == vcc) { 384 if (entry->shortcut == vcc) {
385 atomic_inc(&entry->use); 385 refcount_inc(&entry->use);
386 read_unlock_irqrestore(&mpc->egress_lock, flags); 386 read_unlock_irqrestore(&mpc->egress_lock, flags);
387 return entry; 387 return entry;
388 } 388 }
@@ -402,7 +402,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr,
402 entry = mpc->eg_cache; 402 entry = mpc->eg_cache;
403 while (entry != NULL) { 403 while (entry != NULL) {
404 if (entry->latest_ip_addr == ipaddr) { 404 if (entry->latest_ip_addr == ipaddr) {
405 atomic_inc(&entry->use); 405 refcount_inc(&entry->use);
406 read_unlock_irq(&mpc->egress_lock); 406 read_unlock_irq(&mpc->egress_lock);
407 return entry; 407 return entry;
408 } 408 }
@@ -415,7 +415,7 @@ static eg_cache_entry *eg_cache_get_by_src_ip(__be32 ipaddr,
415 415
416static void eg_cache_put(eg_cache_entry *entry) 416static void eg_cache_put(eg_cache_entry *entry)
417{ 417{
418 if (atomic_dec_and_test(&entry->use)) { 418 if (refcount_dec_and_test(&entry->use)) {
419 memset(entry, 0, sizeof(eg_cache_entry)); 419 memset(entry, 0, sizeof(eg_cache_entry));
420 kfree(entry); 420 kfree(entry);
421 } 421 }
@@ -468,7 +468,7 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
468 dprintk("adding an egress entry, ip = %pI4, this should be our IP\n", 468 dprintk("adding an egress entry, ip = %pI4, this should be our IP\n",
469 &msg->content.eg_info.eg_dst_ip); 469 &msg->content.eg_info.eg_dst_ip);
470 470
471 atomic_set(&entry->use, 1); 471 refcount_set(&entry->use, 1);
472 dprintk("new_eg_cache_entry: about to lock\n"); 472 dprintk("new_eg_cache_entry: about to lock\n");
473 write_lock_irq(&client->egress_lock); 473 write_lock_irq(&client->egress_lock);
474 entry->next = client->eg_cache; 474 entry->next = client->eg_cache;
@@ -484,7 +484,7 @@ static eg_cache_entry *eg_cache_add_entry(struct k_message *msg,
484 dprintk("new_eg_cache_entry cache_id %u\n", 484 dprintk("new_eg_cache_entry cache_id %u\n",
485 ntohl(entry->ctrl_info.cache_id)); 485 ntohl(entry->ctrl_info.cache_id));
486 dprintk("mps_ip = %pI4\n", &entry->ctrl_info.mps_ip); 486 dprintk("mps_ip = %pI4\n", &entry->ctrl_info.mps_ip);
487 atomic_inc(&entry->use); 487 refcount_inc(&entry->use);
488 488
489 write_unlock_irq(&client->egress_lock); 489 write_unlock_irq(&client->egress_lock);
490 dprintk("new_eg_cache_entry: unlocked\n"); 490 dprintk("new_eg_cache_entry: unlocked\n");
diff --git a/net/atm/mpoa_caches.h b/net/atm/mpoa_caches.h
index 38a4e7e67c0b..30fe34841ced 100644
--- a/net/atm/mpoa_caches.h
+++ b/net/atm/mpoa_caches.h
@@ -59,7 +59,7 @@ typedef struct eg_cache_entry{
59 uint16_t entry_state; 59 uint16_t entry_state;
60 __be32 latest_ip_addr; /* The src IP address of the last packet */ 60 __be32 latest_ip_addr; /* The src IP address of the last packet */
61 struct eg_ctrl_info ctrl_info; 61 struct eg_ctrl_info ctrl_info;
62 atomic_t use; 62 refcount_t use;
63} eg_cache_entry; 63} eg_cache_entry;
64 64
65struct eg_cache_ops{ 65struct eg_cache_ops{