Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192324
b: refs/heads/master
c: f56916b
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed May 14, 2010
1 parent 2ca910b commit a4888ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbc72cea58f671665b6362be0d4e391813ac0eee
refs/heads/master: f56916b97fe2031761ca611f0a342efd913afb33
10 changes: 8 additions & 2 deletions trunk/include/linux/ktime.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
#define ktime_to_ns(kt) ((kt).tv64)

#else
#else /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */

/*
* Helper macros/inlines to get the ktime_t math right in the timespec
Expand Down Expand Up @@ -275,7 +275,7 @@ static inline s64 ktime_to_ns(const ktime_t kt)
return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
}

#endif
#endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */

/**
* ktime_equal - Compares two ktime_t variables to see if they are equal
Expand All @@ -295,6 +295,12 @@ static inline s64 ktime_to_us(const ktime_t kt)
return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
}

static inline s64 ktime_to_ms(const ktime_t kt)
{
struct timeval tv = ktime_to_timeval(kt);
return (s64) tv.tv_sec * MSEC_PER_SEC + tv.tv_usec / USEC_PER_MSEC;
}

static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
{
return ktime_to_us(ktime_sub(later, earlier));
Expand Down

0 comments on commit a4888ca

Please sign in to comment.