All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: lizefan@huawei.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/4] cgroup: remove CGRP_ROOT_OPTION_MASK
Date: Wed,  2 Jul 2014 19:45:44 -0400	[thread overview]
Message-ID: <1404344747-7957-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1404344747-7957-1-git-send-email-tj@kernel.org>

cgroup_root->flags only contains CGRP_ROOT_* flags and there's no
reason to mask the flags.  Remove CGRP_ROOT_OPTION_MASK.

This doesn't cause any behavior differences.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 include/linux/cgroup.h | 3 ---
 kernel/cgroup.c        | 7 +++----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8a111dd..7748e5b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -312,9 +312,6 @@ enum {
 
 	CGRP_ROOT_NOPREFIX	= (1 << 1), /* mounted subsystems have no named prefix */
 	CGRP_ROOT_XATTR		= (1 << 2), /* supports extended attributes */
-
-	/* mount options live below bit 16 */
-	CGRP_ROOT_OPTION_MASK	= (1 << 16) - 1,
 };
 
 /*
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7868fc3..e27f4d4 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1434,11 +1434,10 @@ static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data)
 	removed_mask = root->subsys_mask & ~opts.subsys_mask;
 
 	/* Don't allow flags or name to change at remount */
-	if (((opts.flags ^ root->flags) & CGRP_ROOT_OPTION_MASK) ||
+	if ((opts.flags ^ root->flags) ||
 	    (opts.name && strcmp(opts.name, root->name))) {
 		pr_err("option or name mismatch, new: 0x%x \"%s\", old: 0x%x \"%s\"\n",
-		       opts.flags & CGRP_ROOT_OPTION_MASK, opts.name ?: "",
-		       root->flags & CGRP_ROOT_OPTION_MASK, root->name);
+		       opts.flags, opts.name ?: "", root->flags, root->name);
 		ret = -EINVAL;
 		goto out_unlock;
 	}
@@ -1706,7 +1705,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
 			goto out_unlock;
 		}
 
-		if ((root->flags ^ opts.flags) & CGRP_ROOT_OPTION_MASK) {
+		if (root->flags ^ opts.flags) {
 			if ((root->flags | opts.flags) & CGRP_ROOT_SANE_BEHAVIOR) {
 				pr_err("sane_behavior: new mount options should match the existing superblock\n");
 				ret = -EINVAL;
-- 
1.9.3

  reply	other threads:[~2014-07-02 23:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 23:45 [PATCHSET cgroup/for-3.17] cgroup: remove sane_behavior support on non-default hierarchies Tejun Heo
2014-07-02 23:45 ` Tejun Heo
2014-07-02 23:45 ` Tejun Heo [this message]
2014-07-02 23:45 ` [PATCH 2/4] cgroup: make interface file "cgroup.sane_behavior" legacy-only Tejun Heo
2014-07-02 23:45 ` [PATCH 3/4] cgroup: remove sane_behavior support on non-default hierarchies Tejun Heo
2014-07-08 19:57   ` Vivek Goyal
2014-07-02 23:45 ` [PATCH 4/4] cgroup: clean up sane_behavior handling Tejun Heo
2014-07-09  7:25 ` [PATCHSET cgroup/for-3.17] cgroup: remove sane_behavior support on non-default hierarchies Li Zefan
2014-07-09  7:25   ` Li Zefan
     [not found] ` <1404344747-7957-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-07-09 14:08   ` Tejun Heo
2014-07-09 14:08     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404344747-7957-2-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.