From 307ae18a56e5b706056a2050d52e8cc01b5171c0 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 19 May 2010 07:16:43 -0400 Subject: quota: drop remount argument to ->quota_on and ->quota_off Remount handling has fully moved into the filesystem, so all this is superflous now. Signed-off-by: Christoph Hellwig Signed-off-by: Jan Kara --- include/linux/quota.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/quota.h') diff --git a/include/linux/quota.h b/include/linux/quota.h index 7126a15467f1..2789d07c37be 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -332,8 +332,8 @@ struct dquot_operations { /* Operations handling requests from userspace */ struct quotactl_ops { - int (*quota_on)(struct super_block *, int, int, char *, int); - int (*quota_off)(struct super_block *, int, int); + int (*quota_on)(struct super_block *, int, int, char *); + int (*quota_off)(struct super_block *, int); int (*quota_sync)(struct super_block *, int, int); int (*get_info)(struct super_block *, int, struct if_dqinfo *); int (*set_info)(struct super_block *, int, struct if_dqinfo *); -- cgit v1.2.3 From f32764bd2bbb6ea003c158b1d276b4dc9f900348 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Wed, 26 May 2010 23:21:58 +0200 Subject: quota: Convert quota statistics to generic percpu_counter Generic per-cpu counter has some memory overhead but it is negligible for modern systems and embedded systems compile without quota support. And code reuse is a good thing. This patch should fix complain from preemptive kernels which was introduced by dde9588853b1bde. [Jan Kara: Fixed patch to work on 32-bit archs as well] Reported-by: Rafael J. Wysocki Signed-off-by: Dmitry Monakhov Signed-off-by: Jan Kara --- include/linux/quota.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'include/linux/quota.h') 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 { #include #include #include -#include -#include +#include #include #include @@ -254,6 +253,7 @@ enum { struct dqstats { int stat[_DQST_DQSTAT_LAST]; + struct percpu_counter counter[_DQST_DQSTAT_LAST]; }; extern struct dqstats *dqstats_pcpu; @@ -261,20 +261,12 @@ extern struct dqstats dqstats; static inline void dqstats_inc(unsigned int type) { -#ifdef CONFIG_SMP - per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++; -#else - dqstats.stat[type]++; -#endif + percpu_counter_inc(&dqstats.counter[type]); } static inline void dqstats_dec(unsigned int type) { -#ifdef CONFIG_SMP - per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--; -#else - dqstats.stat[type]--; -#endif + percpu_counter_dec(&dqstats.counter[type]); } #define DQ_MOD_B 0 /* dquot modified since read */ -- cgit v1.2.3