proc: fix query of lamport clock

This commit is contained in:
Thomas Schoebel-Theuer 2013-05-06 15:39:37 +02:00
parent 57b8d173ff
commit db8e4caacf
3 changed files with 6 additions and 6 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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)) {