Re: [PATCH] back out CPU clock additions to posix-timers

From: Christoph Lameter
Date: Sun Dec 19 2004 - 22:47:16 EST


Here is a patch that simply removes support for negative clockids from
2.6.10-rc. The support for positive clock_id should stay the same in
future kernels and follow straighforwardly the posix API without special
encodigns for CLOCK_*_CPUTIME_ID. Roland's patches would implement
negative clockid's to access process clocks but keep the existing
interface for positive clock_ids.

Index: linux-2.6.9/kernel/posix-timers.c
===================================================================
--- linux-2.6.9.orig/kernel/posix-timers.c 2004-12-17 14:40:16.000000000 -0800
+++ linux-2.6.9/kernel/posix-timers.c 2004-12-19 19:35:43.000000000 -0800
@@ -1307,28 +1307,8 @@

static int do_clock_gettime(clockid_t which_clock, struct timespec *tp)
{
- /* Process process specific clocks */
- if (which_clock < 0) {
- task_t *t;
- int pid = -which_clock;
-
- if (pid < PID_MAX_LIMIT) {
- if ((t = find_task_by_pid(pid))) {
- jiffies_to_timespec(process_ticks(t), tp);
- return 0;
- }
- return -EINVAL;
- }
- if (pid < 2*PID_MAX_LIMIT) {
- if ((t = find_task_by_pid(pid - PID_MAX_LIMIT))) {
- jiffies_to_timespec(thread_ticks(t), tp);
- return 0;
- }
- return -EINVAL;
- }
- /* More process specific clocks could follow here */
+ if (which_clock < 0)
return -EINVAL;
- }

if ((unsigned) which_clock >= MAX_CLOCKS ||
!posix_clocks[which_clock].res)
@@ -1356,8 +1336,8 @@
{
struct timespec rtn_tp;

- /* All process clocks have the resolution of CLOCK_PROCESS_CPUTIME_ID */
- if (which_clock < 0 ) which_clock = CLOCK_PROCESS_CPUTIME_ID;
+ if (which_clock < 0 )
+ return -EINVAL;

if ((unsigned) which_clock >= MAX_CLOCKS ||
!posix_clocks[which_clock].res)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/