diff options
author | Christoph Hellwig <hch@lst.de> | 2024-03-03 07:01:41 -0700 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-03-06 08:59:52 -0800 |
commit | 28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88 (patch) | |
tree | a00c0353b4eeac2164f39ba6ff028c49f326d09b /drivers/md/md.h | |
parent | c396b90e502691fc6ff7b43984cfd9d1b15aaa80 (diff) | |
download | linux-stable-28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88.tar.gz linux-stable-28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88.tar.bz2 linux-stable-28be4fd310d146e9a43d7b1bb55cb7e9f5e06e88.zip |
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.h | 6 |
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 */ |