summaryrefslogtreecommitdiff
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-03-03 17:01:41 +0300
committerSong Liu <song@kernel.org>2024-03-06 19:59:52 +0300
commit28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88 (patch)
treea00c0353b4eeac2164f39ba6ff028c49f326d09b /drivers/md/md.h
parentc396b90e502691fc6ff7b43984cfd9d1b15aaa80 (diff)
downloadlinux-28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88.tar.xz
md: add a mddev_add_trace_msg helper
Add a small wrapper around blk_add_trace_msg that hides some argument dereferences and the check for a DM-mapped MD device. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed--by: Song Liu <song@kernel.org> Tested-by: Song Liu <song@kernel.org> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20240303140150.5435-3-hch@lst.de
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 928086b638a3..e2e1ddd397ea 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -918,4 +918,10 @@ static inline void mddev_trace_remap(struct mddev *mddev, struct bio *bio,
trace_block_bio_remap(bio, disk_devt(mddev->gendisk), sector);
}
+#define mddev_add_trace_msg(mddev, fmt, args...) \
+do { \
+ if ((mddev)->gendisk) \
+ blk_add_trace_msg((mddev)->queue, fmt, ##args); \
+} while (0)
+
#endif /* _MD_MD_H */