diff --git a/blktrace.c b/blktrace.c
index 538bcd7..b707180 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -132,7 +132,7 @@
 			continue;
 
 		if (maj == major(st.st_rdev) && min == minor(st.st_rdev)) {
-			dprint(FD_BLKTRACE, "device lookup: %d/%d\n", maj,min);
+			dprint(FD_BLKTRACE, "device lookup: %d/%d\n", maj, min);
 			strcpy(path, full_path);
 			found = 1;
 			break;
@@ -275,11 +275,13 @@
 		}
 
 		if ((t.magic & 0xffffff00) != BLK_IO_TRACE_MAGIC) {
-			log_err("fio: bad magic in blktrace data: %x\n", t.magic);
+			log_err("fio: bad magic in blktrace data: %x\n",
+								t.magic);
 			goto err;
 		}
 		if ((t.magic & 0xff) != BLK_IO_TRACE_VERSION) {
-			log_err("fio: bad blktrace version %d\n", t.magic & 0xff);
+			log_err("fio: bad blktrace version %d\n",
+								t.magic & 0xff);
 			goto err;
 		}
 		ret = discard_pdu(td, fifo, fd, &t);
@@ -311,7 +313,8 @@
 	close(fd);
 
 	if (skipped_writes)
-		log_err("fio: <%s> skips replay of %lu writes due to read-only\n", td->o.name, skipped_writes);
+		log_err("fio: %s skips replay of %lu writes due to read-only\n",
+						td->o.name, skipped_writes);
 
 	if (!ios[DDIR_READ] && !ios[DDIR_WRITE]) {
 		log_err("fio: found no ios in blktrace data\n");
diff --git a/diskutil.c b/diskutil.c
index bbaa22d..b5ba709 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -20,6 +20,7 @@
 	char line[256];
 	FILE *f;
 	char *p;
+	int ret;
 
 	f = fopen(du->path, "r");
 	if (!f)
@@ -31,7 +32,13 @@
 		return 1;
 	}
 
-	if (sscanf(p, "%u %u %llu %u %u %u %llu %u %u %u %u\n", &dus->ios[0], &dus->merges[0], &dus->sectors[0], &dus->ticks[0], &dus->ios[1], &dus->merges[1], &dus->sectors[1], &dus->ticks[1], &in_flight, &dus->io_ticks, &dus->time_in_queue) != 11) {
+	ret = scanf(p, "%u %u %llu %u %u %u %llu %u %u %u %u\n", &dus->ios[0],
+					&dus->merges[0], &dus->sectors[0],
+					&dus->ticks[0], &dus->ios[1],
+					&dus->merges[1], &dus->sectors[1],
+					&dus->ticks[1], &in_flight,
+					&dus->io_ticks, &dus->time_in_queue);
+	if (ret != 11) {
 		fclose(f);
 		return 1;
 	}
@@ -258,7 +265,7 @@
 
 	last_mindev = mindev;
 	last_majdev = majdev;
-		
+
 	sprintf(foo, "/sys/block");
 	if (!find_block_dir(majdev, mindev, foo))
 		return;
@@ -326,7 +333,12 @@
 		if (util > 100.0)
 			util = 100.0;
 
-		log_info("  %s: ios=%u/%u, merge=%u/%u, ticks=%u/%u, in_queue=%u, util=%3.2f%%\n", du->name, dus->ios[0], dus->ios[1], dus->merges[0], dus->merges[1], dus->ticks[0], dus->ticks[1], dus->time_in_queue, util);
+		log_info("  %s: ios=%u/%u, merge=%u/%u, ticks=%u/%u, "
+			 "in_queue=%u, util=%3.2f%%\n", du->name,
+						dus->ios[0], dus->ios[1],
+						dus->merges[0], dus->merges[1],
+						dus->ticks[0], dus->ticks[1],
+						dus->time_in_queue, util);
 	}
 
 	/*
diff --git a/eta.c b/eta.c
index d385532..9a9f658 100644
--- a/eta.c
+++ b/eta.c
@@ -17,47 +17,47 @@
 	char c = run_str[td->thread_number - 1];
 
 	switch (td->runstate) {
-		case TD_REAPED:
-			c = '_';
-			break;
-		case TD_EXITED:
-			c = 'E';
-			break;
-		case TD_RUNNING:
-			if (td_rw(td)) {
-				if (td_random(td))
-					c = 'm';
-				else
-					c = 'M';
-			} else if (td_read(td)) {
-				if (td_random(td))
-					c = 'r';
-				else
-					c = 'R';
-			} else {
-				if (td_random(td))
-					c = 'w';
-				else
-					c = 'W';
-			}
-			break;
-		case TD_VERIFYING:
-			c = 'V';
-			break;
-		case TD_FSYNCING:
-			c = 'F';
-			break;
-		case TD_CREATED:
-			c = 'C';
-			break;
-		case TD_INITIALIZED:
-			c = 'I';
-			break;
-		case TD_NOT_CREATED:
-			c = 'P';
-			break;
-		default:
-			log_err("state %d\n", td->runstate);
+	case TD_REAPED:
+		c = '_';
+		break;
+	case TD_EXITED:
+		c = 'E';
+		break;
+	case TD_RUNNING:
+		if (td_rw(td)) {
+			if (td_random(td))
+				c = 'm';
+			else
+				c = 'M';
+		} else if (td_read(td)) {
+			if (td_random(td))
+				c = 'r';
+			else
+				c = 'R';
+		} else {
+			if (td_random(td))
+				c = 'w';
+			else
+				c = 'W';
+		}
+		break;
+	case TD_VERIFYING:
+		c = 'V';
+		break;
+	case TD_FSYNCING:
+		c = 'F';
+		break;
+	case TD_CREATED:
+		c = 'C';
+		break;
+	case TD_INITIALIZED:
+		c = 'I';
+		break;
+	case TD_NOT_CREATED:
+		c = 'P';
+		break;
+	default:
+		log_err("state %d\n", td->runstate);
 	}
 
 	run_str[td->thread_number - 1] = c;
@@ -176,7 +176,7 @@
 	prev_io_bytes[0] = io_bytes[0];
 	prev_io_bytes[1] = io_bytes[1];
 }
-	
+
 /*
  * Print status of the jobs we know about. This includes rate estimates,
  * ETA, thread state, etc.
@@ -192,7 +192,6 @@
 	unsigned long long io_bytes[2];
 	unsigned long rate_time, disp_time, bw_avg_time;
 	struct timeval now;
-	int linelen;
 
 	static unsigned long long rate_io_bytes[2];
 	static unsigned long long disp_io_bytes[2];
@@ -267,7 +266,7 @@
 	fio_gettime(&now, NULL);
 	rate_time = mtime_since(&rate_prev_time, &now);
 
-	if (write_bw_log && rate_time> bw_avg_time) {
+	if (write_bw_log && rate_time > bw_avg_time) {
 		calc_rate(rate_time, io_bytes, rate_io_bytes, rate);
 		memcpy(&rate_prev_time, &now, sizeof(now));
 		add_agg_sample(rate[DDIR_READ], DDIR_READ);
@@ -290,12 +289,14 @@
 	else if (m_iops || t_iops)
 		printf(", CR=%d/%d IOPS", t_iops, m_iops);
 	if (eta_sec != INT_MAX && nr_running) {
+		int ll;
+
 		perc *= 100.0;
-		linelen = printf(": [%s] [%3.1f%% done] [%6u/%6u kb/s] [eta %s]",
+		ll = printf(": [%s] [%3.1f%% done] [%6u/%6u kb/s] [eta %s]",
 				 run_str, perc, rate[0], rate[1], eta_str);
-		if (linelen >= 0 && linelen < linelen_last)
-			printf("%*s", linelen_last-linelen, "");
-		linelen_last = linelen;
+		if (ll >= 0 && ll < linelen_last)
+			printf("%*s", linelen_last - ll, "");
+		linelen_last = ll;
 	}
 	printf("\r");
 	fflush(stdout);
diff --git a/fifo.c b/fifo.c
index df165f7..de03184 100644
--- a/fifo.c
+++ b/fifo.c
@@ -69,23 +69,23 @@
 	return len;
 }
 
-unsigned int fifo_get(struct fifo *fifo, void *buffer, unsigned int len)
+unsigned int fifo_get(struct fifo *fifo, void *buf, unsigned int len)
 {
 	len = min(len, fifo->in - fifo->out);
 
-	if (buffer) {
+	if (buf) {
 		unsigned int l;
 
 		/*
 		 * first get the data from fifo->out until the end of the buffer
 		 */
 		l = min(len, fifo->size - (fifo->out & (fifo->size - 1)));
-		memcpy(buffer, fifo->buffer + (fifo->out & (fifo->size - 1)),l);
+		memcpy(buf, fifo->buffer + (fifo->out & (fifo->size - 1)), l);
 
 		/*
 		 * then get the rest (if any) from the beginning of the buffer
 		 */
-		memcpy(buffer + l, fifo->buffer, len - l);
+		memcpy(buf + l, fifo->buffer, len - l);
 	}
 
 	fifo->out += len;
