/* Do the filesystem syncing work. For simple filesystems writeback_inodes_sb(sb) just dirties buffers with inodes so we have to submit IO for these buffers via __sync_blockdev(). This also speeds up the wait == 1 case since in that case write_inode() functions do sync_dirty_buffer() and thus effectively write one block at a time.  */
static int __sync_filesystem(struct super_block *sb, int wait)
/* Do the filesystem syncing work. For simple filesystems writeback_inodes_sb(sb) just dirties buffers with inodes so we have to submit IO for these buffers via __sync_blockdev(). This also speeds up the wait == 1 case since in that case write_inode() functions do sync_dirty_buffer() and thus effectively write one block at a time.  */
static int __sync_filesystem(struct super_block *sb, int wait)
{
	if (!sb->s_bdi)
		return 0;
	if (!wait) {
		writeout_quota_sb(sb, -1);
		writeback_inodes_sb(sb);
	} else {
		sync_quota_sb(sb, -1);
		sync_inodes_sb(sb);
	}
	if (sb->s_op->sync_fs)
		sb->s_op->sync_fs(sb, wait);
	return __sync_blockdev(sb->s_bdev, wait);
}