summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-02-12 10:19:18 -0700
committerJens Axboe <axboe@kernel.dk>2018-02-12 10:19:18 -0700
commite244616690aa6c9d0e5aed74860a55715d03b052 (patch)
tree4b86822a487d7a3092f0b94b7b4e8caa5516ce20
parent264e3d300d9aa2d9c5acdf8edbd3639fbec784a0 (diff)
downloadfio-e244616690aa6c9d0e5aed74860a55715d03b052.tar.gz
fio-e244616690aa6c9d0e5aed74860a55715d03b052.tar.bz2
iolog: convert drop warning to fio_did_warn()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--debug.h1
-rw-r--r--iolog.c6
2 files changed, 2 insertions, 5 deletions
diff --git a/debug.h b/debug.h
index 84d6fafd..a2b6fa67 100644
--- a/debug.h
+++ b/debug.h
@@ -43,6 +43,7 @@ enum {
FIO_WARN_ROOT_FLUSH = 1,
FIO_WARN_VERIFY_BUF = 2,
FIO_WARN_ZONED_BUG = 4,
+ FIO_WARN_IOLOG_DROP = 8,
};
#ifdef FIO_INC_DEBUG
diff --git a/iolog.c b/iolog.c
index 760d7b0a..34e74a80 100644
--- a/iolog.c
+++ b/iolog.c
@@ -1141,8 +1141,6 @@ size_t log_chunk_sizes(struct io_log *log)
#ifdef CONFIG_ZLIB
-static bool warned_on_drop;
-
static void iolog_put_deferred(struct io_log *log, void *ptr)
{
if (!ptr)
@@ -1152,10 +1150,8 @@ static void iolog_put_deferred(struct io_log *log, void *ptr)
if (log->deferred < IOLOG_MAX_DEFER) {
log->deferred_items[log->deferred] = ptr;
log->deferred++;
- } else if (!warned_on_drop) {
+ } else if (!fio_did_warn(FIO_WARN_IOLOG_DROP))
log_err("fio: had to drop log entry free\n");
- warned_on_drop = true;
- }
pthread_mutex_unlock(&log->deferred_free_lock);
}