aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
commita0e881b7c189fa2bd76c024dbff91e79511c971d (patch)
tree0c801918565b08921d21aceee5b326f64d998f5f /lib
parenteff0d13f3823f35d70228cd151d2a2c89288ff32 (diff)
parentdbc6e0222d79e78925fe20733844a796a4b72cf9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull second vfs pile from Al Viro: "The stuff in there: fsfreeze deadlock fixes by Jan (essentially, the deadlock reproduced by xfstests 068), symlink and hardlink restriction patches, plus assorted cleanups and fixes. Note that another fsfreeze deadlock (emergency thaw one) is *not* dealt with - the series by Fernando conflicts a lot with Jan's, breaks userland ABI (FIFREEZE semantics gets changed) and trades the deadlock for massive vfsmount leak; this is going to be handled next cycle. There probably will be another pull request, but that stuff won't be in it." Fix up trivial conflicts due to unrelated changes next to each other in drivers/{staging/gdm72xx/usb_boot.c, usb/gadget/storage_common.c} * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (54 commits) delousing target_core_file a bit Documentation: Correct s_umount state for freeze_fs/unfreeze_fs fs: Remove old freezing mechanism ext2: Implement freezing btrfs: Convert to new freezing mechanism nilfs2: Convert to new freezing mechanism ntfs: Convert to new freezing mechanism fuse: Convert to new freezing mechanism gfs2: Convert to new freezing mechanism ocfs2: Convert to new freezing mechanism xfs: Convert to new freezing code ext4: Convert to new freezing mechanism fs: Protect write paths by sb_start_write - sb_end_write fs: Skip atime update on frozen filesystem fs: Add freezing handling to mnt_want_write() / mnt_drop_write() fs: Improve filesystem freezing handling switch the protection of percpu_counter list to spinlock nfsd: Push mnt_want_write() outside of i_mutex btrfs: Push mnt_want_write() outside of i_mutex fat: Push mnt_want_write() outside of i_mutex ...
Diffstat (limited to 'lib')
-rw-r--r--lib/percpu_counter.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index f8a3f1a829b8..ba6085d9c741 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -12,7 +12,7 @@
12 12
13#ifdef CONFIG_HOTPLUG_CPU 13#ifdef CONFIG_HOTPLUG_CPU
14static LIST_HEAD(percpu_counters); 14static LIST_HEAD(percpu_counters);
15static DEFINE_MUTEX(percpu_counters_lock); 15static DEFINE_SPINLOCK(percpu_counters_lock);
16#endif 16#endif
17 17
18#ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER 18#ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER
@@ -123,9 +123,9 @@ int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,
123 123
124#ifdef CONFIG_HOTPLUG_CPU 124#ifdef CONFIG_HOTPLUG_CPU
125 INIT_LIST_HEAD(&fbc->list); 125 INIT_LIST_HEAD(&fbc->list);
126 mutex_lock(&percpu_counters_lock); 126 spin_lock(&percpu_counters_lock);
127 list_add(&fbc->list, &percpu_counters); 127 list_add(&fbc->list, &percpu_counters);
128 mutex_unlock(&percpu_counters_lock); 128 spin_unlock(&percpu_counters_lock);
129#endif 129#endif
130 return 0; 130 return 0;
131} 131}
@@ -139,9 +139,9 @@ void percpu_counter_destroy(struct percpu_counter *fbc)
139 debug_percpu_counter_deactivate(fbc); 139 debug_percpu_counter_deactivate(fbc);
140 140
141#ifdef CONFIG_HOTPLUG_CPU 141#ifdef CONFIG_HOTPLUG_CPU
142 mutex_lock(&percpu_counters_lock); 142 spin_lock(&percpu_counters_lock);
143 list_del(&fbc->list); 143 list_del(&fbc->list);
144 mutex_unlock(&percpu_counters_lock); 144 spin_unlock(&percpu_counters_lock);
145#endif 145#endif
146 free_percpu(fbc->counters); 146 free_percpu(fbc->counters);
147 fbc->counters = NULL; 147 fbc->counters = NULL;
@@ -170,7 +170,7 @@ static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
170 return NOTIFY_OK; 170 return NOTIFY_OK;
171 171
172 cpu = (unsigned long)hcpu; 172 cpu = (unsigned long)hcpu;
173 mutex_lock(&percpu_counters_lock); 173 spin_lock(&percpu_counters_lock);
174 list_for_each_entry(fbc, &percpu_counters, list) { 174 list_for_each_entry(fbc, &percpu_counters, list) {
175 s32 *pcount; 175 s32 *pcount;
176 unsigned long flags; 176 unsigned long flags;
@@ -181,7 +181,7 @@ static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
181 *pcount = 0; 181 *pcount = 0;
182 raw_spin_unlock_irqrestore(&fbc->lock, flags); 182 raw_spin_unlock_irqrestore(&fbc->lock, flags);
183 } 183 }
184 mutex_unlock(&percpu_counters_lock); 184 spin_unlock(&percpu_counters_lock);
185#endif 185#endif
186 return NOTIFY_OK; 186 return NOTIFY_OK;
187} 187}