quota: cleanup dquota sync functions (version 4)
Currently the VFS calls vfs_dq_sync to sync out disk quotas for a given superblock. This is a small wrapper around sync_dquots which for the case of a non-NULL superblock is a small wrapper around quota_sync_sb. Just make quota_sync_sb global (rename it to sync_quota_sb) and call it directly. Also call it directly for those cases in quota.c that have a superblock and leave sync_dquots purely an iterator over sync_quota_sb and remove it's superblock argument. To make this nicer move the check for the lack of a quota_sync method from the callers into sync_quota_sb. [folded build fix from Alexander Beregalov <a.beregalov@gmail.com>] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:

committed by
Al Viro

parent
60b0680fa2
commit
850b201b08
@@ -20,7 +20,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb)
|
||||
/*
|
||||
* declaration of quota_function calls in kernel.
|
||||
*/
|
||||
void sync_dquots(struct super_block *sb, int type);
|
||||
void sync_quota_sb(struct super_block *sb, int type);
|
||||
|
||||
int dquot_initialize(struct inode *inode, int type);
|
||||
int dquot_drop(struct inode *inode);
|
||||
@@ -253,12 +253,7 @@ static inline void vfs_dq_free_inode(struct inode *inode)
|
||||
inode->i_sb->dq_op->free_inode(inode, 1);
|
||||
}
|
||||
|
||||
/* The following two functions cannot be called inside a transaction */
|
||||
static inline void vfs_dq_sync(struct super_block *sb)
|
||||
{
|
||||
sync_dquots(sb, -1);
|
||||
}
|
||||
|
||||
/* Cannot be called inside a transaction */
|
||||
static inline int vfs_dq_off(struct super_block *sb, int remount)
|
||||
{
|
||||
int ret = -ENOSYS;
|
||||
@@ -334,7 +329,7 @@ static inline void vfs_dq_free_inode(struct inode *inode)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void vfs_dq_sync(struct super_block *sb)
|
||||
static inline void sync_quota_sb(struct super_block *sb, int type)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user