From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 01/10] cgroup: move cgroup_clear_directory() call out of cgroup_populate_dir() Date: Fri, 16 Mar 2012 16:35:54 -0700 Message-ID: <1331940963-15756-2-git-send-email-tj@kernel.org> References: <1331940963-15756-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=EIxEy0zN0QrF14aU03uvrER35FURkch+YIaGvhaGlPE=; b=K+ddUT1qdjvMAi6ZvM4gWQZh4PURocURZOJp4F1U3j5r2w+ZdtvD4K7UF2r5A4CJXN rhNBFPNCSoW0cpZ8mfuEFwULBtp52XTBUqlyP8n1aVNTnl/s64ZUl88cp9P5WyEJngQ4 jsyVJ3nFFmWjq2WM1ULopHQzC2D5a4zkvX+fzoFKbLAmk+JtnZqumYqJeZMq/EcVRHns 60F5L9M49kl44MC3M/Sr9+vxWofwfRo8xIUatf+chlpuUNbf8jsJ3Ynt6aEetSBsxofD 8exWcfjMcOb+PLqkTPs2qqwL7GTi/O+oWHAH8I8VdxCl8BW/x5g4E6mALbKov+mwBkBp nZ1w== In-Reply-To: <1331940963-15756-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org, lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Tejun Heo , fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org cgroup_populate_dir() currently clears all files and then repopulate the directory; however, the clearing part is only useful when it's called from cgroup_remount(). Relocate the invocation to cgroup_remount(). This is to prepare for further cgroup file handling updates. Signed-off-by: Tejun Heo --- kernel/cgroup.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index deeab87..2e2f93b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1313,7 +1313,8 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data) goto out_unlock; } - /* (re)populate subsystem files */ + /* clear out any existing files and repopulate subsystem files */ + cgroup_clear_directory(cgrp->dentry); cgroup_populate_dir(cgrp); if (opts.release_agent) @@ -3648,9 +3649,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp) int err; struct cgroup_subsys *ss; - /* First clear out any existing files */ - cgroup_clear_directory(cgrp->dentry); - err = cgroup_add_files(cgrp, NULL, files, ARRAY_SIZE(files)); if (err < 0) return err; -- 1.7.7.3