diff --git a/filesetup.c b/filesetup.c
index 3eba27e..37a3439 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -116,11 +116,13 @@
 
 static unsigned long long get_rand_file_size(struct thread_data *td)
 {
-	unsigned long long ret;
+	unsigned long long ret, size_d;
 	long r;
 
 	r = os_random_long(&td->file_size_state);
-	ret = td->o.file_size_low + (unsigned long long) ((double) (td->o.file_size_high - td->o.file_size_low) * (r / (RAND_MAX + 1.0)));
+	size_d = td->o.file_size_high - td->o.file_size_low;
+	ret = (unsigned long long) ((double) size_d * (r / (RAND_MAX + 1.0)));
+	ret += td->o.file_size_low;
 	ret -= (ret % td->o.rw_min_bs);
 	return ret;
 }
@@ -171,7 +173,8 @@
 		return ret;
 
 	if (f->file_offset > f->real_file_size) {
-		log_err("%s: offset extends end (%Lu > %Lu)\n", td->o.name, f->file_offset, f->real_file_size);
+		log_err("%s: offset extends end (%Lu > %Lu)\n", td->o.name,
+					f->file_offset, f->real_file_size);
 		return 1;
 	}
 
@@ -193,13 +196,15 @@
 	 */
 	if (f->mmap)
 		ret = madvise(f->mmap, f->io_size, MADV_DONTNEED);
