aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quotaops.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:07 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:30 -0500
commit871a293155a24554e153538d36e3a80fa169aefb (patch)
tree7e38f5a2f9e87f63cbc4bc1077a4bb49dde441b0 /include/linux/quotaops.h
parent907f4554e2521cb28b0009d17167760650a9561c (diff)
dquot: cleanup dquot initialize routine
Get rid of the initialize dquot operation - it is now always called from the filesystem and if a filesystem really needs it's own (which none currently does) it can just call into it's own routine directly. Rename the now static low-level dquot_initialize helper to __dquot_initialize and vfs_dq_init to dquot_initialize to have a consistent namespace. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/quotaops.h')
-rw-r--r--include/linux/quotaops.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 93ac788345e2..e6fa7acce290 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -23,7 +23,7 @@ void inode_add_rsv_space(struct inode *inode, qsize_t number);
23void inode_claim_rsv_space(struct inode *inode, qsize_t number); 23void inode_claim_rsv_space(struct inode *inode, qsize_t number);
24void inode_sub_rsv_space(struct inode *inode, qsize_t number); 24void inode_sub_rsv_space(struct inode *inode, qsize_t number);
25 25
26int dquot_initialize(struct inode *inode, int type); 26void dquot_initialize(struct inode *inode);
27void dquot_drop(struct inode *inode); 27void dquot_drop(struct inode *inode);
28struct dquot *dqget(struct super_block *sb, unsigned int id, int type); 28struct dquot *dqget(struct super_block *sb, unsigned int id, int type);
29void dqput(struct dquot *dquot); 29void dqput(struct dquot *dquot);
@@ -139,15 +139,6 @@ extern const struct quotactl_ops vfs_quotactl_ops;
139#define sb_dquot_ops (&dquot_operations) 139#define sb_dquot_ops (&dquot_operations)
140#define sb_quotactl_ops (&vfs_quotactl_ops) 140#define sb_quotactl_ops (&vfs_quotactl_ops)
141 141
142/* It is better to call this function outside of any transaction as it might
143 * need a lot of space in journal for dquot structure allocation. */
144static inline void vfs_dq_init(struct inode *inode)
145{
146 BUG_ON(!inode->i_sb);
147 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode))
148 inode->i_sb->dq_op->initialize(inode, -1);
149}
150
151/* Cannot be called inside a transaction */ 142/* Cannot be called inside a transaction */
152static inline int vfs_dq_off(struct super_block *sb, int remount) 143static inline int vfs_dq_off(struct super_block *sb, int remount)
153{ 144{
@@ -207,7 +198,7 @@ static inline int sb_any_quota_active(struct super_block *sb)
207#define sb_dquot_ops (NULL) 198#define sb_dquot_ops (NULL)
208#define sb_quotactl_ops (NULL) 199#define sb_quotactl_ops (NULL)
209 200
210static inline void vfs_dq_init(struct inode *inode) 201static inline void dquot_initialize(struct inode *inode)
211{ 202{
212} 203}
213 204
@@ -260,6 +251,8 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
260 return 0; 251 return 0;
261} 252}
262 253
254#define dquot_file_open generic_file_open
255
263#endif /* CONFIG_QUOTA */ 256#endif /* CONFIG_QUOTA */
264 257
265static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 258static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
@@ -344,6 +337,4 @@ static inline void dquot_release_reservation_block(struct inode *inode,
344 __dquot_free_space(inode, nr << inode->i_blkbits, 1); 337 __dquot_free_space(inode, nr << inode->i_blkbits, 1);
345} 338}
346 339
347#define dquot_file_open generic_file_open
348
349#endif /* _LINUX_QUOTAOPS_ */ 340#endif /* _LINUX_QUOTAOPS_ */