mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	convert cgroup and cpuset
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									ceefda6931
								
							
						
					
					
						commit
						f7e835710a
					
				
					 2 changed files with 11 additions and 13 deletions
				
			
		| 
						 | 
					@ -1460,9 +1460,9 @@ static int cgroup_get_rootdir(struct super_block *sb)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int cgroup_get_sb(struct file_system_type *fs_type,
 | 
					static struct dentry *cgroup_mount(struct file_system_type *fs_type,
 | 
				
			||||||
			 int flags, const char *unused_dev_name,
 | 
								 int flags, const char *unused_dev_name,
 | 
				
			||||||
			 void *data, struct vfsmount *mnt)
 | 
								 void *data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct cgroup_sb_opts opts;
 | 
						struct cgroup_sb_opts opts;
 | 
				
			||||||
	struct cgroupfs_root *root;
 | 
						struct cgroupfs_root *root;
 | 
				
			||||||
| 
						 | 
					@ -1596,10 +1596,9 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 | 
				
			||||||
		drop_parsed_module_refcounts(opts.subsys_bits);
 | 
							drop_parsed_module_refcounts(opts.subsys_bits);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	simple_set_mnt(mnt, sb);
 | 
					 | 
				
			||||||
	kfree(opts.release_agent);
 | 
						kfree(opts.release_agent);
 | 
				
			||||||
	kfree(opts.name);
 | 
						kfree(opts.name);
 | 
				
			||||||
	return 0;
 | 
						return dget(sb->s_root);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 drop_new_super:
 | 
					 drop_new_super:
 | 
				
			||||||
	deactivate_locked_super(sb);
 | 
						deactivate_locked_super(sb);
 | 
				
			||||||
| 
						 | 
					@ -1608,7 +1607,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
 | 
				
			||||||
 out_err:
 | 
					 out_err:
 | 
				
			||||||
	kfree(opts.release_agent);
 | 
						kfree(opts.release_agent);
 | 
				
			||||||
	kfree(opts.name);
 | 
						kfree(opts.name);
 | 
				
			||||||
	return ret;
 | 
						return ERR_PTR(ret);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void cgroup_kill_sb(struct super_block *sb) {
 | 
					static void cgroup_kill_sb(struct super_block *sb) {
 | 
				
			||||||
| 
						 | 
					@ -1658,7 +1657,7 @@ static void cgroup_kill_sb(struct super_block *sb) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct file_system_type cgroup_fs_type = {
 | 
					static struct file_system_type cgroup_fs_type = {
 | 
				
			||||||
	.name = "cgroup",
 | 
						.name = "cgroup",
 | 
				
			||||||
	.get_sb = cgroup_get_sb,
 | 
						.mount = cgroup_mount,
 | 
				
			||||||
	.kill_sb = cgroup_kill_sb,
 | 
						.kill_sb = cgroup_kill_sb,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -231,18 +231,17 @@ static DEFINE_SPINLOCK(cpuset_buffer_lock);
 | 
				
			||||||
 * users. If someone tries to mount the "cpuset" filesystem, we
 | 
					 * users. If someone tries to mount the "cpuset" filesystem, we
 | 
				
			||||||
 * silently switch it to mount "cgroup" instead
 | 
					 * silently switch it to mount "cgroup" instead
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static int cpuset_get_sb(struct file_system_type *fs_type,
 | 
					static struct dentry *cpuset_mount(struct file_system_type *fs_type,
 | 
				
			||||||
			 int flags, const char *unused_dev_name,
 | 
								 int flags, const char *unused_dev_name, void *data)
 | 
				
			||||||
			 void *data, struct vfsmount *mnt)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct file_system_type *cgroup_fs = get_fs_type("cgroup");
 | 
						struct file_system_type *cgroup_fs = get_fs_type("cgroup");
 | 
				
			||||||
	int ret = -ENODEV;
 | 
						struct dentry *ret = ERR_PTR(-ENODEV);
 | 
				
			||||||
	if (cgroup_fs) {
 | 
						if (cgroup_fs) {
 | 
				
			||||||
		char mountopts[] =
 | 
							char mountopts[] =
 | 
				
			||||||
			"cpuset,noprefix,"
 | 
								"cpuset,noprefix,"
 | 
				
			||||||
			"release_agent=/sbin/cpuset_release_agent";
 | 
								"release_agent=/sbin/cpuset_release_agent";
 | 
				
			||||||
		ret = cgroup_fs->get_sb(cgroup_fs, flags,
 | 
							ret = cgroup_fs->mount(cgroup_fs, flags,
 | 
				
			||||||
					   unused_dev_name, mountopts, mnt);
 | 
										   unused_dev_name, mountopts);
 | 
				
			||||||
		put_filesystem(cgroup_fs);
 | 
							put_filesystem(cgroup_fs);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					@ -250,7 +249,7 @@ static int cpuset_get_sb(struct file_system_type *fs_type,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct file_system_type cpuset_fs_type = {
 | 
					static struct file_system_type cpuset_fs_type = {
 | 
				
			||||||
	.name = "cpuset",
 | 
						.name = "cpuset",
 | 
				
			||||||
	.get_sb = cpuset_get_sb,
 | 
						.mount = cpuset_mount,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue