#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/cgroup.h>
#include <linux/rcupdate.h>
#include <linux/atomic.h>
#include <linux/sched/task.h>
#include <net/rtnetlink.h>
#include <net/pkt_cls.h>
#include <net/sock.h>
#include <net/netprio_cgroup.h>
#include <linux/fdtable.h>
#define NETPRIO_ID_MAX …
#define PRIOMAP_MIN_SZ …
static int extend_netdev_table(struct net_device *dev, u32 target_idx)
{ … }
static u32 netprio_prio(struct cgroup_subsys_state *css, struct net_device *dev)
{ … }
static int netprio_set_prio(struct cgroup_subsys_state *css,
struct net_device *dev, u32 prio)
{ … }
static struct cgroup_subsys_state *
cgrp_css_alloc(struct cgroup_subsys_state *parent_css)
{ … }
static int cgrp_css_online(struct cgroup_subsys_state *css)
{ … }
static void cgrp_css_free(struct cgroup_subsys_state *css)
{ … }
static u64 read_prioidx(struct cgroup_subsys_state *css, struct cftype *cft)
{ … }
static int read_priomap(struct seq_file *sf, void *v)
{ … }
static ssize_t write_priomap(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{ … }
static int update_netprio(const void *v, struct file *file, unsigned n)
{ … }
static void net_prio_attach(struct cgroup_taskset *tset)
{ … }
static struct cftype ss_files[] = …;
struct cgroup_subsys net_prio_cgrp_subsys = …;
static int netprio_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{ … }
static struct notifier_block netprio_device_notifier = …;
static int __init init_cgroup_netprio(void)
{ … }
subsys_initcall(init_cgroup_netprio);