Get rid of (now) unused rate_throttle()
authorJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jun 2009 08:41:28 +0000 (10:41 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jun 2009 08:41:28 +0000 (10:41 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.h
time.c

diff --git a/fio.h b/fio.h
index c92629df5f280509cc4d43eb34db46ac3d37e67b..21d49a6a7e6bed719eb01d601902e16ea691a37e 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -448,7 +448,6 @@ extern unsigned long time_since_now(struct timeval *);
 extern unsigned long mtime_since_genesis(void);
 extern void usec_spin(unsigned int);
 extern void usec_sleep(struct thread_data *, unsigned long);
-extern long rate_throttle(struct thread_data *, unsigned long, unsigned long, enum fio_ddir);
 extern void fill_start_time(struct timeval *);
 extern void fio_gettime(struct timeval *, void *);
 extern void fio_gtod_init(void);
diff --git a/time.c b/time.c
index ee9d33fa20d1682e6da44f72edf46023587eaee1..6397f20e01dc8e2ce0cb0067311c155e9c7dce82 100644 (file)
--- a/time.c
+++ b/time.c
@@ -122,30 +122,6 @@ void usec_sleep(struct thread_data *td, unsigned long usec)
        } while (!td->terminate);
 }
 
-long rate_throttle(struct thread_data *td, unsigned long time_spent,
-                  unsigned long bytes, enum fio_ddir ddir)
-{
-       unsigned int bs = td->o.min_bs[ddir];
-       unsigned long usec_cycle;
-
-       if (!td->o.rate[ddir] && !td->o.rate_iops[ddir])
-               return 0;
-
-       usec_cycle = td->rate_usec_cycle[ddir] * (bytes / bs);
-
-       if (time_spent < usec_cycle) {
-               unsigned long s = usec_cycle - time_spent;
-
-               td->rate_pending_usleep[ddir] += s;
-       } else {
-               long overtime = time_spent - usec_cycle;
-
-               td->rate_pending_usleep[ddir] -= overtime;
-       }
-
-       return td->rate_pending_usleep[ddir];
-}
-
 unsigned long mtime_since_genesis(void)
 {
        return mtime_since_now(&genesis);