439
437
/* See whether it's time to fsync file(s) */
440
438
if (file_fsync_freq != 0 && file_req->operation == FILE_OP_TYPE_WRITE &&
441
req_performed % file_fsync_freq == 0)
439
is_dirty && req_performed % file_fsync_freq == 0)
443
441
file_req->operation = FILE_OP_TYPE_FSYNC;
444
442
file_req->file_id = fsynced_file;
446
444
file_req->size = 0;
448
446
if (fsynced_file == num_files)
449
448
fsynced_file = 0;
451
452
SB_THREAD_MUTEX_UNLOCK();
458
if (file_req->operation == FILE_OP_TYPE_WRITE)
455
461
/* Rewind to the first file if all files are processed */
456
462
if (current_file == num_files)
474
480
file_req->file_id = current_file;
475
481
file_req->pos = position;
484
position += file_req->size;
478
486
/* scroll to the next file if not already out of bound */
479
487
if (position == file_size)
736
744
char sizestr[16];
738
log_text(LOG_INFO, "Extra file open flags: %x", file_extra_flags);
739
log_text(LOG_INFO, "%d files, %sb each", num_files,
746
log_text(LOG_NOTICE, "Extra file open flags: %x", file_extra_flags);
747
log_text(LOG_NOTICE, "%d files, %sb each", num_files,
740
748
sb_print_value_size(sizestr, sizeof(sizestr), file_size));
741
log_text(LOG_INFO, "%sb total file size",
749
log_text(LOG_NOTICE, "%sb total file size",
742
750
sb_print_value_size(sizestr, sizeof(sizestr),
743
751
file_size * num_files));
744
log_text(LOG_INFO, "Block size %sb",
752
log_text(LOG_NOTICE, "Block size %sb",
745
753
sb_print_value_size(sizestr, sizeof(sizestr), file_block_size));
746
754
if (file_merged_requests > 0)
747
log_text(LOG_INFO, "Merging requests up to %sb for sequential IO.",
755
log_text(LOG_NOTICE, "Merging requests up to %sb for sequential IO.",
748
756
sb_print_value_size(sizestr, sizeof(sizestr),
749
757
file_max_request_size));
753
761
case MODE_RND_WRITE:
754
762
case MODE_RND_READ:
755
763
case MODE_RND_RW:
756
log_text(LOG_INFO, "Number of IO requests: %d",
764
log_text(LOG_NOTICE, "Number of IO requests: %d",
757
765
sb_globals.max_requests);
759
767
"Read/Write ratio for combined random IO test: %2.2f",
766
774
if (file_fsync_freq > 0)
768
776
"Periodic FSYNC enabled, calling fsync() each %d requests.",
769
777
file_fsync_freq);
771
779
if (file_fsync_end)
772
log_text(LOG_INFO, "Calling fsync() at the end of test, Enabled.");
780
log_text(LOG_NOTICE, "Calling fsync() at the end of test, Enabled.");
774
782
if (file_fsync_all)
775
log_text(LOG_INFO, "Calling fsync() after each write operation.");
783
log_text(LOG_NOTICE, "Calling fsync() after each write operation.");
777
log_text(LOG_INFO, "Using %s I/O mode", get_io_mode_str(file_io_mode));
785
log_text(LOG_NOTICE, "Using %s I/O mode", get_io_mode_str(file_io_mode));
779
787
if (sb_globals.validate)
780
log_text(LOG_INFO, "Using checksums validation.");
788
log_text(LOG_NOTICE, "Using checksums validation.");
782
log_text(LOG_INFO, "Doing %s test", get_test_mode_str(test_mode));
790
log_text(LOG_NOTICE, "Doing %s test", get_test_mode_str(test_mode));
895
903
char file_name[512];
896
904
long long offset;
898
log_text(LOG_INFO, "%d files, %ldKb each, %ldMb total", num_files,
906
log_text(LOG_NOTICE, "%d files, %ldKb each, %ldMb total", num_files,
899
907
(long)(file_size / 1024),
900
908
(long)((file_size * num_files) / (1024 * 1024)));
901
log_text(LOG_INFO, "Creating files for the test...");
902
log_text(LOG_INFO, "Extra file open flags: %x", file_extra_flags);
909
log_text(LOG_NOTICE, "Creating files for the test...");
910
log_text(LOG_NOTICE, "Extra file open flags: %x", file_extra_flags);
903
911
for (i=0; i < num_files; i++) {
904
912
snprintf(file_name, sizeof(file_name), "test_file.%d",i);
905
913
unlink(file_name);