Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322025
b: refs/heads/master
c: f796c20
h: refs/heads/master
i:
  322023: 9c6d5d1
v: v3
  • Loading branch information
John Fastabend authored and David S. Miller committed Aug 16, 2012
1 parent 2c0af15 commit 34b8eb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16c0b164bd24d44db137693a36b428ba28970c62
refs/heads/master: f796c20cf67aa54c9130d0dc41307c0025719b85
22 changes: 4 additions & 18 deletions trunk/net/core/netprio_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,6 @@ static int write_priomap(struct cgroup *cgrp, struct cftype *cft,
void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
{
struct task_struct *p;
char *tmp = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);

if (!tmp) {
pr_warn("Unable to attach cgrp due to alloc failure!\n");
return;
}

cgroup_taskset_for_each(p, cgrp, tset) {
unsigned int fd;
Expand All @@ -296,32 +290,24 @@ void net_prio_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
continue;
}

rcu_read_lock();
spin_lock(&files->file_lock);
fdt = files_fdtable(files);
for (fd = 0; fd < fdt->max_fds; fd++) {
char *path;
struct file *file;
struct socket *sock;
unsigned long s;
int rv, err = 0;
int err;

file = fcheck_files(files, fd);
if (!file)
continue;

path = d_path(&file->f_path, tmp, PAGE_SIZE);
rv = sscanf(path, "socket:[%lu]", &s);
if (rv <= 0)
continue;

sock = sock_from_file(file, &err);
if (!err)
if (sock)
sock_update_netprioidx(sock->sk, p);
}
rcu_read_unlock();
spin_unlock(&files->file_lock);
task_unlock(p);
}
kfree(tmp);
}

static struct cftype ss_files[] = {
Expand Down

0 comments on commit 34b8eb6

Please sign in to comment.