Skip to content

Commit 01ccc3a

Browse files
committed
Merge tag 'for-linus-20190610' of git://git.kernel.dk/linux-block
Pull block cgroup symlink revert from Jens Axboe: "I talked to Tejun about this offline, and he's not a huge fan of the symlink. So let's revert this for now, and Paolo can do this properly for 5.3 instead" * tag 'for-linus-20190610' of git://git.kernel.dk/linux-block: cgroup/bfq: revert bfq.weight symlink change
2 parents 5e3b6b8 + cf89298 commit 01ccc3a

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed

block/bfq-cgroup.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,7 @@ struct blkcg_policy blkcg_policy_bfq = {
10461046
struct cftype bfq_blkcg_legacy_files[] = {
10471047
{
10481048
.name = "bfq.weight",
1049-
.link_name = "weight",
1050-
.flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SYMLINKED,
1049+
.flags = CFTYPE_NOT_ON_ROOT,
10511050
.seq_show = bfq_io_show_weight,
10521051
.write_u64 = bfq_io_set_weight_legacy,
10531052
},
@@ -1167,8 +1166,7 @@ struct cftype bfq_blkcg_legacy_files[] = {
11671166
struct cftype bfq_blkg_files[] = {
11681167
{
11691168
.name = "bfq.weight",
1170-
.link_name = "weight",
1171-
.flags = CFTYPE_NOT_ON_ROOT | CFTYPE_SYMLINKED,
1169+
.flags = CFTYPE_NOT_ON_ROOT,
11721170
.seq_show = bfq_io_show_weight,
11731171
.write = bfq_io_set_weight,
11741172
},

include/linux/cgroup-defs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ enum {
106106
CFTYPE_WORLD_WRITABLE = (1 << 4), /* (DON'T USE FOR NEW FILES) S_IWUGO */
107107
CFTYPE_DEBUG = (1 << 5), /* create when cgroup_debug */
108108

109-
CFTYPE_SYMLINKED = (1 << 6), /* pointed to by symlink too */
110-
111109
/* internal flags, do not use outside cgroup core proper */
112110
__CFTYPE_ONLY_ON_DFL = (1 << 16), /* only on default hierarchy */
113111
__CFTYPE_NOT_ON_DFL = (1 << 17), /* not on default hierarchy */
@@ -545,7 +543,6 @@ struct cftype {
545543
* end of cftype array.
546544
*/
547545
char name[MAX_CFTYPE_NAME];
548-
char link_name[MAX_CFTYPE_NAME];
549546
unsigned long private;
550547

551548
/*

kernel/cgroup/cgroup.c

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,8 +1460,8 @@ struct cgroup *task_cgroup_from_root(struct task_struct *task,
14601460

14611461
static struct kernfs_syscall_ops cgroup_kf_syscall_ops;
14621462

1463-
static char *cgroup_fill_name(struct cgroup *cgrp, const struct cftype *cft,
1464-
char *buf, bool write_link_name)
1463+
static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
1464+
char *buf)
14651465
{
14661466
struct cgroup_subsys *ss = cft->ss;
14671467

@@ -1471,26 +1471,13 @@ static char *cgroup_fill_name(struct cgroup *cgrp, const struct cftype *cft,
14711471

14721472
snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s",
14731473
dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
1474-
write_link_name ? cft->link_name : cft->name);
1474+
cft->name);
14751475
} else {
1476-
strscpy(buf, write_link_name ? cft->link_name : cft->name,
1477-
CGROUP_FILE_NAME_MAX);
1476+
strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
14781477
}
14791478
return buf;
14801479
}
14811480

1482-
static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
1483-
char *buf)
1484-
{
1485-
return cgroup_fill_name(cgrp, cft, buf, false);
1486-
}
1487-
1488-
static char *cgroup_link_name(struct cgroup *cgrp, const struct cftype *cft,
1489-
char *buf)
1490-
{
1491-
return cgroup_fill_name(cgrp, cft, buf, true);
1492-
}
1493-
14941481
/**
14951482
* cgroup_file_mode - deduce file mode of a control file
14961483
* @cft: the control file in question
@@ -1649,9 +1636,6 @@ static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
16491636
}
16501637

16511638
kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name));
1652-
if (cft->flags & CFTYPE_SYMLINKED)
1653-
kernfs_remove_by_name(cgrp->kn,
1654-
cgroup_link_name(cgrp, cft, name));
16551639
}
16561640

16571641
/**
@@ -3837,7 +3821,6 @@ static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp,
38373821
{
38383822
char name[CGROUP_FILE_NAME_MAX];
38393823
struct kernfs_node *kn;
3840-
struct kernfs_node *kn_link;
38413824
struct lock_class_key *key = NULL;
38423825
int ret;
38433826

@@ -3868,14 +3851,6 @@ static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp,
38683851
spin_unlock_irq(&cgroup_file_kn_lock);
38693852
}
38703853

3871-
if (cft->flags & CFTYPE_SYMLINKED) {
3872-
kn_link = kernfs_create_link(cgrp->kn,
3873-
cgroup_link_name(cgrp, cft, name),
3874-
kn);
3875-
if (IS_ERR(kn_link))
3876-
return PTR_ERR(kn_link);
3877-
}
3878-
38793854
return 0;
38803855
}
38813856

0 commit comments

Comments
 (0)