diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2012-07-17 15:37:27 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-17 15:37:27 -0400 |
commit | d9914cf66181b8aa0929775f5c6f675c6ebc3eb5 (patch) | |
tree | 60665bc18212e1bf4dd45d811c49f561234ddbd4 | |
parent | 84a1caf1453c3d44050bd22db958af4a7f99315c (diff) |
PM: Rename CAP_EPOLLWAKEUP to CAP_BLOCK_SUSPEND
As discussed in
http://thread.gmane.org/gmane.linux.kernel/1249726/focus=1288990,
the capability introduced in 4d7e30d98939a0340022ccd49325a3d70f7e0238
to govern EPOLLWAKEUP seems misnamed: this capability is about governing
the ability to suspend the system, not using a particular API flag
(EPOLLWAKEUP). We should make the name of the capability more general
to encourage reuse in related cases. (Whether or not this capability
should also be used to govern the use of /sys/power/wake_lock is a
question that needs to be separately resolved.)
This patch renames the capability to CAP_BLOCK_SUSPEND. In order to ensure
that the old capability name doesn't make it out into the wild, could you
please apply and push up the tree to ensure that it is incorporated
for the 3.5 release.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | fs/eventpoll.c | 2 | ||||
-rw-r--r-- | include/linux/capability.h | 6 | ||||
-rw-r--r-- | include/linux/eventpoll.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 74598f67efeb..1c8b55670804 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1710,7 +1710,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
1710 | goto error_tgt_fput; | 1710 | goto error_tgt_fput; |
1711 | 1711 | ||
1712 | /* Check if EPOLLWAKEUP is allowed */ | 1712 | /* Check if EPOLLWAKEUP is allowed */ |
1713 | if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP)) | 1713 | if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) |
1714 | epds.events &= ~EPOLLWAKEUP; | 1714 | epds.events &= ~EPOLLWAKEUP; |
1715 | 1715 | ||
1716 | /* | 1716 | /* |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 68d56effc328..d10b7ed595b1 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -360,11 +360,11 @@ struct cpu_vfs_cap_data { | |||
360 | 360 | ||
361 | #define CAP_WAKE_ALARM 35 | 361 | #define CAP_WAKE_ALARM 35 |
362 | 362 | ||
363 | /* Allow preventing system suspends while epoll events are pending */ | 363 | /* Allow preventing system suspends */ |
364 | 364 | ||
365 | #define CAP_EPOLLWAKEUP 36 | 365 | #define CAP_BLOCK_SUSPEND 36 |
366 | 366 | ||
367 | #define CAP_LAST_CAP CAP_EPOLLWAKEUP | 367 | #define CAP_LAST_CAP CAP_BLOCK_SUSPEND |
368 | 368 | ||
369 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | 369 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) |
370 | 370 | ||
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 6f8be328770a..f4bb378ccf6a 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -34,7 +34,7 @@ | |||
34 | * re-allowed until epoll_wait is called again after consuming the wakeup | 34 | * re-allowed until epoll_wait is called again after consuming the wakeup |
35 | * event(s). | 35 | * event(s). |
36 | * | 36 | * |
37 | * Requires CAP_EPOLLWAKEUP | 37 | * Requires CAP_BLOCK_SUSPEND |
38 | */ | 38 | */ |
39 | #define EPOLLWAKEUP (1 << 29) | 39 | #define EPOLLWAKEUP (1 << 29) |
40 | 40 | ||