diff options
Diffstat (limited to 'include/linux/quota.h')
-rw-r--r-- | include/linux/quota.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index b462916b2a0a..94c1f03b50eb 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -174,6 +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_counter.h> | ||
177 | 178 | ||
178 | #include <linux/dqblk_xfs.h> | 179 | #include <linux/dqblk_xfs.h> |
179 | #include <linux/dqblk_v1.h> | 180 | #include <linux/dqblk_v1.h> |
@@ -238,19 +239,36 @@ static inline int info_dirty(struct mem_dqinfo *info) | |||
238 | return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags); | 239 | return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags); |
239 | } | 240 | } |
240 | 241 | ||
242 | enum { | ||
243 | DQST_LOOKUPS, | ||
244 | DQST_DROPS, | ||
245 | DQST_READS, | ||
246 | DQST_WRITES, | ||
247 | DQST_CACHE_HITS, | ||
248 | DQST_ALLOC_DQUOTS, | ||
249 | DQST_FREE_DQUOTS, | ||
250 | DQST_SYNCS, | ||
251 | _DQST_DQSTAT_LAST | ||
252 | }; | ||
253 | |||
241 | struct dqstats { | 254 | struct dqstats { |
242 | int lookups; | 255 | int stat[_DQST_DQSTAT_LAST]; |
243 | int drops; | 256 | struct percpu_counter counter[_DQST_DQSTAT_LAST]; |
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 | ||
259 | extern struct dqstats *dqstats_pcpu; | ||
252 | extern struct dqstats dqstats; | 260 | extern struct dqstats dqstats; |
253 | 261 | ||
262 | static inline void dqstats_inc(unsigned int type) | ||
263 | { | ||
264 | percpu_counter_inc(&dqstats.counter[type]); | ||
265 | } | ||
266 | |||
267 | static inline void dqstats_dec(unsigned int type) | ||
268 | { | ||
269 | percpu_counter_dec(&dqstats.counter[type]); | ||
270 | } | ||
271 | |||
254 | #define DQ_MOD_B 0 /* dquot modified since read */ | 272 | #define DQ_MOD_B 0 /* dquot modified since read */ |
255 | #define DQ_BLKS_B 1 /* uid/gid has been warned about blk limit */ | 273 | #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 */ | 274 | #define DQ_INODES_B 2 /* uid/gid has been warned about inode limit */ |
@@ -306,17 +324,15 @@ struct dquot_operations { | |||
306 | 324 | ||
307 | /* Operations handling requests from userspace */ | 325 | /* Operations handling requests from userspace */ |
308 | struct quotactl_ops { | 326 | struct quotactl_ops { |
309 | int (*quota_on)(struct super_block *, int, int, char *, int); | 327 | int (*quota_on)(struct super_block *, int, int, char *); |
310 | int (*quota_off)(struct super_block *, int, int); | 328 | int (*quota_off)(struct super_block *, int); |
311 | int (*quota_sync)(struct super_block *, int, int); | 329 | int (*quota_sync)(struct super_block *, int, int); |
312 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
313 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 331 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
314 | int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); | 332 | 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 *); | 333 | int (*set_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); |
316 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 334 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); |
317 | int (*set_xstate)(struct super_block *, unsigned int, int); | 335 | 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 | }; | 336 | }; |
321 | 337 | ||
322 | struct quota_format_type { | 338 | struct quota_format_type { |