Exemple #1
0
struct file *begin_import_dvfs_file(unsigned long dvfs_objid,
				    struct dvfs_file_struct **dvfs_file)
{
	struct file *file = NULL;

	/* Check if the file struct is already present */
	*dvfs_file = grab_dvfs_file_struct(dvfs_objid);
	file = (*dvfs_file)->file;
	if (file)
		get_file(file);

	return file;
}
struct file *begin_import_dvfs_file(unsigned long dvfs_objid,
				    struct dvfs_file_struct **dvfs_file)
{
	struct file *file = NULL;

	/* Check if the file struct is already present */
	*dvfs_file = grab_dvfs_file_struct(dvfs_objid);
	file = (*dvfs_file)->file;
	/* Check for a race with last fput()->__fput() */
	if (file && !atomic_long_inc_not_zero(&file->f_count)) {
		(*dvfs_file)->file = NULL;
		file = NULL;
	}

	return file;
}