aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/cgroup.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index a14122ecaa5e..d597d3015786 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1474,13 +1474,6 @@ static ssize_t cgroup_common_file_write(struct cgroup *cgrp,
1474 case FILE_TASKLIST: 1474 case FILE_TASKLIST:
1475 retval = attach_task_by_pid(cgrp, buffer); 1475 retval = attach_task_by_pid(cgrp, buffer);
1476 break; 1476 break;
1477 case FILE_NOTIFY_ON_RELEASE:
1478 clear_bit(CGRP_RELEASABLE, &cgrp->flags);
1479 if (simple_strtoul(buffer, NULL, 10) != 0)
1480 set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
1481 else
1482 clear_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
1483 break;
1484 default: 1477 default:
1485 retval = -EINVAL; 1478 retval = -EINVAL;
1486 goto out2; 1479 goto out2;
@@ -2252,6 +2245,18 @@ static u64 cgroup_read_notify_on_release(struct cgroup *cgrp,
2252 return notify_on_release(cgrp); 2245 return notify_on_release(cgrp);
2253} 2246}
2254 2247
2248static int cgroup_write_notify_on_release(struct cgroup *cgrp,
2249 struct cftype *cft,
2250 u64 val)
2251{
2252 clear_bit(CGRP_RELEASABLE, &cgrp->flags);
2253 if (val)
2254 set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
2255 else
2256 clear_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
2257 return 0;
2258}
2259
2255/* 2260/*
2256 * for the common functions, 'private' gives the type of file 2261 * for the common functions, 'private' gives the type of file
2257 */ 2262 */
@@ -2268,7 +2273,7 @@ static struct cftype files[] = {
2268 { 2273 {
2269 .name = "notify_on_release", 2274 .name = "notify_on_release",
2270 .read_u64 = cgroup_read_notify_on_release, 2275 .read_u64 = cgroup_read_notify_on_release,
2271 .write = cgroup_common_file_write, 2276 .write_u64 = cgroup_write_notify_on_release,
2272 .private = FILE_NOTIFY_ON_RELEASE, 2277 .private = FILE_NOTIFY_ON_RELEASE,
2273 }, 2278 },
2274}; 2279};