diff options
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 2e5d3df0853d..55a233d75f39 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -438,10 +438,10 @@ retry: | |||
438 | if (new_congested) { | 438 | if (new_congested) { |
439 | /* !found and storage for new one already allocated, insert */ | 439 | /* !found and storage for new one already allocated, insert */ |
440 | congested = new_congested; | 440 | congested = new_congested; |
441 | new_congested = NULL; | ||
442 | rb_link_node(&congested->rb_node, parent, node); | 441 | rb_link_node(&congested->rb_node, parent, node); |
443 | rb_insert_color(&congested->rb_node, &bdi->cgwb_congested_tree); | 442 | rb_insert_color(&congested->rb_node, &bdi->cgwb_congested_tree); |
444 | goto found; | 443 | spin_unlock_irqrestore(&cgwb_lock, flags); |
444 | return congested; | ||
445 | } | 445 | } |
446 | 446 | ||
447 | spin_unlock_irqrestore(&cgwb_lock, flags); | 447 | spin_unlock_irqrestore(&cgwb_lock, flags); |
@@ -451,13 +451,13 @@ retry: | |||
451 | if (!new_congested) | 451 | if (!new_congested) |
452 | return NULL; | 452 | return NULL; |
453 | 453 | ||
454 | atomic_set(&new_congested->refcnt, 0); | 454 | refcount_set(&new_congested->refcnt, 1); |
455 | new_congested->__bdi = bdi; | 455 | new_congested->__bdi = bdi; |
456 | new_congested->blkcg_id = blkcg_id; | 456 | new_congested->blkcg_id = blkcg_id; |
457 | goto retry; | 457 | goto retry; |
458 | 458 | ||
459 | found: | 459 | found: |
460 | atomic_inc(&congested->refcnt); | 460 | refcount_inc(&congested->refcnt); |
461 | spin_unlock_irqrestore(&cgwb_lock, flags); | 461 | spin_unlock_irqrestore(&cgwb_lock, flags); |
462 | kfree(new_congested); | 462 | kfree(new_congested); |
463 | return congested; | 463 | return congested; |
@@ -474,7 +474,7 @@ void wb_congested_put(struct bdi_writeback_congested *congested) | |||
474 | unsigned long flags; | 474 | unsigned long flags; |
475 | 475 | ||
476 | local_irq_save(flags); | 476 | local_irq_save(flags); |
477 | if (!atomic_dec_and_lock(&congested->refcnt, &cgwb_lock)) { | 477 | if (!refcount_dec_and_lock(&congested->refcnt, &cgwb_lock)) { |
478 | local_irq_restore(flags); | 478 | local_irq_restore(flags); |
479 | return; | 479 | return; |
480 | } | 480 | } |
@@ -804,7 +804,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) | |||
804 | if (!bdi->wb_congested) | 804 | if (!bdi->wb_congested) |
805 | return -ENOMEM; | 805 | return -ENOMEM; |
806 | 806 | ||
807 | atomic_set(&bdi->wb_congested->refcnt, 1); | 807 | refcount_set(&bdi->wb_congested->refcnt, 1); |
808 | 808 | ||
809 | err = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL); | 809 | err = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL); |
810 | if (err) { | 810 | if (err) { |