summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-06-08 15:12:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-06-08 15:12:11 -0400
commit8d72e5bd86cb405d8d8b9e92905d8cfffd08dde8 (patch)
tree65d5e73b08d7a573784dca677e374fd6fc25a694 /kernel
parent1b02caa319cf73ae89aced8714066a3a5bbe648b (diff)
parent6c70f899b8089ae23cdb4aa63050e3df4e20c71e (diff)
Merge tag 'for-linus-20190608' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - Allow symlink from the bfq.weight cgroup parameter to the general weight (Angelo) - Damien is new skd maintainer (Bart) - NVMe pull request from Sagi, with a few small fixes. - Ensure we set DMA segment size properly, dma-debug is now tripping on these (Christoph) - Remove useless debugfs_create() return check (Greg) - Remove redundant unlikely() check on IS_ERR() (Kefeng) - Fixup request freeing on exit (Ming) * tag 'for-linus-20190608' of git://git.kernel.dk/linux-block: block, bfq: add weight symlink to the bfq.weight cgroup parameter cgroup: let a symlink too be created with a cftype file block: free sched's request pool in blk_cleanup_queue nvme-rdma: use dynamic dma mapping per command nvme: Fix u32 overflow in the number of namespace list calculation mmc: also set max_segment_size in the device mtip32xx: also set max_segment_size in the device rsxx: don't call dma_set_max_seg_size nvme-pci: don't limit DMA segement size block: Drop unlikely before IS_ERR(_OR_NULL) block: aoe: no need to check return value of debugfs_create functions nvmet: fix data_len to 0 for bdev-backed write_zeroes MAINTAINERS: Hand over skd maintainership nvme-tcp: fix queue mapping when queue count is limited nvme-rdma: fix queue mapping when queue count is limited
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup/cgroup.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 426a0026225c..155048b0eca2 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1460,8 +1460,8 @@ struct cgroup *task_cgroup_from_root(struct task_struct *task,
1460 1460
1461static struct kernfs_syscall_ops cgroup_kf_syscall_ops; 1461static struct kernfs_syscall_ops cgroup_kf_syscall_ops;
1462 1462
1463static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, 1463static char *cgroup_fill_name(struct cgroup *cgrp, const struct cftype *cft,
1464 char *buf) 1464 char *buf, bool write_link_name)
1465{ 1465{
1466 struct cgroup_subsys *ss = cft->ss; 1466 struct cgroup_subsys *ss = cft->ss;
1467 1467
@@ -1471,13 +1471,26 @@ static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
1471 1471
1472 snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s", 1472 snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s",
1473 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name, 1473 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
1474 cft->name); 1474 write_link_name ? cft->link_name : cft->name);
1475 } else { 1475 } else {
1476 strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX); 1476 strscpy(buf, write_link_name ? cft->link_name : cft->name,
1477 CGROUP_FILE_NAME_MAX);
1477 } 1478 }
1478 return buf; 1479 return buf;
1479} 1480}
1480 1481
1482static 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
1488static 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
1481/** 1494/**
1482 * cgroup_file_mode - deduce file mode of a control file 1495 * cgroup_file_mode - deduce file mode of a control file
1483 * @cft: the control file in question 1496 * @cft: the control file in question
@@ -1636,6 +1649,9 @@ static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
1636 } 1649 }
1637 1650
1638 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); 1651 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));
1639} 1655}
1640 1656
1641/** 1657/**
@@ -3821,6 +3837,7 @@ static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp,
3821{ 3837{
3822 char name[CGROUP_FILE_NAME_MAX]; 3838 char name[CGROUP_FILE_NAME_MAX];
3823 struct kernfs_node *kn; 3839 struct kernfs_node *kn;
3840 struct kernfs_node *kn_link;
3824 struct lock_class_key *key = NULL; 3841 struct lock_class_key *key = NULL;
3825 int ret; 3842 int ret;
3826 3843
@@ -3851,6 +3868,14 @@ static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp,
3851 spin_unlock_irq(&cgroup_file_kn_lock); 3868 spin_unlock_irq(&cgroup_file_kn_lock);
3852 } 3869 }
3853 3870
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
3854 return 0; 3879 return 0;
3855} 3880}
3856 3881