aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 13:50:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 13:50:47 -0400
commitc0e8a139a5bb8add02b4111e9e1957d810d7285e (patch)
treef5f0695c7553c0f651ea3c714191dedf76e06c78 /net
parent033d9959ed2dc1029217d4165f80a71702dc578e (diff)
parenta6f00298b2ceaf50b4ab00e6ee3eb0206ac72fac (diff)
Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo: - xattr support added. The implementation is shared with tmpfs. The usage is restricted and intended to be used to manage per-cgroup metadata by system software. tmpfs changes are routed through this branch with Hugh's permission. - cgroup subsystem ID handling simplified. * 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Define CGROUP_SUBSYS_COUNT according the configuration cgroup: Assign subsystem IDs during compile time cgroup: Do not depend on a given order when populating the subsys array cgroup: Wrap subsystem selection macro cgroup: Remove CGROUP_BUILTIN_SUBSYS_COUNT cgroup: net_prio: Do not define task_netpioidx() when not selected cgroup: net_cls: Do not define task_cls_classid() when not selected cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h cgroup: trivial fixes for Documentation/cgroups/cgroups.txt xattr: mark variable as uninitialized to make both gcc and smatch happy fs: add missing documentation to simple_xattr functions cgroup: add documentation on extended attributes usage cgroup: rename subsys_bits to subsys_mask cgroup: add xattr support cgroup: revise how we re-populate root directory xattr: extract simple_xattr code from tmpfs
Diffstat (limited to 'net')
-rw-r--r--net/core/netprio_cgroup.c11
-rw-r--r--net/core/sock.c15
-rw-r--r--net/sched/cls_cgroup.c13
3 files changed, 4 insertions, 35 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index c75e3f9d060f..6bc460c38e4f 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -326,9 +326,7 @@ struct cgroup_subsys net_prio_subsys = {
326 .create = cgrp_create, 326 .create = cgrp_create,
327 .destroy = cgrp_destroy, 327 .destroy = cgrp_destroy,
328 .attach = net_prio_attach, 328 .attach = net_prio_attach,
329#ifdef CONFIG_NETPRIO_CGROUP
330 .subsys_id = net_prio_subsys_id, 329 .subsys_id = net_prio_subsys_id,
331#endif
332 .base_cftypes = ss_files, 330 .base_cftypes = ss_files,
333 .module = THIS_MODULE 331 .module = THIS_MODULE
334}; 332};
@@ -366,10 +364,6 @@ static int __init init_cgroup_netprio(void)
366 ret = cgroup_load_subsys(&net_prio_subsys); 364 ret = cgroup_load_subsys(&net_prio_subsys);
367 if (ret) 365 if (ret)
368 goto out; 366 goto out;
369#ifndef CONFIG_NETPRIO_CGROUP
370 smp_wmb();
371 net_prio_subsys_id = net_prio_subsys.subsys_id;
372#endif
373 367
374 register_netdevice_notifier(&netprio_device_notifier); 368 register_netdevice_notifier(&netprio_device_notifier);
375 369
@@ -386,11 +380,6 @@ static void __exit exit_cgroup_netprio(void)
386 380
387 cgroup_unload_subsys(&net_prio_subsys); 381 cgroup_unload_subsys(&net_prio_subsys);
388 382
389#ifndef CONFIG_NETPRIO_CGROUP
390 net_prio_subsys_id = -1;
391 synchronize_rcu();
392#endif
393
394 rtnl_lock(); 383 rtnl_lock();
395 for_each_netdev(&init_net, dev) { 384 for_each_netdev(&init_net, dev) {
396 old = rtnl_dereference(dev->priomap); 385 old = rtnl_dereference(dev->priomap);
diff --git a/net/core/sock.c b/net/core/sock.c
index a6000fbad294..341fa1c3bd69 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -326,17 +326,6 @@ int __sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
326} 326}
327EXPORT_SYMBOL(__sk_backlog_rcv); 327EXPORT_SYMBOL(__sk_backlog_rcv);
328 328
329#if defined(CONFIG_CGROUPS)
330#if !defined(CONFIG_NET_CLS_CGROUP)
331int net_cls_subsys_id = -1;
332EXPORT_SYMBOL_GPL(net_cls_subsys_id);
333#endif
334#if !defined(CONFIG_NETPRIO_CGROUP)
335int net_prio_subsys_id = -1;
336EXPORT_SYMBOL_GPL(net_prio_subsys_id);
337#endif
338#endif
339
340static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen) 329static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
341{ 330{
342 struct timeval tv; 331 struct timeval tv;
@@ -1224,6 +1213,7 @@ static void sk_prot_free(struct proto *prot, struct sock *sk)
1224} 1213}
1225 1214
1226#ifdef CONFIG_CGROUPS 1215#ifdef CONFIG_CGROUPS
1216#if IS_ENABLED(CONFIG_NET_CLS_CGROUP)
1227void sock_update_classid(struct sock *sk) 1217void sock_update_classid(struct sock *sk)
1228{ 1218{
1229 u32 classid; 1219 u32 classid;
@@ -1235,7 +1225,9 @@ void sock_update_classid(struct sock *sk)
1235 sk->sk_classid = classid; 1225 sk->sk_classid = classid;
1236} 1226}
1237EXPORT_SYMBOL(sock_update_classid); 1227EXPORT_SYMBOL(sock_update_classid);
1228#endif
1238 1229
1230#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
1239void sock_update_netprioidx(struct sock *sk, struct task_struct *task) 1231void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
1240{ 1232{
1241 if (in_interrupt()) 1233 if (in_interrupt())
@@ -1245,6 +1237,7 @@ void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
1245} 1237}
1246EXPORT_SYMBOL_GPL(sock_update_netprioidx); 1238EXPORT_SYMBOL_GPL(sock_update_netprioidx);
1247#endif 1239#endif
1240#endif
1248 1241
1249/** 1242/**
1250 * sk_alloc - All socket objects are allocated here 1243 * sk_alloc - All socket objects are allocated here
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 7743ea8d1d38..67cf90d962f4 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -77,9 +77,7 @@ struct cgroup_subsys net_cls_subsys = {
77 .name = "net_cls", 77 .name = "net_cls",
78 .create = cgrp_create, 78 .create = cgrp_create,
79 .destroy = cgrp_destroy, 79 .destroy = cgrp_destroy,
80#ifdef CONFIG_NET_CLS_CGROUP
81 .subsys_id = net_cls_subsys_id, 80 .subsys_id = net_cls_subsys_id,
82#endif
83 .base_cftypes = ss_files, 81 .base_cftypes = ss_files,
84 .module = THIS_MODULE, 82 .module = THIS_MODULE,
85}; 83};
@@ -283,12 +281,6 @@ static int __init init_cgroup_cls(void)
283 if (ret) 281 if (ret)
284 goto out; 282 goto out;
285 283
286#ifndef CONFIG_NET_CLS_CGROUP
287 /* We can't use rcu_assign_pointer because this is an int. */
288 smp_wmb();
289 net_cls_subsys_id = net_cls_subsys.subsys_id;
290#endif
291
292 ret = register_tcf_proto_ops(&cls_cgroup_ops); 284 ret = register_tcf_proto_ops(&cls_cgroup_ops);
293 if (ret) 285 if (ret)
294 cgroup_unload_subsys(&net_cls_subsys); 286 cgroup_unload_subsys(&net_cls_subsys);
@@ -301,11 +293,6 @@ static void __exit exit_cgroup_cls(void)
301{ 293{
302 unregister_tcf_proto_ops(&cls_cgroup_ops); 294 unregister_tcf_proto_ops(&cls_cgroup_ops);
303 295
304#ifndef CONFIG_NET_CLS_CGROUP
305 net_cls_subsys_id = -1;
306 synchronize_rcu();
307#endif
308
309 cgroup_unload_subsys(&net_cls_subsys); 296 cgroup_unload_subsys(&net_cls_subsys);
310} 297}
311 298