projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into for-4.4-fixes
[firefly-linux-kernel-4.4.55.git]
/
net
/
core
/
netclassid_cgroup.c
diff --git
a/net/core/netclassid_cgroup.c
b/net/core/netclassid_cgroup.c
index 6441f47b1a8ffc78731896fd4ab1b12db43f0992..d9ee8d08a3a6944ebb6e5d8dafe6fb5032aa7a52 100644
(file)
--- a/
net/core/netclassid_cgroup.c
+++ b/
net/core/netclassid_cgroup.c
@@
-56,7
+56,7
@@
static void cgrp_css_free(struct cgroup_subsys_state *css)
kfree(css_cls_state(css));
}
kfree(css_cls_state(css));
}
-static int update_classid(const void *v, struct file *file, unsigned n)
+static int update_classid
_sock
(const void *v, struct file *file, unsigned n)
{
int err;
struct socket *sock = sock_from_file(file, &err);
{
int err;
struct socket *sock = sock_from_file(file, &err);
@@
-67,18
+67,27
@@
static int update_classid(const void *v, struct file *file, unsigned n)
return 0;
}
return 0;
}
-static void cgrp_attach(struct cgroup_subsys_state *css,
- struct cgroup_taskset *tset)
+static void update_classid(struct cgroup_subsys_state *css, void *v)
{
{
- struct cgroup_cls_state *cs = css_cls_state(css);
- void *v = (void *)(unsigned long)cs->classid;
+ struct css_task_iter it;
struct task_struct *p;
struct task_struct *p;
- cgroup_taskset_for_each(p, tset) {
+ css_task_iter_start(css, &it);
+ while ((p = css_task_iter_next(&it))) {
task_lock(p);
task_lock(p);
- iterate_fd(p->files, 0, update_classid, v);
+ iterate_fd(p->files, 0, update_classid
_sock
, v);
task_unlock(p);
}
task_unlock(p);
}
+ css_task_iter_end(&it);
+}
+
+static void cgrp_attach(struct cgroup_taskset *tset)
+{
+ struct cgroup_subsys_state *css;
+
+ cgroup_taskset_first(tset, &css);
+ update_classid(css,
+ (void *)(unsigned long)css_cls_state(css)->classid);
}
static u64 read_classid(struct cgroup_subsys_state *css, struct cftype *cft)
}
static u64 read_classid(struct cgroup_subsys_state *css, struct cftype *cft)
@@
-89,8
+98,11
@@
static u64 read_classid(struct cgroup_subsys_state *css, struct cftype *cft)
static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft,
u64 value)
{
static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft,
u64 value)
{
- css_cls_state(css)->classid = (u32) value;
+ struct cgroup_cls_state *cs = css_cls_state(css);
+
+ cs->classid = (u32)value;
+ update_classid(css, (void *)(unsigned long)cs->classid);
return 0;
}
return 0;
}