summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-06-10 10:20:01 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-19 16:36:59 +0200
commitc503b8fc7845677f9b08b4124d34ab6f5cbd7e59 (patch)
treed021777df734a41676736125c7c6031362566d52 /include
parent78a7f865e283552dc127ac19c9399cfb3355db27 (diff)
downloadlinux-stable-c503b8fc7845677f9b08b4124d34ab6f5cbd7e59.tar.gz
linux-stable-c503b8fc7845677f9b08b4124d34ab6f5cbd7e59.tar.bz2
linux-stable-c503b8fc7845677f9b08b4124d34ab6f5cbd7e59.zip
blktrace: use inline function for blk_trace_remove() while blktrace is disabled
commit cbe7cff4a76bc749dd70264ca5cf924e2adf9296 upstream. If config is disabled, call blk_trace_remove() directly will trigger build warning, hence use inline function instead, prepare to fix blktrace debugfs entries leakage. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230610022003.2557284-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blktrace_api.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index cfbda114348c..122c62e561fc 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -85,10 +85,14 @@ extern int blk_trace_remove(struct request_queue *q);
# define blk_add_driver_data(rq, data, len) do {} while (0)
# define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY)
# define blk_trace_startstop(q, start) (-ENOTTY)
-# define blk_trace_remove(q) (-ENOTTY)
# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
# define blk_add_cgroup_trace_msg(q, cg, fmt, ...) do { } while (0)
# define blk_trace_note_message_enabled(q) (false)
+
+static inline int blk_trace_remove(struct request_queue *q)
+{
+ return -ENOTTY;
+}
#endif /* CONFIG_BLK_DEV_IO_TRACE */
#ifdef CONFIG_COMPAT