diff options
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r-- | include/linux/quota.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index 2789d07c37be..94c1f03b50eb 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -174,8 +174,7 @@ enum { | |||
174 | #include <linux/rwsem.h> | 174 | #include <linux/rwsem.h> |
175 | #include <linux/spinlock.h> | 175 | #include <linux/spinlock.h> |
176 | #include <linux/wait.h> | 176 | #include <linux/wait.h> |
177 | #include <linux/percpu.h> | 177 | #include <linux/percpu_counter.h> |
178 | #include <linux/smp.h> | ||
179 | 178 | ||
180 | #include <linux/dqblk_xfs.h> | 179 | #include <linux/dqblk_xfs.h> |
181 | #include <linux/dqblk_v1.h> | 180 | #include <linux/dqblk_v1.h> |
@@ -254,6 +253,7 @@ enum { | |||
254 | 253 | ||
255 | struct dqstats { | 254 | struct dqstats { |
256 | int stat[_DQST_DQSTAT_LAST]; | 255 | int stat[_DQST_DQSTAT_LAST]; |
256 | struct percpu_counter counter[_DQST_DQSTAT_LAST]; | ||
257 | }; | 257 | }; |
258 | 258 | ||
259 | extern struct dqstats *dqstats_pcpu; | 259 | extern struct dqstats *dqstats_pcpu; |
@@ -261,20 +261,12 @@ extern struct dqstats dqstats; | |||
261 | 261 | ||
262 | static inline void dqstats_inc(unsigned int type) | 262 | static inline void dqstats_inc(unsigned int type) |
263 | { | 263 | { |
264 | #ifdef CONFIG_SMP | 264 | percpu_counter_inc(&dqstats.counter[type]); |
265 | per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++; | ||
266 | #else | ||
267 | dqstats.stat[type]++; | ||
268 | #endif | ||
269 | } | 265 | } |
270 | 266 | ||
271 | static inline void dqstats_dec(unsigned int type) | 267 | static inline void dqstats_dec(unsigned int type) |
272 | { | 268 | { |
273 | #ifdef CONFIG_SMP | 269 | percpu_counter_dec(&dqstats.counter[type]); |
274 | per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--; | ||
275 | #else | ||
276 | dqstats.stat[type]--; | ||
277 | #endif | ||
278 | } | 270 | } |
279 | 271 | ||
280 | #define DQ_MOD_B 0 /* dquot modified since read */ | 272 | #define DQ_MOD_B 0 /* dquot modified since read */ |