aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/null_blk/null_blk.h
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2023-03-27 23:37:33 +0900
committerJens Axboe <axboe@kernel.dk>2023-04-13 07:38:55 -0600
commitbb4c19e030f45c5416f1eb4daa94fbaf7165e9ea (patch)
tree9be9082ef9a9633d70b4055c73a9dd7edc238212 /drivers/block/null_blk/null_blk.h
parentfault-inject: allow configuration via configfs (diff)
downloadlinux-bb4c19e030f45c5416f1eb4daa94fbaf7165e9ea.tar.gz
linux-bb4c19e030f45c5416f1eb4daa94fbaf7165e9ea.zip
block: null_blk: make fault-injection dynamically configurable per device
The null_blk driver has multiple driver-specific fault injection mechanisms. Each fault injection configuration can only be specified by a module parameter and cannot be reconfigured without reloading the driver. Also, each configuration is common to all devices and is initialized every time a new device is added. This change adds the following subdirectories for each null_blk device. /sys/kernel/config/nullb/<disk>/timeout_inject /sys/kernel/config/nullb/<disk>/requeue_inject /sys/kernel/config/nullb/<disk>/init_hctx_fault_inject Each fault injection attribute can be dynamically set per device by a corresponding file in these directories. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Link: https://lore.kernel.org/r/20230327143733.14599-3-akinobu.mita@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk/null_blk.h')
-rw-r--r--drivers/block/null_blk/null_blk.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h
index eb5972c50be8..929f659dd255 100644
--- a/drivers/block/null_blk/null_blk.h
+++ b/drivers/block/null_blk/null_blk.h
@@ -69,7 +69,12 @@ enum {
struct nullb_device {
struct nullb *nullb;
- struct config_item item;
+ struct config_group group;
+#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
+ struct fault_config timeout_config;
+ struct fault_config requeue_config;
+ struct fault_config init_hctx_fault_config;
+#endif
struct radix_tree_root data; /* data stored in the disk */
struct radix_tree_root cache; /* disk cache data */
unsigned long flags; /* device flags */