Skip to content

Commit d62beb7

Browse files
committed
cgroup: rename functions for consistency
Now that v1 functions are separated out, rename some functions for consistency. cgroup_dfl_base_files -> cgroup_base_files cgroup_legacy_base_files -> cgroup1_base_files cgroup_ssid_no_v1() -> cgroup1_ssid_disabled() cgroup_pidlist_destroy_all -> cgroup1_pidlist_destroy_all() cgroup_release_agent() -> cgroup1_release_agent() check_for_release() -> cgroup1_check_for_release() Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Acked-by: Zefan Li <lizefan@huawei.com>
1 parent 1592c9b commit d62beb7

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

‎kernel/cgroup/cgroup-internal.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ int cgroup_show_path(struct seq_file *sf, struct kernfs_node *kf_node,
110110
/*
111111
* cgroup-v1.c
112112
*/
113-
extern struct cftype cgroup_legacy_base_files[];
113+
extern struct cftype cgroup1_base_files[];
114114
extern const struct file_operations proc_cgroupstats_operations;
115115
extern struct kernfs_syscall_ops cgroup1_kf_syscall_ops;
116116

117-
bool cgroup_ssid_no_v1(int ssid);
118-
void cgroup_pidlist_destroy_all(struct cgroup *cgrp);
119-
void cgroup_release_agent(struct work_struct *work);
120-
void check_for_release(struct cgroup *cgrp);
117+
bool cgroup1_ssid_disabled(int ssid);
118+
void cgroup1_pidlist_destroy_all(struct cgroup *cgrp);
119+
void cgroup1_release_agent(struct work_struct *work);
120+
void cgroup1_check_for_release(struct cgroup *cgrp);
121121
struct dentry *cgroup1_mount(struct file_system_type *fs_type, int flags,
122122
void *data, unsigned long magic,
123123
struct cgroup_namespace *ns);

‎kernel/cgroup/cgroup-v1.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static struct workqueue_struct *cgroup_pidlist_destroy_wq;
3636
*/
3737
static DEFINE_SPINLOCK(release_agent_path_lock);
3838

39-
bool cgroup_ssid_no_v1(int ssid)
39+
bool cgroup1_ssid_disabled(int ssid)
4040
{
4141
return cgroup_no_v1_mask & (1 << ssid);
4242
}
@@ -201,7 +201,7 @@ static void pidlist_free(void *p)
201201
* Used to destroy all pidlists lingering waiting for destroy timer. None
202202
* should be left afterwards.
203203
*/
204-
void cgroup_pidlist_destroy_all(struct cgroup *cgrp)
204+
void cgroup1_pidlist_destroy_all(struct cgroup *cgrp)
205205
{
206206
struct cgroup_pidlist *l, *tmp_l;
207207

@@ -585,7 +585,7 @@ static int cgroup_clone_children_write(struct cgroup_subsys_state *css,
585585
}
586586

587587
/* cgroup core interface files for the legacy hierarchies */
588-
struct cftype cgroup_legacy_base_files[] = {
588+
struct cftype cgroup1_base_files[] = {
589589
{
590590
.name = "cgroup.procs",
591591
.seq_start = cgroup_pidlist_start,
@@ -729,7 +729,7 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
729729
return 0;
730730
}
731731

732-
void check_for_release(struct cgroup *cgrp)
732+
void cgroup1_check_for_release(struct cgroup *cgrp)
733733
{
734734
if (notify_on_release(cgrp) && !cgroup_is_populated(cgrp) &&
735735
!css_has_online_children(&cgrp->self) && !cgroup_is_dead(cgrp))
@@ -759,7 +759,7 @@ void check_for_release(struct cgroup *cgrp)
759759
* this routine has no use for the exit status of the release agent
760760
* task, so no sense holding our caller up for that.
761761
*/
762-
void cgroup_release_agent(struct work_struct *work)
762+
void cgroup1_release_agent(struct work_struct *work)
763763
{
764764
struct cgroup *cgrp =
765765
container_of(work, struct cgroup, release_agent_work);
@@ -946,7 +946,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
946946
continue;
947947
if (!cgroup_ssid_enabled(i))
948948
continue;
949-
if (cgroup_ssid_no_v1(i))
949+
if (cgroup1_ssid_disabled(i))
950950
continue;
951951

952952
/* Mutually exclusive option 'all' + subsystem name */
@@ -968,7 +968,7 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
968968
*/
969969
if (all_ss || (!one_ss && !opts->none && !opts->name))
970970
for_each_subsys(ss, i)
971-
if (cgroup_ssid_enabled(i) && !cgroup_ssid_no_v1(i))
971+
if (cgroup_ssid_enabled(i) && !cgroup1_ssid_disabled(i))
972972
opts->subsys_mask |= (1 << i);
973973

974974
/*

‎kernel/cgroup/cgroup.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct cgroup_namespace init_cgroup_ns = {
199199
static u16 have_canfork_callback __read_mostly;
200200

201201
static struct file_system_type cgroup2_fs_type;
202-
static struct cftype cgroup_dfl_base_files[];
202+
static struct cftype cgroup_base_files[];
203203

204204
static int cgroup_apply_control(struct cgroup *cgrp);
205205
static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
@@ -609,7 +609,7 @@ static void cgroup_update_populated(struct cgroup *cgrp, bool populated)
609609
if (!trigger)
610610
break;
611611

612-
check_for_release(cgrp);
612+
cgroup1_check_for_release(cgrp);
613613
cgroup_file_notify(&cgrp->events_file);
614614

615615
cgrp = cgroup_parent(cgrp);
@@ -1440,9 +1440,9 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
14401440

14411441
if (!css->ss) {
14421442
if (cgroup_on_dfl(cgrp))
1443-
cfts = cgroup_dfl_base_files;
1443+
cfts = cgroup_base_files;
14441444
else
1445-
cfts = cgroup_legacy_base_files;
1445+
cfts = cgroup1_base_files;
14461446

14471447
return cgroup_addrm_files(&cgrp->self, cgrp, cfts, true);
14481448
}
@@ -1645,7 +1645,7 @@ static void init_cgroup_housekeeping(struct cgroup *cgrp)
16451645
INIT_LIST_HEAD(&cgrp->e_csets[ssid]);
16461646

16471647
init_waitqueue_head(&cgrp->offline_waitq);
1648-
INIT_WORK(&cgrp->release_agent_work, cgroup_release_agent);
1648+
INIT_WORK(&cgrp->release_agent_work, cgroup1_release_agent);
16491649
}
16501650

16511651
void init_cgroup_root(struct cgroup_root *root, struct cgroup_sb_opts *opts)
@@ -3836,7 +3836,7 @@ static int cgroup_procs_show(struct seq_file *s, void *v)
38363836
}
38373837

38383838
/* cgroup core interface files for the default hierarchy */
3839-
static struct cftype cgroup_dfl_base_files[] = {
3839+
static struct cftype cgroup_base_files[] = {
38403840
{
38413841
.name = "cgroup.procs",
38423842
.file_offset = offsetof(struct cgroup, procs_file),
@@ -3909,7 +3909,7 @@ static void css_free_work_fn(struct work_struct *work)
39093909
} else {
39103910
/* cgroup free path */
39113911
atomic_dec(&cgrp->root->nr_cgrps);
3912-
cgroup_pidlist_destroy_all(cgrp);
3912+
cgroup1_pidlist_destroy_all(cgrp);
39133913
cancel_work_sync(&cgrp->release_agent_work);
39143914

39153915
if (cgroup_parent(cgrp)) {
@@ -4411,7 +4411,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
44114411
*/
44124412
kernfs_remove(cgrp->kn);
44134413

4414-
check_for_release(cgroup_parent(cgrp));
4414+
cgroup1_check_for_release(cgroup_parent(cgrp));
44154415

44164416
/* put the base reference */
44174417
percpu_ref_kill(&cgrp->self.refcnt);
@@ -4548,8 +4548,8 @@ int __init cgroup_init(void)
45484548

45494549
BUILD_BUG_ON(CGROUP_SUBSYS_COUNT > 16);
45504550
BUG_ON(percpu_init_rwsem(&cgroup_threadgroup_rwsem));
4551-
BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files));
4552-
BUG_ON(cgroup_init_cftypes(NULL, cgroup_legacy_base_files));
4551+
BUG_ON(cgroup_init_cftypes(NULL, cgroup_base_files));
4552+
BUG_ON(cgroup_init_cftypes(NULL, cgroup1_base_files));
45534553

45544554
/*
45554555
* The latency of the synchronize_sched() is too high for cgroups,
@@ -4599,7 +4599,7 @@ int __init cgroup_init(void)
45994599
continue;
46004600
}
46014601

4602-
if (cgroup_ssid_no_v1(ssid))
4602+
if (cgroup1_ssid_disabled(ssid))
46034603
printk(KERN_INFO "Disabling %s control group subsystem in v1 mounts\n",
46044604
ss->name);
46054605

0 commit comments

Comments
 (0)