Merge branch 'epoch' of https://github.com/cronburg/fio
authorJens Axboe <axboe@fb.com>
Thu, 18 Aug 2016 20:38:21 +0000 (14:38 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 18 Aug 2016 20:38:21 +0000 (14:38 -0600)
examples/basic-verify.fio [new file with mode: 0644]
fio.h
parse.h

diff --git a/examples/basic-verify.fio b/examples/basic-verify.fio
new file mode 100644 (file)
index 0000000..7871aeb
--- /dev/null
@@ -0,0 +1,12 @@
+# The most basic form of data verification. Write the device randomly
+# in 4K chunks, then read it back and verify the contents.
+[write-and-verify]
+rw=randwrite
+bs=4k
+direct=1
+ioengine=libaio
+iodepth=16
+verify=crc32c
+# Use /dev/XXX. For running this on a file instead, remove the filename
+# option and add a size=32G (or whatever file size you want) instead.
+filename=/dev/XXX
diff --git a/fio.h b/fio.h
index 80b9c3581aee8bc89cd7b370ca6e0c5874566cfd..df4fbb16da9d4ab7dec15870c3e6826d50c329dc 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -564,7 +564,8 @@ enum {
 
 static inline enum fio_ioengine_flags td_ioengine_flags(struct thread_data *td)
 {
-       return (td->flags >> TD_ENG_FLAG_SHIFT) & TD_ENG_FLAG_MASK;
+       return (enum fio_ioengine_flags)
+               ((td->flags >> TD_ENG_FLAG_SHIFT) & TD_ENG_FLAG_MASK);
 }
 
 static inline void td_set_ioengine_flags(struct thread_data *td)
@@ -572,9 +573,10 @@ static inline void td_set_ioengine_flags(struct thread_data *td)
        td->flags |= (td->io_ops->flags << TD_ENG_FLAG_SHIFT);
 }
 
-static inline bool td_ioengine_flagged(struct thread_data *td, unsigned int val)
+static inline bool td_ioengine_flagged(struct thread_data *td,
+                                      enum fio_ioengine_flags flags)
 {
-       return ((td->flags >> TD_ENG_FLAG_SHIFT) & val) != 0;
+       return ((td->flags >> TD_ENG_FLAG_SHIFT) & flags) != 0;
 }
 
 extern void td_set_runstate(struct thread_data *, int);
diff --git a/parse.h b/parse.h
index d852ddc9292391e02e1239a5afbfedf14265589b..7ba4e37b984bd46b17092acbc0c03d120f0c1f57 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -116,7 +116,7 @@ static inline void *td_var(struct thread_options *to, struct fio_option *o,
        else
                ret = to;
 
-       return ret + offset;
+       return (char *) ret + offset;
 }
 
 static inline int parse_is_percent(unsigned long long val)