summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a9619d4)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PROGS = fio
SCRIPTS = fio_generate_plots
PROGS = fio
SCRIPTS = fio_generate_plots
void close_files(struct thread_data *td)
{
void close_files(struct thread_data *td)
{
- for (i = 0; i < td->nr_files; i++) {
- struct fio_file *f = &td->files[i];
-
+ for_each_file(td, f, i) {
if (f->fd != -1) {
if (td->unlink && td->filetype == FIO_TYPE_FILE)
unlink(f->file_name);
if (f->fd != -1) {
if (td->unlink && td->filetype == FIO_TYPE_FILE)
unlink(f->file_name);
* Check if it's time to seed a new data direction.
*/
if (elapsed >= td->rwmixcycle) {
* Check if it's time to seed a new data direction.
*/
if (elapsed >= td->rwmixcycle) {
long r;
r = os_random_long(&td->rwmix_state);
long r;
r = os_random_long(&td->rwmix_state);
static struct fio_file *get_next_file(struct thread_data *td)
{
static struct fio_file *get_next_file(struct thread_data *td)
{
- int old_next_file = td->next_file;
+ unsigned int old_next_file = td->next_file;
#define fio_unused __attribute((__unused__))
#define for_each_file(td, f, i) \
#define fio_unused __attribute((__unused__))
#define for_each_file(td, f, i) \
- for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->nr_files; (i)++, (f) = &(td)->files[(i)])
+ for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f) = &(td)->files[(i)])
{
unsigned long seeds[4];
int fd, num_maps, blocks, i;
{
unsigned long seeds[4];
int fd, num_maps, blocks, i;
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1) {
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1) {
if (td->rand_repeatable)
seeds[3] = DEF_RANDSEED;
if (td->rand_repeatable)
seeds[3] = DEF_RANDSEED;
- for (i = 0; i < td->nr_files; i++) {
- struct fio_file *f = &td->files[i];
-
+ for_each_file(td, f, i) {
blocks = (f->file_size + td->min_bs - 1) / td->min_bs;
num_maps = blocks / BLOCKS_PER_MAP;
f->file_map = malloc(num_maps * sizeof(long));
blocks = (f->file_size + td->min_bs - 1) / td->min_bs;
num_maps = blocks / BLOCKS_PER_MAP;
f->file_map = malloc(num_maps * sizeof(long));
-static void usage(char *name)
{
printf("%s\n", fio_version_string);
printf("\t-o Write output to file\n");
{
printf("%s\n", fio_version_string);
printf("\t-o Write output to file\n");
idx = optind;
break;
case 'h':
idx = optind;
break;
case 'h':
exit(0);
case 'v':
printf("%s\n", fio_version_string);
exit(0);
case 'v':
printf("%s\n", fio_version_string);
job_files = parse_cmd_line(argc, argv);
if (!job_files) {
log_err("Need job file(s)\n");
job_files = parse_cmd_line(argc, argv);
if (!job_files) {
log_err("Need job file(s)\n");