verify: convert verify buf too small warning to fio_did_warn()
authorJens Axboe <axboe@kernel.dk>
Mon, 12 Feb 2018 17:14:35 +0000 (10:14 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Feb 2018 17:14:35 +0000 (10:14 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
debug.h
verify.c

diff --git a/debug.h b/debug.h
index 7e8c224..d10d43e 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -41,6 +41,7 @@ static inline bool fio_did_warn(unsigned int mask)
 
 enum {
        FIO_WARN_ROOT_FLUSH     = 1,
+       FIO_WARN_VERIFY_BUF     = 2,
 };
 
 #ifdef FIO_INC_DEBUG
index b178450..aeafdb5 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -241,7 +241,6 @@ struct vcont {
 };
 
 #define DUMP_BUF_SZ    255
-static int dump_buf_warned;
 
 static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
                     const char *type, struct fio_file *f)
@@ -260,10 +259,8 @@ static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
 
        buf_left -= strlen(fname);
        if (buf_left <= 0) {
-               if (!dump_buf_warned) {
+               if (!fio_did_warn(FIO_WARN_VERIFY_BUF))
                        log_err("fio: verify failure dump buffer too small\n");
-                       dump_buf_warned = 1;
-               }
                free(ptr);
                return;
        }