summaryrefslogtreecommitdiff
path: root/gettime.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-09-30 16:04:12 -0600
committerJens Axboe <axboe@fb.com>2014-09-30 16:04:12 -0600
commit1f440ece6127d2d274b961b6af0aa9091787702a (patch)
treee607da248c56d27d6aa37db6a113717291ff03af /gettime.c
parentacd45e028cfaf15a29eedcba3ff95c804e2d29e9 (diff)
downloadfio-1f440ece6127d2d274b961b6af0aa9091787702a.tar.gz
fio-1f440ece6127d2d274b961b6af0aa9091787702a.tar.bz2
Constify a few more hot paths
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'gettime.c')
-rw-r--r--gettime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gettime.c b/gettime.c
index 8a139239..9f836209 100644
--- a/gettime.c
+++ b/gettime.c
@@ -377,7 +377,7 @@ void fio_clock_init(void)
log_info("fio: clocksource=cpu may not be reliable\n");
}
-uint64_t utime_since(struct timeval *s, struct timeval *e)
+uint64_t utime_since(const struct timeval *s, const struct timeval *e)
{
long sec, usec;
uint64_t ret;
@@ -400,7 +400,7 @@ uint64_t utime_since(struct timeval *s, struct timeval *e)
return ret;
}
-uint64_t utime_since_now(struct timeval *s)
+uint64_t utime_since_now(const struct timeval *s)
{
struct timeval t;
@@ -408,7 +408,7 @@ uint64_t utime_since_now(struct timeval *s)
return utime_since(s, &t);
}
-uint64_t mtime_since(struct timeval *s, struct timeval *e)
+uint64_t mtime_since(const struct timeval *s, const struct timeval *e)
{
long sec, usec, ret;
@@ -429,7 +429,7 @@ uint64_t mtime_since(struct timeval *s, struct timeval *e)
return ret;
}
-uint64_t mtime_since_now(struct timeval *s)
+uint64_t mtime_since_now(const struct timeval *s)
{
struct timeval t;
void *p = __builtin_return_address(0);
@@ -438,7 +438,7 @@ uint64_t mtime_since_now(struct timeval *s)
return mtime_since(s, &t);
}
-uint64_t time_since_now(struct timeval *s)
+uint64_t time_since_now(const struct timeval *s)
{
return mtime_since_now(s) / 1000;
}