/* Note: check the dirty flag before waiting, so we don't hold up the sync while mounting a device. (The newly mounted device won't need syncing.)  */
void sync_supers(void)
/* Note: check the dirty flag before waiting, so we don't hold up the sync while mounting a device. (The newly mounted device won't need syncing.)  */
void sync_supers(void)
{
	struct super_block *sb;
	spin_lock(&sb_lock);
restart:
	list_for_each_entry(sb, &super_blocks, s_list) {
		if (sb->s_op->write_super && sb->s_dirt) {
			sb->s_count++;
			spin_unlock(&sb_lock);
			down_read(&sb->s_umount);
			if (sb->s_root && sb->s_dirt)
				sb->s_op->write_super(sb);
			up_read(&sb->s_umount);
			spin_lock(&sb_lock);
			if (__put_super_and_need_restart(sb))
				goto restart;
		}
	}
	spin_unlock(&sb_lock);
}