diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-03 07:51:07 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-03 07:51:07 -0500 |
| commit | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (patch) | |
| tree | c2db1b4958bbf617a25398b7ef93d82006b26a17 /kernel/time.c | |
| parent | 292d4ed32e35df4755052b5002e533348d1648fd (diff) | |
| parent | 88026842b0a760145aa71d69e74fbc9ec118ca44 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'kernel/time.c')
| -rw-r--r-- | kernel/time.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/time.c b/kernel/time.c index 245d595a13cb..b94bfa8c03e0 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
| @@ -561,6 +561,28 @@ void getnstimeofday(struct timespec *tv) | |||
| 561 | EXPORT_SYMBOL_GPL(getnstimeofday); | 561 | EXPORT_SYMBOL_GPL(getnstimeofday); |
| 562 | #endif | 562 | #endif |
| 563 | 563 | ||
| 564 | void getnstimestamp(struct timespec *ts) | ||
| 565 | { | ||
| 566 | unsigned int seq; | ||
| 567 | struct timespec wall2mono; | ||
| 568 | |||
| 569 | /* synchronize with settimeofday() changes */ | ||
| 570 | do { | ||
| 571 | seq = read_seqbegin(&xtime_lock); | ||
| 572 | getnstimeofday(ts); | ||
| 573 | wall2mono = wall_to_monotonic; | ||
| 574 | } while(unlikely(read_seqretry(&xtime_lock, seq))); | ||
| 575 | |||
| 576 | /* adjust to monotonicaly-increasing values */ | ||
| 577 | ts->tv_sec += wall2mono.tv_sec; | ||
| 578 | ts->tv_nsec += wall2mono.tv_nsec; | ||
| 579 | while (unlikely(ts->tv_nsec >= NSEC_PER_SEC)) { | ||
| 580 | ts->tv_nsec -= NSEC_PER_SEC; | ||
| 581 | ts->tv_sec++; | ||
| 582 | } | ||
| 583 | } | ||
| 584 | EXPORT_SYMBOL_GPL(getnstimestamp); | ||
| 585 | |||
| 564 | #if (BITS_PER_LONG < 64) | 586 | #if (BITS_PER_LONG < 64) |
| 565 | u64 get_jiffies_64(void) | 587 | u64 get_jiffies_64(void) |
| 566 | { | 588 | { |
