projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing wraparound behavior for time-based sequential read jobs
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index b1f73f7131cb6dfe086bdd45f9cd269e7cf963f2..3594a80faf3bfe8300e29fc7cc04f7c892e826f8 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-657,6
+657,12
@@
static unsigned long long get_fs_free_counts(struct thread_data *td)
return ret;
}
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.
*/
/*
* 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) {
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) {
/*
if (!td->o.file_size_low) {
/*
@@
-979,6
+984,7
@@
int add_file(struct thread_data *td, const char *fname)
td->files_size = new_size;
}
td->files[cur_files] = f;
td->files_size = new_size;
}
td->files[cur_files] = f;
+ f->fileno = cur_files;
/*
* init function, io engine may not be loaded yet
/*
* init function, io engine may not be loaded yet
@@
-1005,7
+1011,7
@@
int add_file(struct thread_data *td, const char *fname)
f->lock = fio_mutex_rw_init();
break;
case FILE_LOCK_EXCLUSIVE:
f->lock = fio_mutex_rw_init();
break;
case FILE_LOCK_EXCLUSIVE:
- f->lock = fio_mutex_init(
1
);
+ f->lock = fio_mutex_init(
FIO_MUTEX_UNLOCKED
);
break;
default:
log_err("fio: unknown lock mode: %d\n", td->o.file_lock_mode);
break;
default:
log_err("fio: unknown lock mode: %d\n", td->o.file_lock_mode);