I'd prefer this much more if it just passed the timout around as jiffies
(unconditionally), instead of converting them from one type of timespec to
another, and then converting that other timespec to jiffies, and having
multiple tests for NULL because of all that conversion confusion.
In other words, make the do_futex() prototype be
extern long do_futex(u32 *, int, int, unsigned long);
and let all the callers simply do something like
unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
if (utime) {
struct timespec ts;
if (copy_from_user(&ts, utime, sizeof(ts))
return -EFAULT;
timeout = timespec_to_jiffies(ts)+1;
}
do_futex(.. timeout);
instead. It's kind of silly to convert to kernel mode and carry around a
whole timespec, when the single actual _user_ doesn't even want one
anyway.
Hmm?
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/