Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
authorJens Axboe <jaxboe@fusionio.com>
Fri, 22 Oct 2010 19:43:45 +0000 (21:43 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 22 Oct 2010 19:43:45 +0000 (21:43 +0200)
arch/arch-x86.h
arch/arch-x86_64.h
crc/crc32c-intel.c
crc/crc32c.h
engines/binject.c
io_u.c
verify.c

index bffd1dd8b132ce68b6af4fc744a53669157a9332..2e803cbe5ba13c96e2f377516dca6def34bc013f 100644 (file)
@@ -48,7 +48,6 @@ static inline unsigned long long get_cpu_clock(void)
 }
 
 #define ARCH_HAVE_FFZ
-#define ARCH_HAVE_SSE
 #define ARCH_HAVE_CPU_CLOCK
 
 #endif
index 3ea8070ee619b9bf22476da4d54e792d8bf4c269..6dbeee06a6ed2999de25909287b6431828b30107 100644 (file)
@@ -48,7 +48,7 @@ static inline unsigned long long get_cpu_clock(void)
 }
 
 #define ARCH_HAVE_FFZ
-#define ARCH_HAVE_SSE
+#define ARCH_HAVE_SSE4_2
 #define ARCH_HAVE_CPU_CLOCK
 
 #endif
index 77d6df411973510298342d79e190db4b3a447ffa..969a037f942d24e9509b11217fd3123e01658aea 100644 (file)
@@ -18,7 +18,7 @@
  * Volume 2A: Instruction Set Reference, A-M
  */
 
-#ifdef ARCH_HAVE_SSE
+#ifdef ARCH_HAVE_SSE4_2
 
 #if BITS_PER_LONG == 64
 #define REX_PRE "0x48, "
index 50f3665f39375ddc4a8c4d6c7888930a13dcdda6..596fd6c56a98f835933ee68c17b1e845e0309a7d 100644 (file)
@@ -22,7 +22,7 @@
 
 extern uint32_t crc32c(unsigned char const *, unsigned long);
 
-#ifdef ARCH_HAVE_SSE
+#ifdef ARCH_HAVE_SSE4_2
 extern uint32_t crc32c_intel(unsigned char const *, unsigned long);
 extern int crc32c_intel_works(void);
 #else
index 58901b6f8674b5238e133879620ec00811fdf751..7f5d6292eed417821e71f9fbb007e7690d5d2dc5 100644 (file)
@@ -146,7 +146,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
                for (i = 0; i < events; i++) {
                        struct b_user_cmd *buc = (struct b_user_cmd *) buf + i;
 
-                       bd->events[ev_index] = (struct io_u *) buc->usr_ptr;
+                       bd->events[ev_index] = (struct io_u *) (unsigned long) buc->usr_ptr;
                        ev_index++;
                }
        }
diff --git a/io_u.c b/io_u.c
index 6d539a01fbdaec105144c2b93252683a4630af46..8cc348a835fed67a2310c04f84b4608281db1315 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -126,16 +126,20 @@ static unsigned long long last_block(struct thread_data *td, struct fio_file *f,
 static int get_next_free_block(struct thread_data *td, struct fio_file *f,
                               enum fio_ddir ddir, unsigned long long *b)
 {
-       unsigned long long min_bs = td->o.rw_min_bs;
+       unsigned long long min_bs = td->o.rw_min_bs, lastb;
        int i;
 
+       lastb = last_block(td, f, ddir);
+       if (!lastb)
+               return 1;
+
        i = f->last_free_lookup;
        *b = (i * BLOCKS_PER_MAP);
        while ((*b) * min_bs < f->real_file_size &&
                (*b) * min_bs < f->io_size) {
                if (f->file_map[i] != (unsigned int) -1) {
                        *b += ffz(f->file_map[i]);
-                       if (*b > last_block(td, f, ddir))
+                       if (*b > lastb)
                                break;
                        f->last_free_lookup = i;
                        return 0;
@@ -152,14 +156,17 @@ static int get_next_free_block(struct thread_data *td, struct fio_file *f,
 static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                                enum fio_ddir ddir, unsigned long long *b)
 {
-       unsigned long long r;
+       unsigned long long r, lastb;
        int loops = 5;
 
+       lastb = last_block(td, f, ddir);
+       if (!lastb)
+               return 1;
+
        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) OS_RAND_MAX + 1.0));
+               *b = (lastb - 1) * (r / ((unsigned long long) OS_RAND_MAX + 1.0));
 
                /*
                 * if we are not maintaining a random map, we are done.
index f537553af92acf7e830b878d9ffd5e9173e04c35..ea1a911555558f503d706f100989f5b0da848439 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -501,7 +501,7 @@ static int verify_trimmed_io_u(struct thread_data *td, struct io_u *io_u)
        log_err("trim: verify failed at file %s offset %llu, length %lu"
                ", block offset %lu\n",
                        io_u->file->file_name, io_u->offset, io_u->buflen,
-                       (p - io_u->buf));
+                       (unsigned long) (p - io_u->buf));
        return ret;
 }