aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:01 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:28 -0500
commit63936ddaa16b9486e2d426ed7b09f559a5c60f87 (patch)
tree4cb1c4581799e10c26dd71d1a7d420de3c2cfd05 /include/linux
parent5dd4056db84387975140ff2568eaa0406f07985e (diff)
dquot: cleanup inode allocation / freeing routines
Get rid of the alloc_inode and free_inode dquot operations - they are always called from the filesystem and if a filesystem really needs their own (which none currently does) it can just call into it's own routine directly. Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always call the lowlevel dquot_alloc_inode / dqout_free_inode routines directly, which now lose the number argument which is always 1. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/quota.h2
-rw-r--r--include/linux/quotaops.h24
2 files changed, 4 insertions, 22 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 1b14ad287fe3..e3b07895d327 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -297,8 +297,6 @@ struct quota_format_ops {
297struct dquot_operations { 297struct dquot_operations {
298 int (*initialize) (struct inode *, int); 298 int (*initialize) (struct inode *, int);
299 int (*drop) (struct inode *); 299 int (*drop) (struct inode *);
300 int (*alloc_inode) (const struct inode *, qsize_t);
301 int (*free_inode) (const struct inode *, qsize_t);
302 int (*transfer) (struct inode *, qid_t *, unsigned long); 300 int (*transfer) (struct inode *, qid_t *, unsigned long);
303 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ 301 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */
304 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ 302 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 47e85682e118..9ce7f051a4ba 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -37,10 +37,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number,
37 int warn, int reserve); 37 int warn, int reserve);
38void __dquot_free_space(struct inode *inode, qsize_t number, int reserve); 38void __dquot_free_space(struct inode *inode, qsize_t number, int reserve);
39 39
40int dquot_alloc_inode(const struct inode *inode, qsize_t number); 40int dquot_alloc_inode(const struct inode *inode);
41 41
42int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 42int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
43int dquot_free_inode(const struct inode *inode, qsize_t number); 43void dquot_free_inode(const struct inode *inode);
44 44
45int dquot_transfer(struct inode *inode, qid_t *chid, unsigned long mask); 45int dquot_transfer(struct inode *inode, qid_t *chid, unsigned long mask);
46int dquot_commit(struct dquot *dquot); 46int dquot_commit(struct dquot *dquot);
@@ -148,22 +148,6 @@ static inline void vfs_dq_init(struct inode *inode)
148 inode->i_sb->dq_op->initialize(inode, -1); 148 inode->i_sb->dq_op->initialize(inode, -1);
149} 149}
150 150
151static inline int vfs_dq_alloc_inode(struct inode *inode)
152{
153 if (sb_any_quota_active(inode->i_sb)) {
154 vfs_dq_init(inode);
155 if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA)
156 return 1;
157 }
158 return 0;
159}
160
161static inline void vfs_dq_free_inode(struct inode *inode)
162{
163 if (sb_any_quota_active(inode->i_sb))
164 inode->i_sb->dq_op->free_inode(inode, 1);
165}
166
167/* Cannot be called inside a transaction */ 151/* Cannot be called inside a transaction */
168static inline int vfs_dq_off(struct super_block *sb, int remount) 152static inline int vfs_dq_off(struct super_block *sb, int remount)
169{ 153{
@@ -231,12 +215,12 @@ static inline void vfs_dq_drop(struct inode *inode)
231{ 215{
232} 216}
233 217
234static inline int vfs_dq_alloc_inode(struct inode *inode) 218static inline int dquot_alloc_inode(const struct inode *inode)
235{ 219{
236 return 0; 220 return 0;
237} 221}
238 222
239static inline void vfs_dq_free_inode(struct inode *inode) 223static inline void dquot_free_inode(const struct inode *inode)
240{ 224{
241} 225}
242 226