Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105894
b: refs/heads/master
c: 6379c10
h: refs/heads/master
v: v3
  • Loading branch information
Paul Menage authored and Linus Torvalds committed Jul 25, 2008
1 parent 79c358d commit 90d560c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: 84eea842886ac35020be6043e04748ed22014359
refs/heads/master: 6379c106152388f7ea45d6dda63edda0e9181fc8
21 changes: 13 additions & 8 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,13 +1474,6 @@ static ssize_t cgroup_common_file_write(struct cgroup *cgrp,
case FILE_TASKLIST:
retval = attach_task_by_pid(cgrp, buffer);
break;
case FILE_NOTIFY_ON_RELEASE:
clear_bit(CGRP_RELEASABLE, &cgrp->flags);
if (simple_strtoul(buffer, NULL, 10) != 0)
set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
else
clear_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
break;
default:
retval = -EINVAL;
goto out2;
Expand Down Expand Up @@ -2252,6 +2245,18 @@ static u64 cgroup_read_notify_on_release(struct cgroup *cgrp,
return notify_on_release(cgrp);
}

static int cgroup_write_notify_on_release(struct cgroup *cgrp,
struct cftype *cft,
u64 val)
{
clear_bit(CGRP_RELEASABLE, &cgrp->flags);
if (val)
set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
else
clear_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
return 0;
}

/*
* for the common functions, 'private' gives the type of file
*/
Expand All @@ -2268,7 +2273,7 @@ static struct cftype files[] = {
{
.name = "notify_on_release",
.read_u64 = cgroup_read_notify_on_release,
.write = cgroup_common_file_write,
.write_u64 = cgroup_write_notify_on_release,
.private = FILE_NOTIFY_ON_RELEASE,
},
};
Expand Down

0 comments on commit 90d560c

Please sign in to comment.