audit: complex interfield comparison helper
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / net / netprio_cgroup.h
blobe503b87c4c1b4d3310be150b07e4a94a36508133
1 /*
2 * netprio_cgroup.h Control Group Priority set
5 * Authors: Neil Horman <nhorman@tuxdriver.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
14 #ifndef _NETPRIO_CGROUP_H
15 #define _NETPRIO_CGROUP_H
16 #include <linux/module.h>
17 #include <linux/cgroup.h>
18 #include <linux/hardirq.h>
19 #include <linux/rcupdate.h>
22 struct netprio_map {
23 struct rcu_head rcu;
24 u32 priomap_len;
25 u32 priomap[];
28 #ifdef CONFIG_CGROUPS
30 struct cgroup_netprio_state {
31 struct cgroup_subsys_state css;
32 u32 prioidx;
35 #ifndef CONFIG_NETPRIO_CGROUP
36 extern int net_prio_subsys_id;
37 #endif
39 extern void sock_update_netprioidx(struct sock *sk);
41 static inline struct cgroup_netprio_state
42 *task_netprio_state(struct task_struct *p)
44 #if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
45 return container_of(task_subsys_state(p, net_prio_subsys_id),
46 struct cgroup_netprio_state, css);
47 #else
48 return NULL;
49 #endif
52 #else
54 #define sock_update_netprioidx(sk)
55 #endif
57 #endif /* _NET_CLS_CGROUP_H */