aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quota.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r--include/linux/quota.h48
1 files changed, 36 insertions, 12 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index b462916b2a0a..7126a15467f1 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -174,6 +174,8 @@ 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>
178#include <linux/smp.h>
177 179
178#include <linux/dqblk_xfs.h> 180#include <linux/dqblk_xfs.h>
179#include <linux/dqblk_v1.h> 181#include <linux/dqblk_v1.h>
@@ -238,19 +240,43 @@ static inline int info_dirty(struct mem_dqinfo *info)
238 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags); 240 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
239} 241}
240 242
243enum {
244 DQST_LOOKUPS,
245 DQST_DROPS,
246 DQST_READS,
247 DQST_WRITES,
248 DQST_CACHE_HITS,
249 DQST_ALLOC_DQUOTS,
250 DQST_FREE_DQUOTS,
251 DQST_SYNCS,
252 _DQST_DQSTAT_LAST
253};
254
241struct dqstats { 255struct dqstats {
242 int lookups; 256 int stat[_DQST_DQSTAT_LAST];
243 int drops;
244 int reads;
245 int writes;
246 int cache_hits;
247 int allocated_dquots;
248 int free_dquots;
249 int syncs;
250}; 257};
251 258
259extern struct dqstats *dqstats_pcpu;
252extern struct dqstats dqstats; 260extern struct dqstats dqstats;
253 261
262static inline void dqstats_inc(unsigned int type)
263{
264#ifdef CONFIG_SMP
265 per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]++;
266#else
267 dqstats.stat[type]++;
268#endif
269}
270
271static inline void dqstats_dec(unsigned int type)
272{
273#ifdef CONFIG_SMP
274 per_cpu_ptr(dqstats_pcpu, smp_processor_id())->stat[type]--;
275#else
276 dqstats.stat[type]--;
277#endif
278}
279
254#define DQ_MOD_B 0 /* dquot modified since read */ 280#define DQ_MOD_B 0 /* dquot modified since read */
255#define DQ_BLKS_B 1 /* uid/gid has been warned about blk limit */ 281#define DQ_BLKS_B 1 /* uid/gid has been warned about blk limit */
256#define DQ_INODES_B 2 /* uid/gid has been warned about inode limit */ 282#define DQ_INODES_B 2 /* uid/gid has been warned about inode limit */
@@ -311,12 +337,10 @@ struct quotactl_ops {
311 int (*quota_sync)(struct super_block *, int, int); 337 int (*quota_sync)(struct super_block *, int, int);
312 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 338 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
313 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 339 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
314 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 340 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
315 int (*set_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 341 int (*set_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
316 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 342 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
317 int (*set_xstate)(struct super_block *, unsigned int, int); 343 int (*set_xstate)(struct super_block *, unsigned int, int);
318 int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
319 int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
320}; 344};
321 345
322struct quota_format_type { 346struct quota_format_type {