static unsigned int blktrace_seq __read_mostly = 1;
static struct trace_array *blk_tr;
-static int __read_mostly blk_tracer_enabled;
+static bool blk_tracer_enabled __read_mostly;
/* Select an alternative, minimalistic output than the original one */
#define TRACE_BLK_OPT_CLASSIC 0x1
{
blk_tr = tr;
blk_tracer_start(tr);
- mutex_lock(&blk_probe_mutex);
- blk_tracer_enabled++;
- mutex_unlock(&blk_probe_mutex);
+ blk_tracer_enabled = true;
return 0;
}
if (!atomic_read(&blk_probes_ref))
return;
- mutex_lock(&blk_probe_mutex);
- blk_tracer_enabled--;
- WARN_ON(blk_tracer_enabled < 0);
- mutex_unlock(&blk_probe_mutex);
-
+ blk_tracer_enabled = false;
blk_tracer_stop(tr);
}