On Wednesday 15 April 2015 19:56:43 Baolin Wang wrote:
This patch converts the timepsec type to timespec64 type, and converts the itimerspec type to itimerspec64 type for the k_clock callback functions.
This patch also converts the timespec type to timespec64 type for timekeeping_clocktai function which is used only in the posix-timers.c file.
Signed-off-by: Baolin Wang baolin.wang@linaro.org
include/linux/timekeeping.h | 4 +- kernel/time/posix-timers.c | 157 +++++++++++++++++++++++++++---------------- kernel/time/timekeeping.h | 2 +- 3 files changed, 102 insertions(+), 61 deletions(-)
You apparently misunderstood my previous explanation about how the patch should be split up.
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 31ea01f..fce456d 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -132,9 +132,9 @@ static struct k_clock posix_clocks[MAX_CLOCKS]; static int common_nsleep(const clockid_t, int flags, struct timespec *t, struct timespec __user *rmtp); static int common_timer_create(struct k_itimer *new_timer); -static void common_timer_get(struct k_itimer *, struct itimerspec *); +static void common_timer_get(struct k_itimer *, struct itimerspec64 *); static int common_timer_set(struct k_itimer *, int,
struct itimerspec *, struct itimerspec *);
struct itimerspec64 *, struct itimerspec64 *);
static int common_timer_del(struct k_itimer *timer); static enum hrtimer_restart posix_timer_fn(struct hrtimer *data);
This part clearly belongs into patch 5, I assume that was just a mistake on your side.
@@ -897,10 +911,19 @@ retry: return -EINVAL; kc = clockid_to_kclock(timr->it_clock);
- if (WARN_ON_ONCE(!kc || !kc->timer_set))
- if (WARN_ON_ONCE(!kc || !kc->timer_set64 || !kc->timer_set)) { error = -EINVAL;
- else
error = kc->timer_set(timr, flags, &new_spec, rtn);
- } else {
if (kc->timer_set64) {
new_spec64 = itimerspec_to_itimerspec64(new_spec);
error = kc->timer_set64(timr, flags, &new_spec64,
&old_spec64);
if (old_setting)
old_spec = itimerspec64_to_itimerspec(old_spec64);
} else {
error = kc->timer_set(timr, flags, &new_spec, rtn);
}
- }
unlock_timer(timr, flag); if (error == TIMER_RETRY) {
This part however is what I think you misunderstood: all the callers of the kc->*64() function callbacks should be changed in patch 5, which introduces the function pointers. You could even split that part out into a patch between 4 and 5, but I think that would not be helpful. However, the rest of this patch is very clearly a separate step from the introduction of the callback pointers.
Arnd