From db8e4caacff5f380693a4118f401012e38d833cb Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 6 May 2013 15:39:37 +0200 Subject: [PATCH] proc: fix query of lamport clock --- kernel/brick.c | 1 - kernel/brick.h | 2 -- kernel/sy_old/mars_proc.c | 9 ++++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/brick.c b/kernel/brick.c index d4509c57..c78f65c0 100644 --- a/kernel/brick.c +++ b/kernel/brick.c @@ -612,7 +612,6 @@ EXPORT_SYMBOL_GPL(generic_get_aspect); struct semaphore lamport_sem = __SEMAPHORE_INITIALIZER(lamport_sem, 1); // TODO: replace with spinlock if possible (first check) struct timespec lamport_now = {}; -EXPORT_SYMBOL_GPL(lamport_now); void get_lamport(struct timespec *now) { diff --git a/kernel/brick.h b/kernel/brick.h index 1d178fd4..0ffa41d8 100644 --- a/kernel/brick.h +++ b/kernel/brick.h @@ -550,8 +550,6 @@ INLINE struct BRITYPE##_##OBJTYPE##_aspect *BRITYPE##_##OBJTYPE##_get_aspect(str // some general helpers -extern struct timespec lamport_now; - extern void get_lamport(struct timespec *now); extern void set_lamport(struct timespec *old); diff --git a/kernel/sy_old/mars_proc.c b/kernel/sy_old/mars_proc.c index 82467786..9c41b6df 100644 --- a/kernel/sy_old/mars_proc.c +++ b/kernel/sy_old/mars_proc.c @@ -109,13 +109,16 @@ int lamport_sysctl_handler( return -EINVAL; } else { char *tmp = brick_string_alloc(len); - struct timespec now = CURRENT_TIME; + struct timespec know = CURRENT_TIME; + struct timespec lnow; + + get_lamport(&lnow); res = snprintf(tmp, len, "CURRENT_TIME=%ld.%09ld\n" "lamport_now=%ld.%09ld\n", - now.tv_sec, now.tv_nsec, - lamport_now.tv_sec, lamport_now.tv_nsec + know.tv_sec, know.tv_nsec, + lnow.tv_sec, lnow.tv_nsec ); if (copy_to_user(buffer, tmp, res)) {