-	else if (f->filetype == FIO_TYPE_FILE)
-		ret = fadvise(f->fd, f->file_offset, f->io_size, POSIX_FADV_DONTNEED);
-	else if (f->filetype == FIO_TYPE_BD) {
+	else if (f->filetype == FIO_TYPE_FILE) {
+		ret = fadvise(f->fd, f->file_offset, f->io_size,
+						POSIX_FADV_DONTNEED);
+	} else if (f->filetype == FIO_TYPE_BD) {
 		ret = blockdev_invalidate_cache(f->fd);
 		if (ret < 0 && errno == EACCES && geteuid()) {
 			if (!root_warn) {
-				log_err("fio: only root may flush block devices. Cache flush bypassed!\n");
+				log_err("fio: only root may flush block "
+					"devices. Cache flush bypassed!\n");
 				root_warn = 1;
 			}
 			ret = 0;
@@ -356,7 +361,8 @@
 		err = td_io_open_file(td, f);
 		if (err) {
 			if (td->error == EMFILE) {
-				log_err("fio: limited open files to: %d\n", td->nr_open_files);
+				log_err("fio: limited open files to: %d\n",
+							td->nr_open_files);
 				td->o.open_files = td->nr_open_files;
 				err = 0;
 				clear_error(td);
@@ -387,7 +393,8 @@
 	int err = 0;
 
 	for_each_file(td, f, i) {
-		dprint(FD_FILE, "get file size for %p/%d/%p\n", f, i, f->file_name);
+		dprint(FD_FILE, "get file size for %p/%d/%p\n", f, i,
+								f->file_name);
 
 		if (td->io_ops->open_file(td, f)) {
 			if (td->error != ENOENT) {
@@ -475,16 +482,19 @@
 				f->io_size = f->real_file_size - f->file_offset;
 		} else if (f->real_file_size < td->o.file_size_low ||
 			   f->real_file_size > td->o.file_size_high) {
-			if (f->file_offset > td->o.file_size_low) 
+			if (f->file_offset > td->o.file_size_low)
 				goto err_offset;
 			/*
 			 * file size given. if it's fixed, use that. if it's a
 			 * range, generate a random size in-between.
 			 */
-			if (td->o.file_size_low == td->o.file_size_high)
-				f->io_size = td->o.file_size_low - f->file_offset;
-			else
-				f->io_size = get_rand_file_size(td) - f->file_offset;
+			if (td->o.file_size_low == td->o.file_size_high) {
+				f->io_size = td->o.file_size_low
+						- f->file_offset;
+			} else {
+				f->io_size = get_rand_file_size(td)
+						- f->file_offset;
+			}
 		} else
 			f->io_size = f->real_file_size - f->file_offset;
 
@@ -499,7 +509,7 @@
 			need_extend++;
 			extend_size += (f->io_size + f->file_offset);
 			f->flags |= FIO_FILE_EXTEND;
-		}	
+		}
 	}
 
 	if (!td->o.size || td->o.size > total_size)
@@ -555,11 +565,15 @@
 		return 0;
 
 	for_each_file(td, f, i) {
-		blocks = (f->real_file_size + td->o.rw_min_bs - 1) / (unsigned long long) td->o.rw_min_bs;
-		num_maps = (blocks + BLOCKS_PER_MAP-1)/ (unsigned long long) BLOCKS_PER_MAP;
+		blocks = (f->real_file_size + td->o.rw_min_bs - 1) /
+				(unsigned long long) td->o.rw_min_bs;
+		num_maps = (blocks + BLOCKS_PER_MAP - 1) /
+				(unsigned long long) BLOCKS_PER_MAP;
 		f->file_map = smalloc(num_maps * sizeof(long));
 		if (!f->file_map) {
-			log_err("fio: failed allocating random map. If running a large number of jobs, try the 'norandommap' option\n");
+			log_err("fio: failed allocating random map. If running"
+				" a large number of jobs, try the 'norandommap'"
+				" option\n");
 			return 1;
 		}
 		f->num_maps = num_maps;
@@ -675,7 +689,8 @@
 	if (f->filetype == FIO_TYPE_FILE)
 		td->nr_normal_files++;
 
-	dprint(FD_FILE, "file %p \"%s\" added at %d\n", f, f->file_name, cur_files);
+	dprint(FD_FILE, "file %p \"%s\" added at %d\n", f, f->file_name,
+							cur_files);
 
 	return cur_files;
 }
@@ -811,7 +826,8 @@
 		if (!S_ISDIR(sb.st_mode))
 			continue;
 
-		if ((ret = recurse_dir(td, full_path)) != 0)
+		ret = recurse_dir(td, full_path);
+		if (ret)
 			break;
 	}
 
diff --git a/fio.c b/fio.c
index d28469e..c1894f5 100644
--- a/fio.c
+++ b/fio.c
@@ -76,8 +76,8 @@
 
 	for_each_td(td, i) {
 		if (group_id == TERMINATE_ALL || groupid == td->groupid) {
-			dprint(FD_PROCESS, "setting terminate on %d\n",td->pid);
-
+			dprint(FD_PROCESS, "setting terminate on %d\n",
+								td->pid);
 			td->terminate = 1;
 			td->o.start_delay = 0;
 
@@ -99,16 +99,16 @@
 static void sig_handler(int sig)
 {
 	switch (sig) {
-		case SIGALRM:
-			update_io_ticks();
-			disk_util_timer_arm();
-			print_thread_status();
-			break;
-		default:
-			printf("\nfio: terminating on signal %d\n", sig);
-			fflush(stdout);
-			terminate_threads(TERMINATE_ALL);
-			break;
+	case SIGALRM:
+		update_io_ticks();
+		disk_util_timer_arm();
+		print_thread_status();
+		break;
+	default:
+		printf("\nfio: terminating on signal %d\n", sig);
+		fflush(stdout);
+		terminate_threads(TERMINATE_ALL);
+		break;
 	}
 }
 
@@ -156,12 +156,16 @@
 			 * check bandwidth specified rate
 			 */
 			if (bytes < td->rate_bytes) {
-				log_err("%s: min rate %u not met\n", td->o.name, td->o.ratemin);
+				log_err("%s: min rate %u not met\n", td->o.name,
+								td->o.ratemin);
 				return 1;
 			} else {
 				rate = (bytes - td->rate_bytes) / spent;
-				if (rate < td->o.ratemin || bytes < td->rate_bytes) {
-					log_err("%s: min rate %u not met, got %luKiB/sec\n", td->o.name, td->o.ratemin, rate);
+				if (rate < td->o.ratemin ||
+				    bytes < td->rate_bytes) {
+					log_err("%s: min rate %u not met, got"
+						" %luKiB/sec\n", td->o.name,
+							td->o.ratemin, rate);
 					return 1;
 				}
 			}
@@ -170,12 +174,17 @@
 			 * checks iops specified rate
 			 */
 			if (iops < td->o.rate_iops) {
-				log_err("%s: min iops rate %u not met\n", td->o.name, td->o.rate_iops);
+				log_err("%s: min iops rate %u not met\n",
+						td->o.name, td->o.rate_iops);
 				return 1;
 			} else {
 				rate = (iops - td->rate_blocks) / spent;
-				if (rate < td->o.rate_iops_min || iops < td->rate_blocks) {
-					log_err("%s: min iops rate %u not met, got %lu\n", td->o.name, td->o.rate_iops_min, rate);
+				if (rate < td->o.rate_iops_min ||
+				    iops < td->rate_blocks) {
+					log_err("%s: min iops rate %u not met,"
+						" got %lu\n", td->o.name,
+							td->o.rate_iops_min,
+							rate);
 				}
 			}
 		}
@@ -539,7 +548,8 @@
 				min_evts = 1;
 
 				if (td->cur_depth > td->o.iodepth_low)
-					min_evts = td->cur_depth - td->o.iodepth_low;
+					min_evts = td->cur_depth
+							- td->o.iodepth_low;
 			}
 
 			fio_gettime(&comp_time, NULL);
@@ -654,10 +664,15 @@
 
 	max_units = td->o.iodepth;
 	max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
-	td->orig_buffer_size = (unsigned long long) max_bs * (unsigned long long) max_units;
+	td->orig_buffer_size = (unsigned long long) max_bs
+					* (unsigned long long) max_units;
 
-	if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE)
-		td->orig_buffer_size = (td->orig_buffer_size + td->o.hugepage_size - 1) & ~(td->o.hugepage_size - 1);
+	if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
+		unsigned long bs;
+
+		bs = td->orig_buffer_size + td->o.hugepage_size - 1;
+		td->orig_buffer_size = bs & ~(td->o.hugepage_size - 1);
+	}
 
 	if (td->orig_buffer_size != (size_t) td->orig_buffer_size) {
 		log_err("fio: IO memory too large. Reduce max_bs or iodepth\n");
@@ -710,7 +725,8 @@
 	f = fopen(tmp, "r+");
 	if (!f) {
 		if (errno == ENOENT) {
-			log_err("fio: os or kernel doesn't support IO scheduler switching\n");
+			log_err("fio: os or kernel doesn't support IO scheduler"
+				" switching\n");
 			return 0;
 		}
 		td_verror(td, errno, "fopen iosched");
@@ -764,7 +780,8 @@
 		return 1;
 	}
 
-	io_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE] + td->io_skip_bytes;
+	io_done = td->io_bytes[DDIR_READ] + td->io_bytes[DDIR_WRITE]
+			+ td->io_skip_bytes;
 	if (io_done < td->o.size)
 		return 1;
 
@@ -897,7 +914,8 @@
 		memcpy(&td->ts.stat_sample_time, &td->start, sizeof(td->start));
 
 		if (td->o.ratemin)
-			memcpy(&td->lastrate, &td->ts.stat_sample_time, sizeof(td->lastrate));
+			memcpy(&td->lastrate, &td->ts.stat_sample_time,
+							sizeof(td->lastrate));
 
 		if (clear_state && clear_io_state(td))
 			break;
@@ -910,7 +928,8 @@
 
 		if (td_read(td) && td->io_bytes[DDIR_READ]) {
 			if (td->rw_end_set[DDIR_READ])
-				elapsed = utime_since(&td->start, &td->rw_end[DDIR_READ]);
+				elapsed = utime_since(&td->start,
+						      &td->rw_end[DDIR_READ]);
 			else
 				elapsed = utime_since_now(&td->start);
 
@@ -918,13 +937,14 @@
 		}
 		if (td_write(td) && td->io_bytes[DDIR_WRITE]) {
 			if (td->rw_end_set[DDIR_WRITE])
-				elapsed = utime_since(&td->start, &td->rw_end[DDIR_WRITE]);
+				elapsed = utime_since(&td->start,
+						      &td->rw_end[DDIR_WRITE]);
 			else
 				elapsed = utime_since_now(&td->start);
 
 			runtime[DDIR_WRITE] += elapsed;
 		}
-		
+
 		if (td->error || td->terminate)
 			break;
 
@@ -969,7 +989,8 @@
 
 err:
 	if (td->error)
-		printf("fio: pid=%d, err=%d/%s\n", td->pid, td->error, td->verror);
+		printf("fio: pid=%d, err=%d/%s\n", td->pid, td->error,
+							td->verror);
 	close_and_free_files(td);
 	close_ioengine(td);
 	cleanup_io_u(td);
@@ -1056,7 +1077,8 @@
 		ret = waitpid(td->pid, &status, flags);
 		if (ret < 0) {
 			if (errno == ECHILD) {
-				log_err("fio: pid=%d disappeared %d\n", td->pid, td->runstate);
+				log_err("fio: pid=%d disappeared %d\n", td->pid,
+								td->runstate);
 				td_set_runstate(td, TD_REAPED);
 				goto reaped;
 			}
@@ -1066,7 +1088,8 @@
 				int sig = WTERMSIG(status);
 
 				if (sig != SIGQUIT)
-					log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
+					log_err("fio: pid=%d, got signal=%d\n",
+								td->pid, sig);
 				td_set_runstate(td, TD_REAPED);
 				goto reaped;
 			}
@@ -1123,11 +1146,13 @@
 	if (!terse_output) {
 		printf("Starting ");
 		if (nr_thread)
-			printf("%d thread%s", nr_thread, nr_thread > 1 ? "s" : "");
+			printf("%d thread%s", nr_thread,
+						nr_thread > 1 ? "s" : "");
 		if (nr_process) {
 			if (nr_thread)
 				printf(" and ");
-			printf("%d process%s", nr_process, nr_process > 1 ? "es" : "");
+			printf("%d process%s", nr_process,
+						nr_process > 1 ? "es" : "");
 		}
 		printf("\n");
 		fflush(stdout);
@@ -1157,7 +1182,8 @@
 		if (setup_files(td)) {
 			exit_value++;
 			if (td->error)
-				log_err("fio: pid=%d, err=%d/%s\n", td->pid, td->error, td->verror);
+				log_err("fio: pid=%d, err=%d/%s\n", td->pid,
+							td->error, td->verror);
 			td_set_runstate(td, TD_REAPED);
 			todo--;
 		} else {
@@ -1171,7 +1197,7 @@
 			 */
 			for_each_file(td, f, i)
 				td_io_close_file(td, f);
- 		}
+		}
 
 		init_disk_util(td);
 	}
@@ -1219,7 +1245,8 @@
 
 			if (td->o.use_thread) {
 				dprint(FD_PROCESS, "will pthread_create\n");
-				if (pthread_create(&td->thread, NULL, thread_main, td)) {
+				if (pthread_create(&td->thread, NULL,
+						   thread_main, td)) {
 					perror("thread_create");
 					nr_started--;
 					break;
@@ -1349,8 +1376,9 @@
 	if (!fio_abort) {
 		show_run_stats();
 		if (write_bw_log) {
-			__finish_log(agg_io_log[DDIR_READ],"agg-read_bw.log");
-			__finish_log(agg_io_log[DDIR_WRITE],"agg-write_bw.log");
+			__finish_log(agg_io_log[DDIR_READ], "agg-read_bw.log");
+			__finish_log(agg_io_log[DDIR_WRITE],
+					"agg-write_bw.log");
 		}
 	}
 
diff --git a/gettime.c b/gettime.c
index 136c02c..d78cf6d 100644
--- a/gettime.c
+++ b/gettime.c
@@ -9,7 +9,7 @@
 
 #include "hash.h"
 
-static int clock_gettime_works = 0;
+static int clock_gettime_works;
 
 #ifdef FIO_DEBUG_TIME
 
@@ -80,7 +80,8 @@
 		list_for_each(entry, &hash[i]) {
 			log = list_entry(entry, struct gtod_log, list);
 
-			printf("function %p, calls %lu\n", log->caller, log->calls);
+			printf("function %p, calls %lu\n", log->caller,
+								log->calls);
 			total_calls += log->calls;
 		}
 	}
diff --git a/init.c b/init.c
index af1798e..3f0dfc6 100644
--- a/init.c
+++ b/init.c
@@ -41,8 +41,8 @@
 int write_bw_log = 0;
 int read_only = 0;
 
-static int def_timeout = 0;
-static int write_lat_log = 0;
+static int def_timeout;
+static int write_lat_log;
 
 static int prev_group_jobs;
 
@@ -52,7 +52,7 @@
  * Command line options. These will contain the above, plus a few
  * extra that only pertain to fio itself and not jobs.
  */
-static struct option long_options[FIO_NR_OPTIONS] = {
+static struct option l_opts[FIO_NR_OPTIONS] = {
 	{
 		.name		= "output",
 		.has_arg	= required_argument,
@@ -208,10 +208,11 @@
 	struct thread_options *o = &td->o;
 
 	if (read_only && td_write(td)) {
-		log_err("fio: job <%s> has write bit set, but fio is in read-only mode\n", td->o.name);
+		log_err("fio: job <%s> has write bit set, but fio is in"
+			" read-only mode\n", td->o.name);
 		return 1;
 	}
-	
+
 	if (o->rwmix[DDIR_READ] + o->rwmix[DDIR_WRITE] > 100)
 		o->rwmix[DDIR_WRITE] = 100 - o->rwmix[DDIR_READ];
 
@@ -234,11 +235,11 @@
 		o->overwrite = 1;
 
 	if (!o->min_bs[DDIR_READ])
-		o->min_bs[DDIR_READ]= o->bs[DDIR_READ];
+		o->min_bs[DDIR_READ] = o->bs[DDIR_READ];
 	if (!o->max_bs[DDIR_READ])
 		o->max_bs[DDIR_READ] = o->bs[DDIR_READ];
 	if (!o->min_bs[DDIR_WRITE])
-		o->min_bs[DDIR_WRITE]= o->bs[DDIR_WRITE];
+		o->min_bs[DDIR_WRITE] = o->bs[DDIR_WRITE];
 	if (!o->max_bs[DDIR_WRITE])
 		o->max_bs[DDIR_WRITE] = o->bs[DDIR_WRITE];
 
@@ -303,7 +304,7 @@
 
 	if (o->fill_device && !o->size)
 		o->size = ULONG_LONG_MAX;
-	
+
 	if (td_rw(td) && td->o.verify != VERIFY_NONE)
 		log_info("fio: mixed read/write workload with verify. May not "
 		 "work as expected, unless you pre-populated the file\n");
@@ -452,7 +453,8 @@
 			add_file(td, jobname);
 		else {
 			for (i = 0; i < td->o.nr_files; i++) {
-				sprintf(fname, "%s.%d.%d", jobname, td->thread_number, i);
+				sprintf(fname, "%s.%d.%d", jobname,
+							td->thread_number, i);
 				add_file(td, fname);
 			}
 		}
@@ -502,9 +504,12 @@
 
 	if (!terse_output) {
 		if (!job_add_num) {
-			if (!strcmp(td->io_ops->name, "cpuio"))
-				log_info("%s: ioengine=cpu, cpuload=%u, cpucycle=%u\n", td->o.name, td->o.cpuload, td->o.cpucycle);
-			else {
+			if (!strcmp(td->io_ops->name, "cpuio")) {
+				log_info("%s: ioengine=cpu, cpuload=%u,"
+					 " cpucycle=%u\n", td->o.name,
+							td->o.cpuload,
+							td->o.cpucycle);
+			} else {
 				char *c1, *c2, *c3, *c4;
 
 				c1 = to_kmg(td->o.min_bs[DDIR_READ]);
@@ -512,7 +517,13 @@
 				c3 = to_kmg(td->o.min_bs[DDIR_WRITE]);
 				c4 = to_kmg(td->o.max_bs[DDIR_WRITE]);
 
-				log_info("%s: (g=%d): rw=%s, bs=%s-%s/%s-%s, ioengine=%s, iodepth=%u\n", td->o.name, td->groupid, ddir_str[td->o.td_ddir], c1, c2, c3, c4, td->io_ops->name, td->o.iodepth);
+				log_info("%s: (g=%d): rw=%s, bs=%s-%s/%s-%s,"
+					 " ioengine=%s, iodepth=%u\n",
+						td->o.name, td->groupid,
+						ddir_str[td->o.td_ddir],
+						c1, c2, c3, c4,
+						td->io_ops->name,
+						td->o.iodepth);
 
 				free(c1);
 				free(c2);
@@ -636,7 +647,8 @@
 		if (sscanf(p, "[%255s]", name) != 1) {
 			if (inside_skip)
 				continue;
-			log_err("fio: option <%s> outside of [] job section\n", p);
+			log_err("fio: option <%s> outside of [] job section\n",
+									p);
 			break;
 		}
 
@@ -806,11 +818,13 @@
 	printf("\t--minimal\tMinimal (terse) output\n");
 	printf("\t--version\tPrint version info and exit\n");
 	printf("\t--help\t\tPrint this page\n");
-	printf("\t--cmdhelp=cmd\tPrint command help, \"all\" for all of them\n");
+	printf("\t--cmdhelp=cmd\tPrint command help, \"all\" for all of"
+		" them\n");
 	printf("\t--showcmd\tTurn a job file into command line options\n");
 	printf("\t--eta=when\tWhen ETA estimate should be printed\n");
 	printf("\t          \tMay be \"always\", \"never\" or \"auto\"\n");
-	printf("\t--readonly\tTurn on safety read-only checks, preventing writes\n");
+	printf("\t--readonly\tTurn on safety read-only checks, preventing"
+		" writes\n");
 	printf("\t--section=name\tOnly run specified section in job file\n");
 }
 
@@ -880,7 +894,7 @@
 	struct thread_data *td = NULL;
 	int c, ini_idx = 0, lidx, ret = 0, do_exit = 0, exit_val = 0;
 
-	while ((c = getopt_long_only(argc, argv, "", long_options, &lidx)) != -1) {
+	while ((c = getopt_long_only(argc, argv, "", l_opts, &lidx)) != -1) {
 		switch (c) {
 		case 't':
 			def_timeout = atoi(optarg);
@@ -928,7 +942,8 @@
 			break;
 		case 'x':
 			if (!strcmp(optarg, "global")) {
-				log_err("fio: can't use global as only section\n");
+				log_err("fio: can't use global as only "
+					"section\n");
 				do_exit++;
 				exit_val = 1;
 				break;
@@ -938,7 +953,7 @@
 			job_section = strdup(optarg);
 			break;
 		case FIO_GETOPT_JOB: {
-			const char *opt = long_options[lidx].name;
+			const char *opt = l_opts[lidx].name;
 			char *val = optarg;
 
 			if (!strncmp(opt, "name", 4) && td) {
@@ -1001,7 +1016,7 @@
 	f_out = stdout;
 	f_err = stderr;
 
-	fio_options_dup_and_init(long_options);
+	fio_options_dup_and_init(l_opts);
 
 	if (setup_thread_area())
 		return 1;
diff --git a/io_u.c b/io_u.c
index 5a3157a..1e60eee 100644
--- a/io_u.c
+++ b/io_u.c
@@ -124,7 +124,8 @@
 	do {
 		r = os_random_long(&td->random_state);
 		dprint(FD_RANDOM, "off rand %llu\n", r);
-		*b = (last_block(td, f, ddir) - 1) * (r / ((unsigned long long) RAND_MAX + 1.0));
+		*b = (last_block(td, f, ddir) - 1)
+			* (r / ((unsigned long long) RAND_MAX + 1.0));
 
 		/*
 		 * if we are not maintaining a random map, we are done.
@@ -208,9 +209,11 @@
 		buflen = td->o.min_bs[ddir];
 	else {
 		r = os_random_long(&td->bsrange_state);
-		if (!td->o.bssplit_nr)
-			buflen = (unsigned int) (1 + (double) (td->o.max_bs[ddir] - 1) * r / (RAND_MAX + 1.0));
-		else {
+		if (!td->o.bssplit_nr) {
+			buflen = (unsigned int)
+					(1 + (double) (td->o.max_bs[ddir] - 1)
+					* r / (RAND_MAX + 1.0));
+		} else {
 			long perc = 0;
 			unsigned int i;
 
@@ -223,8 +226,10 @@
 					break;
 			}
 		}
-		if (!td->o.bs_unaligned)
-			buflen = (buflen + td->o.min_bs[ddir] - 1) & ~(td->o.min_bs[ddir] - 1);
+		if (!td->o.bs_unaligned) {
+			buflen = (buflen + td->o.min_bs[ddir] - 1)
+					& ~(td->o.min_bs[ddir] - 1);
+		}
 	}
 
 	if (io_u->offset + buflen > io_u->file->real_file_size) {
@@ -249,7 +254,8 @@
 	rbytes = td->io_bytes[td->rwmix_ddir] - td->rwmix_bytes;
 	diff = td->o.rwmix[td->rwmix_ddir ^ 1];
 
-	td->rwmix_bytes = td->io_bytes[td->rwmix_ddir] + (rbytes * ((100 - diff)) / diff);
+	td->rwmix_bytes = td->io_bytes[td->rwmix_ddir]
+				+ (rbytes * ((100 - diff)) / diff);
 }
 
 static inline enum fio_ddir get_rand_ddir(struct thread_data *td)
@@ -278,7 +284,7 @@
 		unsigned int cycle;
 
 		fio_gettime(&now, NULL);
-	 	elapsed = mtime_since_now(&td->rwmix_switch);
+		elapsed = mtime_since_now(&td->rwmix_switch);
 
 		/*
 		 * if this is the first cycle, make it shorter
@@ -293,7 +299,7 @@
 		if (elapsed >= cycle ||
 		    td->io_bytes[td->rwmix_ddir] >= td->rwmix_bytes) {
 			unsigned long long max_bytes;
-			enum fio_ddir ddir;			
+			enum fio_ddir ddir;
 
 			/*
 			 * Put a top limit on how many bytes we do for
@@ -302,10 +308,12 @@
 			 */
 			ddir = get_rand_ddir(td);
 			max_bytes = td->this_io_bytes[ddir];
-			if (max_bytes >= (td->o.size * td->o.rwmix[ddir] / 100)) {
+			if (max_bytes >=
+			    (td->o.size * td->o.rwmix[ddir] / 100)) {
 				if (!td->rw_end_set[ddir]) {
 					td->rw_end_set[ddir] = 1;
-					memcpy(&td->rw_end[ddir], &now, sizeof(now));
+					memcpy(&td->rw_end[ddir], &now,
+						sizeof(now));
 				}
 				ddir ^= 1;
 			}
@@ -348,7 +356,7 @@
 	__io_u->flags |= IO_U_F_FREE;
 	if ((__io_u->flags & IO_U_F_FLIGHT) && (__io_u->ddir != DDIR_SYNC))
 		td->io_issues[__io_u->ddir]--;
-		
+
 	__io_u->flags &= ~IO_U_F_FLIGHT;
 
 	list_del(&__io_u->list);
@@ -560,7 +568,8 @@
 	do {
 		long r = os_random_long(&td->next_file_state);
 
-		fno = (unsigned int) ((double) td->o.nr_files * (r / (RAND_MAX + 1.0)));
+		fno = (unsigned int) ((double) td->o.nr_files
+			* (r / (RAND_MAX + 1.0)));
 		f = td->files[fno];
 		if (f->flags & FIO_FILE_DONE)
 			continue;
@@ -610,7 +619,10 @@
 	assert(td->o.nr_files <= td->files_index);
 
 	if (!td->nr_open_files || td->nr_done_files >= td->o.nr_files) {
-		dprint(FD_FILE, "get_next_file: nr_open=%d, nr_done=%d, nr_files=%d\n", td->nr_open_files, td->nr_done_files, td->o.nr_files);
+		dprint(FD_FILE, "get_next_file: nr_open=%d, nr_done=%d,"
+				" nr_files=%d\n", td->nr_open_files,
+						  td->nr_done_files,
+						  td->o.nr_files);
 		return NULL;
 	}
 
@@ -748,7 +760,7 @@
 		dprint(FD_IO, "io_u %p, setting file failed\n", io_u);
 		goto err_put;
 	}
-	
+
 	f = io_u->file;
 	assert(f->flags & FIO_FILE_OPEN);
 
@@ -792,7 +804,8 @@
 
 	log_err(": %s\n", strerror(io_u->error));
 
-	log_err("     %s offset=%llu, buflen=%lu\n", msg[io_u->ddir], io_u->offset, io_u->xfer_buflen);
+	log_err("     %s offset=%llu, buflen=%lu\n", msg[io_u->ddir],
+					io_u->offset, io_u->xfer_buflen);
 
 	if (!td->error)
 		td_verror(td, io_u->error, "io_u error");
@@ -951,7 +964,10 @@
 	unsigned long t_issue = mtime_since_now(&io_u->issue_time);
 
 	log_err("io_u=%p, t_start=%lu, t_issue=%lu\n", io_u, t_start, t_issue);
-	log_err("  buf=%p/%p, len=%lu/%lu, offset=%llu\n", io_u->buf, io_u->xfer_buf, io_u->buflen, io_u->xfer_buflen, io_u->offset);
+	log_err("  buf=%p/%p, len=%lu/%lu, offset=%llu\n", io_u->buf,
+						io_u->xfer_buf, io_u->buflen,
+						io_u->xfer_buflen,
+						io_u->offset);
 	log_err("  ddir=%d, fname=%s\n", io_u->ddir, io_u->file->file_name);
 }
 #else
diff --git a/ioengines.c b/ioengines.c
index 87db11c..e44fce0 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -23,7 +23,8 @@
 static int check_engine_ops(struct ioengine_ops *ops)
 {
 	if (ops->version != FIO_IOOPS_VERSION) {
-		log_err("bad ioops version %d (want %d)\n", ops->version, FIO_IOOPS_VERSION);
+		log_err("bad ioops version %d (want %d)\n", ops->version,
+							FIO_IOOPS_VERSION);
 		return 1;
 	}
 
@@ -37,7 +38,7 @@
 	 */
 	if (ops->flags & FIO_SYNCIO)
 		return 0;
-	
+
 	if (!ops->event) {
 		log_err("%s: no event handler\n", ops->name);
 		return 1;
@@ -50,7 +51,7 @@
 		log_err("%s: no queue handler\n", ops->name);
 		return 1;
 	}
-		
+
 	return 0;
 }
 
@@ -218,12 +219,14 @@
 
 	if (td->io_ops->flags & FIO_SYNCIO) {
 		fio_gettime(&io_u->issue_time, NULL);
-		memcpy(&td->last_issue, &io_u->issue_time, sizeof(struct timeval));
+		memcpy(&td->last_issue, &io_u->issue_time,
+					sizeof(struct timeval));
 
 		/*
 		 * for a sync engine, set the timeout upfront
 		 */
-		if (mtime_since(&td->timeout_end, &io_u->issue_time) < IO_U_TIMEOUT)
+		if (mtime_since(&td->timeout_end, &io_u->issue_time)
+		    < IO_U_TIMEOUT)
 			io_u_set_timeout(td);
 	}
 
@@ -250,14 +253,17 @@
 
 	if ((td->io_ops->flags & FIO_SYNCIO) == 0) {
 		fio_gettime(&io_u->issue_time, NULL);
-		memcpy(&td->last_issue, &io_u->issue_time, sizeof(struct timeval));
+		memcpy(&td->last_issue, &io_u->issue_time,
+				sizeof(struct timeval));
 
 		/*
 		 * async engine, set the timeout here
 		 */
 		if (ret == FIO_Q_QUEUED &&
-		    mtime_since(&td->timeout_end, &io_u->issue_time) < IO_U_TIMEOUT)
+		    (mtime_since(&td->timeout_end, &io_u->issue_time)
+			< IO_U_TIMEOUT)) {
 			io_u_set_timeout(td);
+		}
 	}
 
 	return ret;
@@ -269,8 +275,10 @@
 
 	if (td->io_ops->init) {
 		ret = td->io_ops->init(td);
-		if (ret && td->o.iodepth > 1)
-			log_err("fio: io engine init failed. Perhaps try reducing io depth?\n");
+		if (ret && td->o.iodepth > 1) {
+			log_err("fio: io engine init failed. Perhaps try"
+				" reducing io depth?\n");
+		}
 	}
 
 	return ret;
@@ -295,8 +303,11 @@
 	if (td->io_ops->open_file(td, f)) {
 		if (td->error == EINVAL && td->o.odirect)
 			log_err("fio: destination does not support O_DIRECT\n");
-		if (td->error == EMFILE)
-			log_err("fio: try reducing/setting openfiles (failed at %u of %u)\n", td->nr_open_files, td->o.nr_files);
+		if (td->error == EMFILE) {
+			log_err("fio: try reducing/setting openfiles (failed"
+				" at %u of %u)\n", td->nr_open_files,
+							td->o.nr_files);
+		}
 
 		return 1;
 	}
@@ -321,7 +332,6 @@
 
 	if (td->o.fadvise_hint &&
 	    (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) {
-		
 		int flags;
 
 		if (td_random(td))
diff --git a/log.c b/log.c
index f6fbaeb..aea0398 100644
--- a/log.c
+++ b/log.c
@@ -19,7 +19,9 @@
 	if (!td->o.write_iolog_file)
 		return;
 
-	fprintf(td->iolog_f, "%s %s %llu %lu\n", io_u->file->file_name, act[io_u->ddir], io_u->offset, io_u->buflen);
+	fprintf(td->iolog_f, "%s %s %llu %lu\n", io_u->file->file_name,
+						act[io_u->ddir], io_u->offset,
+						io_u->buflen);
 }
 
 void log_file(struct thread_data *td, struct fio_file *f,
@@ -202,7 +204,8 @@
 		struct io_piece *ipo;
 		int r;
 
-		r = sscanf(p, "%256s %256s %llu %u", fname, act, &offset, &bytes);
+		r = sscanf(p, "%256s %256s %llu %u", fname, act, &offset,
+									&bytes);
 		if (r == 4) {
 			/*
 			 * Check action first
@@ -214,7 +217,8 @@
 			else if (!strcmp(act, "sync"))
 				rw = DDIR_SYNC;
 			else {
-				log_err("fio: bad iolog file action: %s\n",act);
+				log_err("fio: bad iolog file action: %s\n",
+									act);
 				continue;
 			}
 		} else if (r == 2) {
@@ -231,14 +235,15 @@
 				fileno = get_fileno(td, fname);
 				file_action = FIO_LOG_CLOSE_FILE;
 			} else {
-				log_err("fio: bad iolog file action: %s\n",act);
+				log_err("fio: bad iolog file action: %s\n",
+									act);
 				continue;
 			}
 		} else {
 			log_err("bad iolog2: %s", p);
 			continue;
 		}
-			
+
 		if (rw == DDIR_READ)
 			reads++;
 		else if (rw == DDIR_WRITE) {
@@ -277,7 +282,8 @@
 	free(fname);
 
 	if (writes && read_only) {
-		log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+		log_err("fio: <%s> skips replay of %d writes due to"
+			" read-only\n", td->o.name, writes);
 		writes = 0;
 	}
 
@@ -346,7 +352,8 @@
 	free(str);
 
 	if (writes && read_only) {
-		log_err("fio: <%s> skips replay of %d writes due to read-only\n", td->o.name, writes);
+		log_err("fio: <%s> skips replay of %d writes due to"
+			" read-only\n", td->o.name, writes);
 		writes = 0;
 	}
 
@@ -489,8 +496,10 @@
 		return;
 	}
 
-	for (i = 0; i < log->nr_samples; i++)
-		fprintf(f, "%lu, %lu, %u\n", log->log[i].time, log->log[i].val, log->log[i].ddir);
+	for (i = 0; i < log->nr_samples; i++) {
+		fprintf(f, "%lu, %lu, %u\n", log->log[i].time, log->log[i].val,
+						log->log[i].ddir);
+	}
 
 	fclose(f);
 	free(log->log);
diff --git a/memory.c b/memory.c
index be1fd24..257914b 100644
--- a/memory.c
+++ b/memory.c
@@ -36,11 +36,13 @@
 	if (phys_mem) {
 		if ((mlock_size + 128 * 1024 * 1024) > phys_mem) {
 			mlock_size = phys_mem - 128 * 1024 * 1024;
-			log_info("fio: limiting mlocked memory to %lluMiB\n", mlock_size >> 20);
+			log_info("fio: limiting mlocked memory to %lluMiB\n",
+							mlock_size >> 20);
 		}
 	}
 
-	pinned_mem = mmap(NULL, mlock_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | OS_MAP_ANON, 0, 0);
+	pinned_mem = mmap(NULL, mlock_size, PROT_READ | PROT_WRITE,
+				MAP_PRIVATE | OS_MAP_ANON, 0, 0);
 	if (pinned_mem == MAP_FAILED) {
 		perror("malloc locked mem");
 		pinned_mem = NULL;
@@ -70,14 +72,19 @@
 		if (geteuid() != 0 && errno == ENOMEM)
 			log_err("fio: you may need to run this job as root\n");
 		if (td->o.mem_type == MEM_SHMHUGE) {
-			if (errno == EINVAL)
-				log_err("fio: check that you have free huge pages and that hugepage-size is correct.\n");
-			else if (errno == ENOSYS)
-				log_err("fio: your system does not appear to support huge pages.\n");
-			else if (errno == ENOMEM)
-				log_err("fio: no huge pages available, do you need to alocate some? See HOWTO.\n");
+			if (errno == EINVAL) {
+				log_err("fio: check that you have free huge"
+					" pages and that hugepage-size is"
+					" correct.\n");
+			} else if (errno == ENOSYS) {
+				log_err("fio: your system does not appear to"
+					" support huge pages.\n");
+			} else if (errno == ENOMEM) {
+				log_err("fio: no huge pages available, do you"
+					" need to alocate some? See HOWTO.\n");
+			}
 		}
-		
+
 		return 1;
 	}
 
@@ -114,7 +121,8 @@
 	} else
 		flags |= OS_MAP_ANON;
 
-	td->orig_buffer = mmap(NULL, td->orig_buffer_size, PROT_READ | PROT_WRITE, flags, td->mmapfd, 0);
+	td->orig_buffer = mmap(NULL, td->orig_buffer_size,
+				PROT_READ | PROT_WRITE, flags, td->mmapfd, 0);
 	dprint(FD_MEM, "mmap %zu/%d %p\n", td->orig_buffer_size, td->mmapfd,
 							td->orig_buffer);
 	if (td->orig_buffer == MAP_FAILED) {
@@ -124,7 +132,7 @@
 			close(td->mmapfd);
 			unlink(td->mmapfile);
 		}
-			
+
 		return 1;
 	}
 
@@ -137,7 +145,7 @@
 
 	if (td->o.odirect)
 		bsize += page_mask;
-		
+
 	td->orig_buffer = malloc(bsize);
 	dprint(FD_MEM, "malloc %u %p\n", bsize, td->orig_buffer);
 	if (td->orig_buffer)
@@ -181,7 +189,8 @@
 	} else if (td->o.mem_type == MEM_SHM || td->o.mem_type == MEM_SHMHUGE) {
 		struct shmid_ds sbuf;
 
-		dprint(FD_MEM, "shmdt/ctl %d %p\n", td->shm_id,td->orig_buffer);
+		dprint(FD_MEM, "shmdt/ctl %d %p\n", td->shm_id,
+							td->orig_buffer);
 		shmdt(td->orig_buffer);
 		shmctl(td->shm_id, IPC_RMID, &sbuf);
 	} else if (td->o.mem_type == MEM_MMAP ||
diff --git a/options.c b/options.c
index bb77683..f05b786 100644
--- a/options.c
+++ b/options.c
@@ -66,7 +66,9 @@
 		 */
 		if (i == td->o.bssplit_nr) {
 			td->o.bssplit_nr <<= 1;
-			td->o.bssplit = realloc(td->o.bssplit, td->o.bssplit_nr * sizeof(struct bssplit));
+			td->o.bssplit = realloc(td->o.bssplit,
+						td->o.bssplit_nr
+						  * sizeof(struct bssplit));
 		}
 
 		perc_str = strstr(fname, "/");
@@ -852,7 +854,7 @@
 		.type	= FIO_OPT_STR_VAL_INT,
 		.help	= "Offset verify header location by N bytes",
 		.def	= "0",
-		.cb	= str_verify_offset_cb,	
+		.cb	= str_verify_offset_cb,
 		.parent	= "verify",
 	},
 	{
@@ -1050,7 +1052,8 @@
 		.name	= "bwavgtime",
 		.type	= FIO_OPT_INT,
 		.off1	= td_var_offset(bw_avg_time),
-		.help	= "Time window over which to calculate bandwidth (msec)",
+		.help	= "Time window over which to calculate bandwidth"
+			  " (msec)",
 		.def	= "500",
 	},
 	{
diff --git a/parse.c b/parse.c
index f9e0ebe..8e29fab 100644
--- a/parse.c
+++ b/parse.c
@@ -70,37 +70,37 @@
 static unsigned long get_mult_time(char c)
 {
 	switch (c) {
-		case 'm':
-		case 'M':
-			return 60;
-		case 'h':
-		case 'H':
-			return 60 * 60;
-		case 'd':
-		case 'D':
-			return 24 * 60 * 60;
-		default:
-			return 1;
+	case 'm':
+	case 'M':
+		return 60;
+	case 'h':
+	case 'H':
+		return 60 * 60;
+	case 'd':
+	case 'D':
+		return 24 * 60 * 60;
+	default:
+		return 1;
 	}
 }
 
 static unsigned long get_mult_bytes(char c)
 {
 	switch (c) {
-		case 'k':
-		case 'K':
-			return 1024;
-		case 'm':
-		case 'M':
-			return 1024 * 1024;
-		case 'g':
-		case 'G':
-			return 1024 * 1024 * 1024;
-		case 'e':
-		case 'E':
-			return 1024 * 1024 * 1024 * 1024UL;
-		default:
-			return 1;
+	case 'k':
+	case 'K':
+		return 1024;
+	case 'm':
+	case 'M':
+		return 1024 * 1024;
+	case 'g':
+	case 'G':
+		return 1024 * 1024 * 1024;
+	case 'e':
+	case 'E':
+		return 1024 * 1024 * 1024 * 1024UL;
+	default:
+		return 1;
 	}
 }
 
@@ -282,11 +282,13 @@
 			break;
 
 		if (o->maxval && ull > o->maxval) {
-			fprintf(stderr, "max value out of range: %lld (%d max)\n", ull, o->maxval);
+			fprintf(stderr, "max value out of range: %lld"
+					" (%d max)\n", ull, o->maxval);
 			return 1;
 		}
 		if (o->minval && ull < o->minval) {
-			fprintf(stderr, "min value out of range: %lld (%d min)\n", ull, o->minval);
+			fprintf(stderr, "min value out of range: %lld"
+					" (%d min)\n", ull, o->minval);
 			return 1;
 		}
 
@@ -341,7 +343,8 @@
 		p1 = tmp;
 
 		ret = 1;
-		if (!check_range_bytes(p1, &ul1) && !check_range_bytes(p2, &ul2)) {
+		if (!check_range_bytes(p1, &ul1) &&
+		    !check_range_bytes(p2, &ul2)) {
 			ret = 0;
 			if (ul1 > ul2) {
 				unsigned long foo = ul1;
@@ -371,11 +374,13 @@
 			break;
 
 		if (o->maxval && il > (int) o->maxval) {
-			fprintf(stderr, "max value out of range: %d (%d max)\n", il, o->maxval);
+			fprintf(stderr, "max value out of range: %d (%d max)\n",
+								il, o->maxval);
 			return 1;
 		}
 		if (o->minval && il < o->minval) {
-			fprintf(stderr, "min value out of range: %d (%d min)\n", il, o->minval);
+			fprintf(stderr, "min value out of range: %d (%d min)\n",
+								il, o->minval);
 			return 1;
 		}
 
@@ -589,7 +594,7 @@
 		return;
 	if (!org)
 		org = o;
-	
+
 	p = name;
 	depth = level;
 	while (depth--)
@@ -714,13 +719,20 @@
 			o->minval = 0;
 			o->maxval = 1;
 		}
-		if (o->type == FIO_OPT_STR_SET && o->def)
-			fprintf(stderr, "Option %s: string set option with default will always be true\n", o->name);
-		if (!o->cb && !o->off1)
-			fprintf(stderr, "Option %s: neither cb nor offset given\n", o->name);
+		if (o->type == FIO_OPT_STR_SET && o->def) {
+			fprintf(stderr, "Option %s: string set option with"
+					" default will always be true\n",
+						o->name);
+		}
+		if (!o->cb && !o->off1) {
+			fprintf(stderr, "Option %s: neither cb nor offset"
+					" given\n", o->name);
+		}
 		if (o->type == FIO_OPT_STR || o->type == FIO_OPT_STR_STORE)
 			continue;
-		if (o->cb && (o->off1 || o->off2 || o->off3 || o->off4))
-			fprintf(stderr, "Option %s: both cb and offset given\n", o->name);
+		if (o->cb && (o->off1 || o->off2 || o->off3 || o->off4)) {
+			fprintf(stderr, "Option %s: both cb and offset given\n",
+								 o->name);
+		}
 	}
 }
diff --git a/smalloc.c b/smalloc.c
index 85da781..b7502dc 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -364,7 +364,7 @@
 	do {
 		if (combine(pool, prv, hdr))
 			hdr = prv;
-			
+
 		if (hdr_free(hdr) && hdr_size(hdr) >= size)
 			break;
 
diff --git a/stat.c b/stat.c
index 604c235..e3e084e 100644
--- a/stat.c
+++ b/stat.c
@@ -58,12 +58,15 @@
 
 	getrusage(RUSAGE_SELF, &ts->ru_end);
 
-	ts->usr_time += mtime_since(&ts->ru_start.ru_utime, &ts->ru_end.ru_utime);
-	ts->sys_time += mtime_since(&ts->ru_start.ru_stime, &ts->ru_end.ru_stime);
-	ts->ctx += ts->ru_end.ru_nvcsw + ts->ru_end.ru_nivcsw - (ts->ru_start.ru_nvcsw + ts->ru_start.ru_nivcsw);
+	ts->usr_time += mtime_since(&ts->ru_start.ru_utime,
+					&ts->ru_end.ru_utime);
+	ts->sys_time += mtime_since(&ts->ru_start.ru_stime,
+					&ts->ru_end.ru_stime);
+	ts->ctx += ts->ru_end.ru_nvcsw + ts->ru_end.ru_nivcsw
+			- (ts->ru_start.ru_nvcsw + ts->ru_start.ru_nivcsw);
 	ts->minf += ts->ru_end.ru_minflt - ts->ru_start.ru_minflt;
 	ts->majf += ts->ru_end.ru_majflt - ts->ru_start.ru_majflt;
-	
+
 	memcpy(&ts->ru_start, &ts->ru_end, sizeof(ts->ru_end));
 }
 
@@ -106,7 +109,10 @@
 		p3 = num2str(rs->min_bw[i], 6, 1000, 1);
 		p4 = num2str(rs->max_bw[i], 6, 1000, 1);
 
-		log_info("%s: io=%siB, aggrb=%siB/s, minb=%siB/s, maxb=%siB/s, mint=%llumsec, maxt=%llumsec\n", ddir_str[i], p1, p2, p3, p4, rs->min_run[i], rs->max_run[i]);
+		log_info("%s: io=%siB, aggrb=%siB/s, minb=%siB/s, maxb=%siB/s,"
+			 " mint=%llumsec, maxt=%llumsec\n", ddir_str[i], p1, p2,
+						p3, p4, rs->min_run[i],
+						rs->max_run[i]);
 
 		free(p1);
 		free(p2);
@@ -126,7 +132,8 @@
 	 * Do depth distribution calculations
 	 */
 	for (i = 0; i < FIO_IO_U_MAP_NR; i++) {
-		io_u_dist[i] = (double) ts->io_u_map[i] / (double) ts_total_io_u(ts);
+		io_u_dist[i] = (double) ts->io_u_map[i]
+					/ (double) ts_total_io_u(ts);
 		io_u_dist[i] *= 100.0;
 		if (io_u_dist[i] < 0.1 && ts->io_u_map[i])
 			io_u_dist[i] = 0.1;
@@ -191,7 +198,9 @@
 	bw_p = num2str(bw, 6, 1000, 1);
 	iops_p = num2str(iops, 6, 1, 0);
 
-	log_info("  %s: io=%siB, bw=%siB/s, iops=%s, runt=%6lumsec\n", ddir_str[ddir], io_p, bw_p, iops_p, ts->runtime[ddir]);
+	log_info("  %s: io=%siB, bw=%siB/s, iops=%s, runt=%6lumsec\n",
+					ddir_str[ddir], io_p, bw_p, iops_p,
+					ts->runtime[ddir]);
 
 	free(io_p);
 	free(bw_p);
@@ -207,7 +216,8 @@
 		minp = num2str(min, 6, 1, 0);
 		maxp = num2str(max, 6, 1, 0);
 
-		log_info("    slat %s: min=%s, max=%s, avg=%5.02f, stdev=%5.02f\n", base, minp, maxp, mean, dev);
+		log_info("    slat %s: min=%s, max=%s, avg=%5.02f,"
+			 " stdev=%5.02f\n", base, minp, maxp, mean, dev);
 
 		free(minp);
 		free(maxp);
@@ -221,8 +231,9 @@
 
 		minp = num2str(min, 6, 1, 0);
 		maxp = num2str(max, 6, 1, 0);
-	
-		log_info("    clat %s: min=%s, max=%s, avg=%5.02f, stdev=%5.02f\n", base, minp, maxp, mean, dev);
+
+		log_info("    clat %s: min=%s, max=%s, avg=%5.02f,"
+			 " stdev=%5.02f\n", base, minp, maxp, mean, dev);
 
 		free(minp);
 		free(maxp);
@@ -231,7 +242,9 @@
 		double p_of_agg;
 
 		p_of_agg = mean * 100 / (double) rs->agg[ddir];
-		log_info("    bw (KiB/s) : min=%5lu, max=%5lu, per=%3.2f%%, avg=%5.02f, stdev=%5.02f\n", min, max, p_of_agg, mean, dev);
+		log_info("    bw (KiB/s) : min=%5lu, max=%5lu, per=%3.2f%%,"
+			 " avg=%5.02f, stdev=%5.02f\n", min, max, p_of_agg,
+							mean, dev);
 	}
 }
 
@@ -297,10 +310,15 @@
 	    !(ts->total_io_u[0] + ts->total_io_u[1]))
 		return;
 
-	if (!ts->error)
-		log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d\n", ts->name, ts->groupid, ts->members, ts->error, ts->pid);
-	else
-		log_info("%s: (groupid=%d, jobs=%d): err=%2d (%s): pid=%d\n", ts->name, ts->groupid, ts->members, ts->error, ts->verror, ts->pid);
+	if (!ts->error) {
+		log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d\n",
+					ts->name, ts->groupid, ts->members,
+					ts->error, ts->pid);
+	} else {
+		log_info("%s: (groupid=%d, jobs=%d): err=%2d (%s): pid=%d\n",
+					ts->name, ts->groupid, ts->members,
+					ts->error, ts->verror, ts->pid);
+	}
 
 	if (ts->description)
 		log_info("  Description  : [%s]\n", ts->description);
@@ -321,14 +339,21 @@
 		sys_cpu = 0;
 	}
 
-	log_info("  cpu          : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu, majf=%lu, minf=%lu\n", usr_cpu, sys_cpu, ts->ctx, ts->majf, ts->minf);
+	log_info("  cpu          : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu, majf=%lu,"
+		 " minf=%lu\n", usr_cpu, sys_cpu, ts->ctx, ts->majf, ts->minf);
 
 	stat_calc_dist(ts, io_u_dist);
 	stat_calc_lat_u(ts, io_u_lat_u);
 	stat_calc_lat_m(ts, io_u_lat_m);
 
-	log_info("  IO depths    : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%, 16=%3.1f%%, 32=%3.1f%%, >=64=%3.1f%%\n", io_u_dist[0], io_u_dist[1], io_u_dist[2], io_u_dist[3], io_u_dist[4], io_u_dist[5], io_u_dist[6]);
-	log_info("     issued r/w: total=%lu/%lu, short=%lu/%lu\n", ts->total_io_u[0], ts->total_io_u[1], ts->short_io_u[0], ts->short_io_u[1]);
+	log_info("  IO depths    : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%,"
+		 " 16=%3.1f%%, 32=%3.1f%%, >=64=%3.1f%%\n", io_u_dist[0],
+					io_u_dist[1], io_u_dist[2],
+					io_u_dist[3], io_u_dist[4],
+					io_u_dist[5], io_u_dist[6]);
+	log_info("     issued r/w: total=%lu/%lu, short=%lu/%lu\n",
+					ts->total_io_u[0], ts->total_io_u[1],
+					ts->short_io_u[0], ts->short_io_u[1]);
 
 	show_latencies(io_u_lat_u, io_u_lat_m);
 }
@@ -344,7 +369,8 @@
 	if (ts->runtime[ddir])
 		bw = ts->io_bytes[ddir] / ts->runtime[ddir];
 
-	log_info(";%llu;%llu;%lu", ts->io_bytes[ddir] >> 10, bw, ts->runtime[ddir]);
+	log_info(";%llu;%llu;%lu", ts->io_bytes[ddir] >> 10, bw,
+							ts->runtime[ddir]);
 
 	if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
 		log_info(";%lu;%lu;%f;%f", min, max, mean, dev);
@@ -390,13 +416,16 @@
 		sys_cpu = 0;
 	}
 
-	log_info(";%f%%;%f%%;%lu;%lu;%lu", usr_cpu, sys_cpu, ts->ctx, ts->majf, ts->minf);
+	log_info(";%f%%;%f%%;%lu;%lu;%lu", usr_cpu, sys_cpu, ts->ctx, ts->majf,
+								ts->minf);
 
 	stat_calc_dist(ts, io_u_dist);
 	stat_calc_lat_u(ts, io_u_lat_u);
 	stat_calc_lat_m(ts, io_u_lat_m);
 
-	log_info(";%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%", io_u_dist[0], io_u_dist[1], io_u_dist[2], io_u_dist[3], io_u_dist[4], io_u_dist[5], io_u_dist[6]);
+	log_info(";%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%;%3.1f%%",
+			io_u_dist[0], io_u_dist[1], io_u_dist[2], io_u_dist[3],
+			io_u_dist[4], io_u_dist[5], io_u_dist[6]);
 
 	for (i = 0; i < FIO_IO_U_LAT_U_NR; i++)
 		log_info(";%3.2f%%", io_u_lat_u[i]);
@@ -426,7 +455,8 @@
 		mean = src->mean;
 		S = src->S;
 	} else {
-		mean = ((src->mean * (double) (nr - 1)) + dst->mean) / ((double) nr);
+		mean = ((src->mean * (double) (nr - 1))
+				+ dst->mean) / ((double) nr);
 		S = ((src->S * (double) (nr - 1)) + dst->S) / ((double) nr);
 	}
 
@@ -569,7 +599,8 @@
 
 			bw = 0;
 			if (ts->runtime[j])
-				bw = ts->io_bytes[j] / (unsigned long long) ts->runtime[j];
+				bw = ts->io_bytes[j]
+					/ (unsigned long long) ts->runtime[j];
 			if (bw < rs->min_bw[j])
 				rs->min_bw[j] = bw;
 			if (bw > rs->max_bw[j])
diff --git a/time.c b/time.c
index 6d79ecd..505058f 100644
--- a/time.c
+++ b/time.c
@@ -10,7 +10,7 @@
 {
 	long sec, usec;
 	unsigned long long ret;
-	
+
 	sec = e->tv_sec - s->tv_sec;
 	usec = e->tv_usec - s->tv_usec;
 	if (sec > 0 && usec < 0) {
@@ -23,9 +23,9 @@
 	 */
 	if (sec < 0 || (sec == 0 && usec < 0))
 		return 0;
-	
+
 	ret = sec * 1000000ULL + usec;
-	
+
 	return ret;
 }
 
diff --git a/verify.c b/verify.c
index c9f2374..0bb348f 100644
--- a/verify.c
+++ b/verify.c
@@ -167,14 +167,13 @@
  * Return data area 'header_num'
  */
 static inline void *io_u_verify_off(struct verify_header *hdr,
-				    struct io_u *io_u,
-				    unsigned char header_num)
+				    struct io_u *io_u, unsigned char header_num)
 {
 	return io_u->buf + header_num * hdr->len + hdr_size(hdr);
 }
 
 static int verify_io_u_meta(struct verify_header *hdr, struct thread_data *td,
-                            struct io_u *io_u, unsigned int header_num)
+			    struct io_u *io_u, unsigned int header_num)
 {
 	struct vhdr_meta *vh = hdr_priv(hdr);
 
@@ -182,8 +181,7 @@
 
 	if (vh->offset != io_u->offset + header_num * td->o.verify_interval) {
 		log_err("meta: verify failed at %llu/%u\n",
-		              io_u->offset + header_num * hdr->len,
-		              hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		return EIO;
 	}
 
@@ -207,8 +205,7 @@
 
 	if (memcmp(vh->sha512, sha512_ctx.buf, sizeof(sha512))) {
 		log_err("sha512: verify failed at %llu/%u\n",
-		              io_u->offset + header_num * hdr->len,
-		              hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		hexdump(vh->sha512, sizeof(vh->sha512));
 		hexdump(sha512_ctx.buf, sizeof(sha512));
 		return EIO;
@@ -234,8 +231,7 @@
 
 	if (memcmp(vh->sha256, sha256_ctx.buf, sizeof(sha256))) {
 		log_err("sha256: verify failed at %llu/%u\n",
-		              io_u->offset + header_num * hdr->len,
-		              hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		hexdump(vh->sha256, sizeof(vh->sha256));
 		hexdump(sha256_ctx.buf, sizeof(sha256));
 		return EIO;
@@ -245,7 +241,7 @@
 }
 
 static int verify_io_u_crc7(struct verify_header *hdr, struct io_u *io_u,
-                            unsigned char header_num)
+			    unsigned char header_num)
 {
 	void *p = io_u_verify_off(hdr, io_u, header_num);
 	struct vhdr_crc7 *vh = hdr_priv(hdr);
@@ -257,8 +253,7 @@
 
 	if (c != vh->crc7) {
 		log_err("crc7: verify failed at %llu/%u\n",
-		                io_u->offset + header_num * hdr->len,
-				hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		log_err("crc7: wanted %x, got %x\n", vh->crc7, c);
 		return EIO;
 	}
@@ -267,7 +262,7 @@
 }
 
 static int verify_io_u_crc16(struct verify_header *hdr, struct io_u *io_u,
-                             unsigned int header_num)
+			     unsigned int header_num)
 {
 	void *p = io_u_verify_off(hdr, io_u, header_num);
 	struct vhdr_crc16 *vh = hdr_priv(hdr);
@@ -279,8 +274,7 @@
 
 	if (c != vh->crc16) {
 		log_err("crc16: verify failed at %llu/%u\n",
-		                io_u->offset + header_num * hdr->len,
-				hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		log_err("crc16: wanted %x, got %x\n", vh->crc16, c);
 		return EIO;
 	}
@@ -289,7 +283,7 @@
 }
 
 static int verify_io_u_crc64(struct verify_header *hdr, struct io_u *io_u,
-                             unsigned int header_num)
+			     unsigned int header_num)
 {
 	void *p = io_u_verify_off(hdr, io_u, header_num);
 	struct vhdr_crc64 *vh = hdr_priv(hdr);
@@ -303,7 +297,8 @@
 		log_err("crc64: verify failed at %llu/%u\n",
 				io_u->offset + header_num * hdr->len,
 				hdr->len);
-		log_err("crc64: wanted %llx, got %llx\n", (unsigned long long) vh->crc64, c);
+		log_err("crc64: wanted %llx, got %llx\n",
+					(unsigned long long) vh->crc64, c);
 		return EIO;
 	}
 
@@ -311,7 +306,7 @@
 }
 
 static int verify_io_u_crc32(struct verify_header *hdr, struct io_u *io_u,
-		             unsigned int header_num)
+			     unsigned int header_num)
 {
 	void *p = io_u_verify_off(hdr, io_u, header_num);
 	struct vhdr_crc32 *vh = hdr_priv(hdr);
@@ -323,8 +318,7 @@
 
 	if (c != vh->crc32) {
 		log_err("crc32: verify failed at %llu/%u\n",
-		                io_u->offset + header_num * hdr->len,
-				hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		log_err("crc32: wanted %x, got %x\n", vh->crc32, c);
 		return EIO;
 	}
@@ -333,7 +327,7 @@
 }
 
 static int verify_io_u_md5(struct verify_header *hdr, struct io_u *io_u,
-		           unsigned int header_num)
+			   unsigned int header_num)
 {
 	void *p = io_u_verify_off(hdr, io_u, header_num);
 	struct vhdr_md5 *vh = hdr_priv(hdr);
@@ -349,8 +343,7 @@
 
 	if (memcmp(vh->md5_digest, md5_ctx.hash, sizeof(hash))) {
 		log_err("md5: verify failed at %llu/%u\n",
-		              io_u->offset + header_num * hdr->len,
-		              hdr->len);
+				io_u->offset + header_num * hdr->len, hdr->len);
 		hexdump(vh->md5_digest, sizeof(vh->md5_digest));
 		hexdump(md5_ctx.hash, sizeof(hash));
 		return EIO;
@@ -368,7 +361,7 @@
 }
 
 int verify_io_u_pattern(unsigned long pattern, unsigned long pattern_size,
-                        char *buf, unsigned int len, unsigned int mod)
+			char *buf, unsigned int len, unsigned int mod)
 {
 	unsigned int i;
 	char split_pattern[4];
@@ -411,7 +404,8 @@
 		hdr_inc = td->o.verify_interval;
 
 	ret = 0;
-	for (p = io_u->buf; p < io_u->buf + io_u->buflen; p += hdr_inc, hdr_num++) {
+	for (p = io_u->buf; p < io_u->buf + io_u->buflen;
+	     p += hdr_inc, hdr_num++) {
 		if (ret && td->o.verify_fatal) {
 			td->terminate = 1;
 			break;
@@ -430,10 +424,10 @@
 			dprint(FD_VERIFY, "pattern verify io_u %p, len %u\n",
 								io_u, hdr->len);
 			ret = verify_io_u_pattern(td->o.verify_pattern,
-			                          td->o.verify_pattern_bytes,
-			                          p + hdr_size,
-			                          hdr_inc - hdr_size,
-			                          hdr_size % 4);
+						  td->o.verify_pattern_bytes,
+						  p + hdr_size,
+						  hdr_inc - hdr_size,
+						  hdr_size % 4);
 			if (ret)
 				log_err("fio: verify failed at %llu/%u\n",
 					io_u->offset + hdr_num * hdr->len,
@@ -476,7 +470,7 @@
 }
 
 static void fill_meta(struct verify_header *hdr, struct thread_data *td,
-                      struct io_u *io_u, unsigned int header_num)
+		      struct io_u *io_u, unsigned int header_num)
 {
 	struct vhdr_meta *vh = hdr_priv(hdr);
 
@@ -570,7 +564,7 @@
 	if (td->o.verify_interval)
 		hdr_inc = td->o.verify_interval;
 
-	for (;p < io_u->buf + io_u->buflen; p += hdr_inc) {
+	for (; p < io_u->buf + io_u->buflen; p += hdr_inc) {
 		hdr = p;
 
 		hdr->fio_magic = FIO_HDR_MAGIC;
