Recent changes

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

 



The following changes since commit 76a3179ec3b849e4d4b0324ab3f517beec816bdf:

  splice: use ->o.memalign to indicate we want aligned buffers (2011-05-13 21:19:25 +0200)

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

Jens Axboe (3):
      Fix overlap io_u into outside regions
      Silence gcc 4.6 warnings
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio

 filesetup.c |    2 +-
 io_u.c      |   26 ++++++++++++++++----------
 options.c   |    2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)

---

Diff of recent changes:

diff --git a/filesetup.c b/filesetup.c
index 1350857..799202f 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -504,7 +504,7 @@ open_again:
 
 	if (!from_hash && f->fd != -1) {
 		if (add_file_hash(f)) {
-			int ret;
+			int fio_unused ret;
 
 			/*
 			 * OK to ignore, we haven't done anything with it
diff --git a/io_u.c b/io_u.c
index d35b844..51da223 100644
--- a/io_u.c
+++ b/io_u.c
@@ -341,6 +341,14 @@ static int get_next_offset(struct thread_data *td, struct io_u *io_u)
 	return __get_next_offset(td, io_u);
 }
 
+static inline int io_u_fits(struct thread_data *td, struct io_u *io_u,
+			    unsigned int buflen)
+{
+	struct fio_file *f = io_u->file;
+
+	return io_u->offset + buflen <= f->io_size + td->o.start_offset;
+}
+
 static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
 {
 	const int ddir = io_u->ddir;
@@ -353,14 +361,15 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
 	minbs = td->o.min_bs[ddir];
 	maxbs = td->o.max_bs[ddir];
 
+	if (minbs == maxbs)
+		return minbs;
+
 	if (td->o.use_os_rand)
 		rand_max = OS_RAND_MAX;
 	else
 		rand_max = FRAND_MAX;
 
-	if (minbs == maxbs)
-		buflen = minbs;
-	else {
+	do {
 		if (td->o.use_os_rand)
 			r = os_random_long(&td->bsrange_state);
 		else
@@ -380,19 +389,16 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u)
 
 				buflen = bsp->bs;
 				perc += bsp->perc;
-				if (r <= ((rand_max / 100L) * perc))
+				if ((r <= ((rand_max / 100L) * perc)) &&
+				    io_u_fits(td, io_u, buflen))
 					break;
 			}
 		}
+
 		if (!td->o.bs_unaligned && is_power_of_2(minbs))
 			buflen = (buflen + minbs - 1) & ~(minbs - 1);
-	}
 
-	if (io_u->offset + buflen > io_u->file->real_file_size) {
-		dprint(FD_IO, "lower buflen %u -> %u (ddir=%d)\n", buflen,
-						minbs, ddir);
-		buflen = minbs;
-	}
+	} while (!io_u_fits(td, io_u, buflen));
 
 	return buflen;
 }
diff --git a/options.c b/options.c
index 28a17cf..a9b0534 100644
--- a/options.c
+++ b/options.c
@@ -482,6 +482,7 @@ static int str_sfr_cb(void *data, const char *str)
 
 static int check_dir(struct thread_data *td, char *fname)
 {
+#if 0
 	char file[PATH_MAX], *dir;
 	int elen = 0;
 
@@ -494,7 +495,6 @@ static int check_dir(struct thread_data *td, char *fname)
 	sprintf(file + elen, "%s", fname);
 	dir = dirname(file);
 
-#if 0
 	{
 	struct stat sb;
 	/*
--
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