mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
cgroup: move namespace code to kernel/cgroup/namespace.c
get/put_css_set() get exposed in cgroup-internal.h in the process. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Acked-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
parent
d62beb7f3d
commit
dcfe149b9f
4 changed files with 189 additions and 175 deletions
|
@ -65,6 +65,33 @@ static inline bool notify_on_release(const struct cgroup *cgrp)
|
|||
return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
|
||||
}
|
||||
|
||||
void put_css_set_locked(struct css_set *cset);
|
||||
|
||||
static inline void put_css_set(struct css_set *cset)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* Ensure that the refcount doesn't hit zero while any readers
|
||||
* can see it. Similar to atomic_dec_and_lock(), but for an
|
||||
* rwlock
|
||||
*/
|
||||
if (atomic_add_unless(&cset->refcount, -1, 1))
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&css_set_lock, flags);
|
||||
put_css_set_locked(cset);
|
||||
spin_unlock_irqrestore(&css_set_lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* refcounted get/put for css_set objects
|
||||
*/
|
||||
static inline void get_css_set(struct css_set *cset)
|
||||
{
|
||||
atomic_inc(&cset->refcount);
|
||||
}
|
||||
|
||||
bool cgroup_ssid_enabled(int ssid);
|
||||
bool cgroup_on_dfl(const struct cgroup *cgrp);
|
||||
|
||||
|
@ -107,6 +134,11 @@ int cgroup_rmdir(struct kernfs_node *kn);
|
|||
int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node,
|
||||
struct kernfs_root *kf_root);
|
||||
|
||||
/*
|
||||
* namespace.c
|
||||
*/
|
||||
extern const struct proc_ns_operations cgroupns_operations;
|
||||
|
||||
/*
|
||||
* cgroup-v1.c
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue