Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320982
b: refs/heads/master
c: d87aae2
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 31, 2012
1 parent 09c167d commit 57a2a83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a55c1017b8dcfd0554734ce3f19374d5b522d59
refs/heads/master: d87aae2f3c8e90bd0fe03f5309b4d066b712b8ec
14 changes: 7 additions & 7 deletions trunk/lib/percpu_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#ifdef CONFIG_HOTPLUG_CPU
static LIST_HEAD(percpu_counters);
static DEFINE_MUTEX(percpu_counters_lock);
static DEFINE_SPINLOCK(percpu_counters_lock);
#endif

#ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER
Expand Down Expand Up @@ -123,9 +123,9 @@ int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,

#ifdef CONFIG_HOTPLUG_CPU
INIT_LIST_HEAD(&fbc->list);
mutex_lock(&percpu_counters_lock);
spin_lock(&percpu_counters_lock);
list_add(&fbc->list, &percpu_counters);
mutex_unlock(&percpu_counters_lock);
spin_unlock(&percpu_counters_lock);
#endif
return 0;
}
Expand All @@ -139,9 +139,9 @@ void percpu_counter_destroy(struct percpu_counter *fbc)
debug_percpu_counter_deactivate(fbc);

#ifdef CONFIG_HOTPLUG_CPU
mutex_lock(&percpu_counters_lock);
spin_lock(&percpu_counters_lock);
list_del(&fbc->list);
mutex_unlock(&percpu_counters_lock);
spin_unlock(&percpu_counters_lock);
#endif
free_percpu(fbc->counters);
fbc->counters = NULL;
Expand Down Expand Up @@ -170,7 +170,7 @@ static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
return NOTIFY_OK;

cpu = (unsigned long)hcpu;
mutex_lock(&percpu_counters_lock);
spin_lock(&percpu_counters_lock);
list_for_each_entry(fbc, &percpu_counters, list) {
s32 *pcount;
unsigned long flags;
Expand All @@ -181,7 +181,7 @@ static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
*pcount = 0;
raw_spin_unlock_irqrestore(&fbc->lock, flags);
}
mutex_unlock(&percpu_counters_lock);
spin_unlock(&percpu_counters_lock);
#endif
return NOTIFY_OK;
}
Expand Down

0 comments on commit 57a2a83

Please sign in to comment.