aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 15:03:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 15:03:20 -0400
commit468fc7ed5537615efe671d94248446ac24679773 (patch)
tree27bc9de792e863d6ec1630927b77ac9e7dabb38a /kernel/cgroup.c
parent08fd8c17686c6b09fa410a26d516548dd80ff147 (diff)
parent36232012344b8db67052432742deaf17f82e70e6 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) Unified UDP encapsulation offload methods for drivers, from Alexander Duyck. 2) Make DSA binding more sane, from Andrew Lunn. 3) Support QCA9888 chips in ath10k, from Anilkumar Kolli. 4) Several workqueue usage cleanups, from Bhaktipriya Shridhar. 5) Add XDP (eXpress Data Path), essentially running BPF programs on RX packets as soon as the device sees them, with the option to mirror the packet on TX via the same interface. From Brenden Blanco and others. 6) Allow qdisc/class stats dumps to run lockless, from Eric Dumazet. 7) Add VLAN support to b53 and bcm_sf2, from Florian Fainelli. 8) Simplify netlink conntrack entry layout, from Florian Westphal. 9) Add ipv4 forwarding support to mlxsw spectrum driver, from Ido Schimmel, Yotam Gigi, and Jiri Pirko. 10) Add SKB array infrastructure and convert tun and macvtap over to it. From Michael S Tsirkin and Jason Wang. 11) Support qdisc packet injection in pktgen, from John Fastabend. 12) Add neighbour monitoring framework to TIPC, from Jon Paul Maloy. 13) Add NV congestion control support to TCP, from Lawrence Brakmo. 14) Add GSO support to SCTP, from Marcelo Ricardo Leitner. 15) Allow GRO and RPS to function on macsec devices, from Paolo Abeni. 16) Support MPLS over IPV4, from Simon Horman. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1622 commits) xgene: Fix build warning with ACPI disabled. be2net: perform temperature query in adapter regardless of its interface state l2tp: Correctly return -EBADF from pppol2tp_getname. net/mlx5_core/health: Remove deprecated create_singlethread_workqueue net: ipmr/ip6mr: update lastuse on entry change macsec: ensure rx_sa is set when validation is disabled tipc: dump monitor attributes tipc: add a function to get the bearer name tipc: get monitor threshold for the cluster tipc: make cluster size threshold for monitoring configurable tipc: introduce constants for tipc address validation net: neigh: disallow transition to NUD_STALE if lladdr is unchanged in neigh_update() MAINTAINERS: xgene: Add driver and documentation path Documentation: dtb: xgene: Add MDIO node dtb: xgene: Add MDIO node drivers: net: xgene: ethtool: Use phy_ethtool_gset and sset drivers: net: xgene: Use exported functions drivers: net: xgene: Enable MDIO driver drivers: net: xgene: Add backward compatibility drivers: net: phy: xgene: Add MDIO driver ...
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 33a2f63d4a10..9624db80dc4e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -61,6 +61,7 @@
61#include <linux/cpuset.h> 61#include <linux/cpuset.h>
62#include <linux/proc_ns.h> 62#include <linux/proc_ns.h>
63#include <linux/nsproxy.h> 63#include <linux/nsproxy.h>
64#include <linux/file.h>
64#include <net/sock.h> 65#include <net/sock.h>
65 66
66/* 67/*
@@ -6204,6 +6205,40 @@ struct cgroup *cgroup_get_from_path(const char *path)
6204} 6205}
6205EXPORT_SYMBOL_GPL(cgroup_get_from_path); 6206EXPORT_SYMBOL_GPL(cgroup_get_from_path);
6206 6207
6208/**
6209 * cgroup_get_from_fd - get a cgroup pointer from a fd
6210 * @fd: fd obtained by open(cgroup2_dir)
6211 *
6212 * Find the cgroup from a fd which should be obtained
6213 * by opening a cgroup directory. Returns a pointer to the
6214 * cgroup on success. ERR_PTR is returned if the cgroup
6215 * cannot be found.
6216 */
6217struct cgroup *cgroup_get_from_fd(int fd)
6218{
6219 struct cgroup_subsys_state *css;
6220 struct cgroup *cgrp;
6221 struct file *f;
6222
6223 f = fget_raw(fd);
6224 if (!f)
6225 return ERR_PTR(-EBADF);
6226
6227 css = css_tryget_online_from_dir(f->f_path.dentry, NULL);
6228 fput(f);
6229 if (IS_ERR(css))
6230 return ERR_CAST(css);
6231
6232 cgrp = css->cgroup;
6233 if (!cgroup_on_dfl(cgrp)) {
6234 cgroup_put(cgrp);
6235 return ERR_PTR(-EBADF);
6236 }
6237
6238 return cgrp;
6239}
6240EXPORT_SYMBOL_GPL(cgroup_get_from_fd);
6241
6207/* 6242/*
6208 * sock->sk_cgrp_data handling. For more info, see sock_cgroup_data 6243 * sock->sk_cgrp_data handling. For more info, see sock_cgroup_data
6209 * definition in cgroup-defs.h. 6244 * definition in cgroup-defs.h.