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 bffd1dd..2e803cb 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 3ea8070..6dbeee0 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 77d6df4..969a037 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 50f3665..596fd6c 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 58901b6..7f5d629 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 6d539a0..8cc348a 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 f537553..ea1a911 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;
 }