1 From b7f71899fbdba1cac6773a62ed4ea841b7eda6b0 Mon Sep 17 00:00:00 2001
2 From: Jens Axboe <axboe@kernel.dk>
3 Date: Mon, 10 Jun 2019 03:35:41 -0600
4 Subject: [PATCH] cgroup/bfq: revert bfq.weight symlink change
6 There's some discussion on how to do this the best, and Tejun prefers
7 that BFQ just create the file itself instead of having cgroups support
10 Hence revert commit 54b7b868e826 and 19e9da9e86c4 for 5.2, and this
11 can be done properly for 5.3.
13 Signed-off-by: Jens Axboe <axboe@kernel.dk>
14 (cherry picked from commit cf8929885de318c0bf73438c9e5dde59d6536f7c)
15 Signed-off-by: Li Yang <leoyang.li@nxp.com>
17 include/linux/cgroup-defs.h | 3 ---
18 kernel/cgroup/cgroup.c | 33 ++++-----------------------------
19 2 files changed, 4 insertions(+), 32 deletions(-)
21 --- a/include/linux/cgroup-defs.h
22 +++ b/include/linux/cgroup-defs.h
23 @@ -106,8 +106,6 @@ enum {
24 CFTYPE_WORLD_WRITABLE = (1 << 4), /* (DON'T USE FOR NEW FILES) S_IWUGO */
25 CFTYPE_DEBUG = (1 << 5), /* create when cgroup_debug */
27 - CFTYPE_SYMLINKED = (1 << 6), /* pointed to by symlink too */
29 /* internal flags, do not use outside cgroup core proper */
30 __CFTYPE_ONLY_ON_DFL = (1 << 16), /* only on default hierarchy */
31 __CFTYPE_NOT_ON_DFL = (1 << 17), /* not on default hierarchy */
32 @@ -546,7 +544,6 @@ struct cftype {
33 * end of cftype array.
35 char name[MAX_CFTYPE_NAME];
36 - char link_name[MAX_CFTYPE_NAME];
37 unsigned long private;
40 --- a/kernel/cgroup/cgroup.c
41 +++ b/kernel/cgroup/cgroup.c
42 @@ -1465,8 +1465,8 @@ struct cgroup *task_cgroup_from_root(str
44 static struct kernfs_syscall_ops cgroup_kf_syscall_ops;
46 -static char *cgroup_fill_name(struct cgroup *cgrp, const struct cftype *cft,
47 - char *buf, bool write_link_name)
48 +static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
51 struct cgroup_subsys *ss = cft->ss;
53 @@ -1476,26 +1476,13 @@ static char *cgroup_fill_name(struct cgr
55 snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s",
56 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
57 - write_link_name ? cft->link_name : cft->name);
60 - strscpy(buf, write_link_name ? cft->link_name : cft->name,
61 - CGROUP_FILE_NAME_MAX);
62 + strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
67 -static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
70 - return cgroup_fill_name(cgrp, cft, buf, false);
73 -static char *cgroup_link_name(struct cgroup *cgrp, const struct cftype *cft,
76 - return cgroup_fill_name(cgrp, cft, buf, true);
80 * cgroup_file_mode - deduce file mode of a control file
81 * @cft: the control file in question
82 @@ -1654,9 +1641,6 @@ static void cgroup_rm_file(struct cgroup
85 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name));
86 - if (cft->flags & CFTYPE_SYMLINKED)
87 - kernfs_remove_by_name(cgrp->kn,
88 - cgroup_link_name(cgrp, cft, name));
92 @@ -3889,7 +3873,6 @@ static int cgroup_add_file(struct cgroup
94 char name[CGROUP_FILE_NAME_MAX];
95 struct kernfs_node *kn;
96 - struct kernfs_node *kn_link;
97 struct lock_class_key *key = NULL;
100 @@ -3920,14 +3903,6 @@ static int cgroup_add_file(struct cgroup
101 spin_unlock_irq(&cgroup_file_kn_lock);
104 - if (cft->flags & CFTYPE_SYMLINKED) {
105 - kn_link = kernfs_create_link(cgrp->kn,
106 - cgroup_link_name(cgrp, cft, name),
108 - if (IS_ERR(kn_link))
109 - return PTR_ERR(kn_link);