iolog: invert log_mask bits
authorJens Axboe <axboe@fb.com>
Thu, 3 Apr 2014 02:07:28 +0000 (20:07 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 3 Apr 2014 02:07:28 +0000 (20:07 -0600)
Get rid of the all-log-mask.

Signed-off-by: Jens Axboe <axboe@fb.com>
iolog.c

diff --git a/iolog.c b/iolog.c
index 1af31cb3bd30804f4754c48b9f841fd7006736f9..deec0861a9c49b4d4df0700c1aeb8288bda4df8e 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -628,7 +628,6 @@ enum {
        CLAT_LOG_MASK   = 8,
        IOPS_LOG_MASK   = 16,
 
-       ALL_LOG_MASK    = 31,
        ALL_LOG_NR      = 5,
 };
 
@@ -662,7 +661,7 @@ static struct log_type log_types[] = {
 
 void fio_writeout_logs(struct thread_data *td)
 {
-       unsigned int log_mask = ALL_LOG_MASK;
+       unsigned int log_mask = 0;
        unsigned int log_left = ALL_LOG_NR;
        int old_state, i;
 
@@ -677,11 +676,11 @@ void fio_writeout_logs(struct thread_data *td)
                        struct log_type *lt = &log_types[i];
                        int ret;
 
-                       if (log_mask & lt->mask) {
+                       if (!(log_mask & lt->mask)) {
                                ret = lt->fn(td, log_left != 1);
                                if (!ret) {
                                        log_left--;
-                                       log_mask &= ~lt->mask;
+                                       log_mask |= lt->mask;
                                }
                        }
                }