Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 21c753874722ceff6e78c9e57768932436bce35b:

  fio: add nanosleep() to Windows (2012-08-15 20:24:24 +0200)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Bruce Cran (1):
      fix 32-bit Windows fio (overflow in getusage and gettimeofday)

Dan Ehrenberg (1):
      Fixing wraparound behavior for time-based sequential read jobs

 file.h             |    1 +
 filesetup.c        |    9 +++++++--
 io_u.c             |    4 ++--
 os/windows/posix.c |    4 ++--
 4 files changed, 12 insertions(+), 6 deletions(-)

---

Diff of recent changes:

diff --git a/file.h b/file.h
index 51df839..68f9a6e 100644
--- a/file.h
+++ b/file.h
@@ -147,6 +147,7 @@ FILE_FLAG_FNS(partial_mmap);
 struct thread_data;
 extern void close_files(struct thread_data *);
 extern void close_and_free_files(struct thread_data *);
+extern unsigned long long get_start_offset(struct thread_data *);
 extern int __must_check setup_files(struct thread_data *);
 extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
 extern int __must_check generic_open_file(struct thread_data *, struct fio_file *);
diff --git a/filesetup.c b/filesetup.c
index 6277f0f..3594a80 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -657,6 +657,12 @@ static unsigned long long get_fs_free_counts(struct thread_data *td)
 	return ret;
 }
 
+unsigned long long get_start_offset(struct thread_data *td)
+{
+	return td->o.start_offset +
+		(td->thread_number - 1) * td->o.offset_increment;
+}
+
 /*
  * Open the files and setup files sizes, creating files if necessary.
  */
@@ -718,8 +724,7 @@ int setup_files(struct thread_data *td)
 	extend_size = total_size = 0;
 	need_extend = 0;
 	for_each_file(td, f, i) {
-		f->file_offset = td->o.start_offset +
-			(td->thread_number - 1) * td->o.offset_increment;
+		f->file_offset = get_start_offset(td);
 
 		if (!td->o.file_size_low) {
 			/*
diff --git a/io_u.c b/io_u.c
index 6646332..2f54562 100644
--- a/io_u.c
+++ b/io_u.c
@@ -256,7 +256,7 @@ static int get_next_seq_offset(struct thread_data *td, struct fio_file *f,
 {
 	assert(ddir_rw(ddir));
 
-	if (f->last_pos >= f->io_size && td->o.time_based)
+	if (f->last_pos >= f->io_size + get_start_offset(td) && td->o.time_based)
 		f->last_pos = f->last_pos - f->io_size;
 
 	if (f->last_pos < f->real_file_size) {
@@ -377,7 +377,7 @@ static inline int io_u_fits(struct thread_data *td, struct io_u *io_u,
 {
 	struct fio_file *f = io_u->file;
 
-	return io_u->offset + buflen <= f->io_size + td->o.start_offset;
+	return io_u->offset + buflen <= f->io_size + get_start_offset(td);
 }
 
 static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
diff --git a/os/windows/posix.c b/os/windows/posix.c
index 27260ce..7bd8ea6 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -99,7 +99,7 @@ int gettimeofday(struct timeval *restrict tp, void *restrict tzp)
 {
 	FILETIME fileTime;
 	unsigned long long unix_time, windows_time;
-	const time_t MILLISECONDS_BETWEEN_1601_AND_1970 = 11644473600000;
+	const unsigned long long MILLISECONDS_BETWEEN_1601_AND_1970 = 11644473600000;
 
 	/* Ignore the timezone parameter */
 	(void)tzp;
@@ -462,7 +462,7 @@ int nice(int incr)
 
 int getrusage(int who, struct rusage *r_usage)
 {
-	const time_t SECONDS_BETWEEN_1601_AND_1970 = 11644473600;
+	const unsigned long long SECONDS_BETWEEN_1601_AND_1970 = 11644473600;
 	FILETIME cTime, eTime, kTime, uTime;
 	time_t time;
 
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux