/* All files are marked read-only. We don't care about pending delete files so this should be used in 'force' mode only.  */
void mark_files_ro(struct super_block *sb)
/* All files are marked read-only. We don't care about pending delete files so this should be used in 'force' mode only.  */
void mark_files_ro(struct super_block *sb)
{
	struct file *f;
retry:
	file_list_lock();
	list_for_each_entry(f, &sb->s_files, f_u.fu_list) {
		struct vfsmount *mnt;
		if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
		       continue;
		if (!file_count(f))
			continue;
		if (!(f->f_mode & FMODE_WRITE))
			continue;
		f->f_mode &= ~FMODE_WRITE;
		if (file_check_writeable(f) != 0)
			continue;
		file_release_write(f);
		mnt = mntget(f->f_path.mnt);
		file_list_unlock();
		mnt_drop_write(mnt);
		mntput(mnt);
		goto retry;
	}
	file_list_unlock();
}