aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quotaops.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-30 12:11:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-30 12:11:11 -0400
commitd28619f1563140526e2f84eae436f39206f40a69 (patch)
treed93284016a0983c8f27b745a3c50738617e50995 /include/linux/quotaops.h
parent021fad8b706849c091f6e682bc5df3ce4f9ab4d7 (diff)
parentf32764bd2bbb6ea003c158b1d276b4dc9f900348 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: quota: Convert quota statistics to generic percpu_counter ext3 uses rb_node = NULL; to zero rb_root. quota: Fixup dquot_transfer reiserfs: Fix resuming of quotas on remount read-write pohmelfs: Remove dead quota code ufs: Remove dead quota code udf: Remove dead quota code quota: rename default quotactl methods to dquot_ quota: explicitly set ->dq_op and ->s_qcop quota: drop remount argument to ->quota_on and ->quota_off quota: move unmount handling into the filesystem quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers quota: move remount handling into the filesystem ocfs2: Fix use after free on remount read-only Fix up conflicts in fs/ext4/super.c and fs/ufs/file.c
Diffstat (limited to 'include/linux/quotaops.h')
-rw-r--r--include/linux/quotaops.h79
1 files changed, 36 insertions, 43 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index e38ae53f3529..aa36793b48bd 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -53,6 +53,14 @@ int dquot_alloc_inode(const struct inode *inode);
53int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 53int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
54void dquot_free_inode(const struct inode *inode); 54void dquot_free_inode(const struct inode *inode);
55 55
56int dquot_disable(struct super_block *sb, int type, unsigned int flags);
57/* Suspend quotas on remount RO */
58static inline int dquot_suspend(struct super_block *sb, int type)
59{
60 return dquot_disable(sb, type, DQUOT_SUSPENDED);
61}
62int dquot_resume(struct super_block *sb, int type);
63
56int dquot_commit(struct dquot *dquot); 64int dquot_commit(struct dquot *dquot);
57int dquot_acquire(struct dquot *dquot); 65int dquot_acquire(struct dquot *dquot);
58int dquot_release(struct dquot *dquot); 66int dquot_release(struct dquot *dquot);
@@ -61,27 +69,25 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
61 69
62int dquot_file_open(struct inode *inode, struct file *file); 70int dquot_file_open(struct inode *inode, struct file *file);
63 71
64int vfs_quota_on(struct super_block *sb, int type, int format_id, 72int dquot_quota_on(struct super_block *sb, int type, int format_id,
65 char *path, int remount); 73 char *path);
66int vfs_quota_enable(struct inode *inode, int type, int format_id, 74int dquot_enable(struct inode *inode, int type, int format_id,
67 unsigned int flags); 75 unsigned int flags);
68int vfs_quota_on_path(struct super_block *sb, int type, int format_id, 76int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
69 struct path *path); 77 struct path *path);
70int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 78int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
71 int format_id, int type); 79 int format_id, int type);
72int vfs_quota_off(struct super_block *sb, int type, int remount); 80int dquot_quota_off(struct super_block *sb, int type);
73int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); 81int dquot_quota_sync(struct super_block *sb, int type, int wait);
74int vfs_quota_sync(struct super_block *sb, int type, int wait); 82int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
75int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 83int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
76int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 84int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
77int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
78 struct fs_disk_quota *di); 85 struct fs_disk_quota *di);
79int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, 86int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
80 struct fs_disk_quota *di); 87 struct fs_disk_quota *di);
81 88
82int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); 89int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
83int dquot_transfer(struct inode *inode, struct iattr *iattr); 90int dquot_transfer(struct inode *inode, struct iattr *iattr);
84int vfs_dq_quota_on_remount(struct super_block *sb);
85 91
86static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) 92static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
87{ 93{
@@ -148,20 +154,7 @@ static inline unsigned sb_any_quota_active(struct super_block *sb)
148 * Operations supported for diskquotas. 154 * Operations supported for diskquotas.
149 */ 155 */
150extern const struct dquot_operations dquot_operations; 156extern const struct dquot_operations dquot_operations;
151extern const struct quotactl_ops vfs_quotactl_ops; 157extern const struct quotactl_ops dquot_quotactl_ops;
152
153#define sb_dquot_ops (&dquot_operations)
154#define sb_quotactl_ops (&vfs_quotactl_ops)
155
156/* Cannot be called inside a transaction */
157static inline int vfs_dq_off(struct super_block *sb, int remount)
158{
159 int ret = -ENOSYS;
160
161 if (sb->s_qcop && sb->s_qcop->quota_off)
162 ret = sb->s_qcop->quota_off(sb, -1, remount);
163 return ret;
164}
165 158
166#else 159#else
167 160
@@ -206,12 +199,6 @@ static inline int sb_any_quota_active(struct super_block *sb)
206 return 0; 199 return 0;
207} 200}
208 201
209/*
210 * NO-OP when quota not configured.
211 */
212#define sb_dquot_ops (NULL)
213#define sb_quotactl_ops (NULL)
214
215static inline void dquot_initialize(struct inode *inode) 202static inline void dquot_initialize(struct inode *inode)
216{ 203{
217} 204}
@@ -229,16 +216,6 @@ static inline void dquot_free_inode(const struct inode *inode)
229{ 216{
230} 217}
231 218
232static inline int vfs_dq_off(struct super_block *sb, int remount)
233{
234 return 0;
235}
236
237static inline int vfs_dq_quota_on_remount(struct super_block *sb)
238{
239 return 0;
240}
241
242static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) 219static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
243{ 220{
244 return 0; 221 return 0;
@@ -265,6 +242,22 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
265 return 0; 242 return 0;
266} 243}
267 244
245static inline int dquot_disable(struct super_block *sb, int type,
246 unsigned int flags)
247{
248 return 0;
249}
250
251static inline int dquot_suspend(struct super_block *sb, int type)
252{
253 return 0;
254}
255
256static inline int dquot_resume(struct super_block *sb, int type)
257{
258 return 0;
259}
260
268#define dquot_file_open generic_file_open 261#define dquot_file_open generic_file_open
269 262
270#endif /* CONFIG_QUOTA */ 263#endif /* CONFIG_QUOTA */