summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-10-25 22:37:43 +0300
committerArnd Bergmann <arnd@arndb.de>2019-11-15 16:38:30 +0300
commitddbc7d0657e9fd38b69f16bd0310703367b52d29 (patch)
tree1ae9f7245c8c9209c6b39c63697bd2cddd3d02b0 /kernel/time
parent4c22ea2b91203564fdf392b3d3cae249b652a8ae (diff)
downloadlinux-ddbc7d0657e9fd38b69f16bd0310703367b52d29.tar.xz
y2038: move itimer reset into itimer.c
Preparing for a change to the itimer internals, stop using the do_setitimer() symbol and instead use a new higher-level interface. The do_getitimer()/do_setitimer functions can now be made static, allowing the compiler to potentially produce better object code. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/itimer.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 4664c6addf69..ce9cd19ce72e 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -73,7 +73,7 @@ static void get_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
value->it_interval = ns_to_timeval(interval);
}
-int do_getitimer(int which, struct itimerval *value)
+static int do_getitimer(int which, struct itimerval *value)
{
struct task_struct *tsk = current;
@@ -197,7 +197,7 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
#define timeval_valid(t) \
(((t)->tv_sec >= 0) && (((unsigned long) (t)->tv_usec) < USEC_PER_SEC))
-int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
+static int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
{
struct task_struct *tsk = current;
struct hrtimer *timer;
@@ -249,6 +249,17 @@ again:
return 0;
}
+#ifdef CONFIG_SECURITY_SELINUX
+void clear_itimer(void)
+{
+ struct itimerval v = {};
+ int i;
+
+ for (i = 0; i < 3; i++)
+ do_setitimer(i, &v, NULL);
+}
+#endif
+
#ifdef __ARCH_WANT_SYS_ALARM
/**