linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cgroup: use cgroup_addrm_files in cgroup_clear_directory
@ 2012-11-30 16:21 Gao feng
  2012-11-30 16:21 ` [PATCH 2/2] cgroup: remove subsystem files when remounting cgroup Gao feng
  2012-11-30 19:47 ` [PATCH] cgroup: use cgroup_addrm_files() in cgroup_clear_directory() Tejun Heo
  0 siblings, 2 replies; 7+ messages in thread
From: Gao feng @ 2012-11-30 16:21 UTC (permalink / raw)
  To: cgroups; +Cc: tj, lizefan, linux-kernel, containers, Gao feng

cgroup_rm_file only remove the first file. after remount,
the cgroup subsystem will be unloaded with it's files left.

use cgroup_addrm_files to remove all files of subsystem.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 kernel/cgroup.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f24f724..e5233b7 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -970,6 +970,8 @@ static int cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
 	return -ENOENT;
 }
 
+static int cgroup_addrm_files(struct cgroup *cgrp, struct cgroup_subsys *subsys,
+			      struct cftype cfts[], bool is_add);
 /**
  * cgroup_clear_directory - selective removal of base and subsystem files
  * @dir: directory containing the files
@@ -987,7 +989,7 @@ static void cgroup_clear_directory(struct dentry *dir, bool base_files,
 		if (!test_bit(ss->subsys_id, &subsys_mask))
 			continue;
 		list_for_each_entry(set, &ss->cftsets, node)
-			cgroup_rm_file(cgrp, set->cfts);
+			cgroup_addrm_files(cgrp, NULL, set->cfts, false);
 	}
 	if (base_files) {
 		while (!list_empty(&cgrp->files))
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-03 16:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30 16:21 [PATCH 1/2] cgroup: use cgroup_addrm_files in cgroup_clear_directory Gao feng
2012-11-30 16:21 ` [PATCH 2/2] cgroup: remove subsystem files when remounting cgroup Gao feng
2012-11-30 19:27   ` Tejun Heo
2012-12-03  0:45     ` Gao feng
2012-12-03  1:28   ` [PATCH RESEND] " Gao feng
2012-12-03 16:34     ` Tejun Heo
2012-11-30 19:47 ` [PATCH] cgroup: use cgroup_addrm_files() in cgroup_clear_directory() Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).