quota: move code from sync_quota_sb into vfs_quota_sync
Currenly sync_quota_sb does a lot of sync and truncate action that only applies to "VFS" style quotas and is actively harmful for the sync performance in XFS. Move it into vfs_quota_sync and add a wait parameter to ->quota_sync to tell if we need it or not. My audit of the GFS2 code says it's also not needed given the way GFS2 implements quotas, but I'd be happy if this can get a detailed review. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
committed by
Jan Kara
parent
8c4e4acd66
commit
5fb324ad24
14
fs/sync.c
14
fs/sync.c
@@ -34,14 +34,14 @@ static int __sync_filesystem(struct super_block *sb, int wait)
|
||||
if (!sb->s_bdi)
|
||||
return 0;
|
||||
|
||||
/* Avoid doing twice syncing and cache pruning for quota sync */
|
||||
if (!wait) {
|
||||
writeout_quota_sb(sb, -1);
|
||||
writeback_inodes_sb(sb);
|
||||
} else {
|
||||
sync_quota_sb(sb, -1);
|
||||
if (sb->s_qcop && sb->s_qcop->quota_sync)
|
||||
sb->s_qcop->quota_sync(sb, -1, wait);
|
||||
|
||||
if (wait)
|
||||
sync_inodes_sb(sb);
|
||||
}
|
||||
else
|
||||
writeback_inodes_sb(sb);
|
||||
|
||||
if (sb->s_op->sync_fs)
|
||||
sb->s_op->sync_fs(sb, wait);
|
||||
return __sync_blockdev(sb->s_bdev, wait);
|
||||
|
Reference in New Issue
Block a user