summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-04-07 09:29:51 -0700
committerTejun Heo <tj@kernel.org>2013-04-07 09:29:51 -0700
commitb9777cf8d7c7854c3c38bd6621d993b85c2afcdf (patch)
treed3f0275df187bb01a4262971f8fea6f4dbf7f26d /kernel/cgroup.c
parent7ae1bad99e27b8838d480a24edf4646a2fc547df (diff)
downloadlinux-b9777cf8d7c7854c3c38bd6621d993b85c2afcdf.tar.bz2
cgroup: unexport locking interface and cgroup_attach_task()
Now that all external cgroup_lock() users are gone, we can finally unexport the locking interface and prevent future abuse of cgroup_mutex. Make cgroup_[un]lock() and cgroup_lock_live_group() static. Also, cgroup_attach_task() doesn't have any user left and can't be used without locking interface anyway. Make it static too. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index ae7617095dec..32ca0304452f 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -336,7 +336,7 @@ static inline struct cftype *__d_cft(struct dentry *dentry)
* On success, returns true; the lock should be later released with
* cgroup_unlock(). On failure returns false with no lock held.
*/
-bool cgroup_lock_live_group(struct cgroup *cgrp)
+static bool cgroup_lock_live_group(struct cgroup *cgrp)
{
mutex_lock(&cgroup_mutex);
if (cgroup_is_removed(cgrp)) {
@@ -345,7 +345,6 @@ bool cgroup_lock_live_group(struct cgroup *cgrp)
}
return true;
}
-EXPORT_SYMBOL_GPL(cgroup_lock_live_group);
/* the list of cgroups eligible for automatic release. Protected by
* release_list_lock */
@@ -824,22 +823,20 @@ static struct cgroup *task_cgroup_from_root(struct task_struct *task,
* cgroup_lock - lock out any changes to cgroup structures
*
*/
-void cgroup_lock(void)
+static void cgroup_lock(void)
{
mutex_lock(&cgroup_mutex);
}
-EXPORT_SYMBOL_GPL(cgroup_lock);
/**
* cgroup_unlock - release lock on cgroup changes
*
* Undo the lock taken in a previous cgroup_lock() call.
*/
-void cgroup_unlock(void)
+static void cgroup_unlock(void)
{
mutex_unlock(&cgroup_mutex);
}
-EXPORT_SYMBOL_GPL(cgroup_unlock);
/*
* A couple of forward declarations required, due to cyclic reference loop: