Blame view
include/net/cls_cgroup.h
1.27 KB
f84517253 cls_cgroup: Store... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
/* * cls_cgroup.h Control Group Classifier * * Authors: Thomas Graf <tgraf@suug.ch> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * */ #ifndef _NET_CLS_CGROUP_H #define _NET_CLS_CGROUP_H #include <linux/cgroup.h> #include <linux/hardirq.h> #include <linux/rcupdate.h> |
fe1217c4f net: net_cls: mov... |
19 |
#include <net/sock.h> |
f84517253 cls_cgroup: Store... |
20 |
|
fe1217c4f net: net_cls: mov... |
21 22 |
#ifdef CONFIG_CGROUP_NET_CLASSID struct cgroup_cls_state { |
f84517253 cls_cgroup: Store... |
23 24 25 |
struct cgroup_subsys_state css; u32 classid; }; |
fe1217c4f net: net_cls: mov... |
26 |
struct cgroup_cls_state *task_cls_state(struct task_struct *p); |
f34198077 cgroup: net_cls: ... |
27 |
|
f84517253 cls_cgroup: Store... |
28 29 |
static inline u32 task_cls_classid(struct task_struct *p) { |
920750ce3 cgroup: net_cls: ... |
30 |
u32 classid; |
3fb5a9919 cls_cgroup: Fix r... |
31 |
|
f84517253 cls_cgroup: Store... |
32 33 |
if (in_interrupt()) return 0; |
3fb5a9919 cls_cgroup: Fix r... |
34 |
rcu_read_lock(); |
073219e99 cgroup: clean up ... |
35 |
classid = container_of(task_css(p, net_cls_cgrp_id), |
3fb5a9919 cls_cgroup: Fix r... |
36 37 38 39 |
struct cgroup_cls_state, css)->classid; rcu_read_unlock(); return classid; |
f84517253 cls_cgroup: Store... |
40 |
} |
f84517253 cls_cgroup: Store... |
41 |
|
211d2f97e cls_cgroup: remov... |
42 |
static inline void sock_update_classid(struct sock *sk) |
f34198077 cgroup: net_cls: ... |
43 |
{ |
fe1217c4f net: net_cls: mov... |
44 |
u32 classid; |
f34198077 cgroup: net_cls: ... |
45 |
|
fe1217c4f net: net_cls: mov... |
46 47 48 49 50 51 |
classid = task_cls_classid(current); if (classid != sk->sk_classid) sk->sk_classid = classid; } #else /* !CONFIG_CGROUP_NET_CLASSID */ static inline void sock_update_classid(struct sock *sk) |
f84517253 cls_cgroup: Store... |
52 |
{ |
f84517253 cls_cgroup: Store... |
53 |
} |
fe1217c4f net: net_cls: mov... |
54 |
#endif /* CONFIG_CGROUP_NET_CLASSID */ |
f84517253 cls_cgroup: Store... |
55 |
#endif /* _NET_CLS_CGROUP_H */ |