config BLK_DEV_NULL_BLK
tristate "Null test block driver"
select CONFIGFS_FS
- select FAULT_INJECTION
+
+config BLK_DEV_NULL_BLK_FAULT_INJECTION
+ bool "Support fault injection for Null test block driver"
+ depends on BLK_DEV_NULL_BLK && FAULT_INJECTION
config BLK_DEV_FD
tristate "Normal floppy disk support"
#define TICKS_PER_SEC 50ULL
#define TIMER_INTERVAL (NSEC_PER_SEC / TICKS_PER_SEC)
+#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
static DECLARE_FAULT_ATTR(null_timeout_attr);
+#endif
static inline u64 mb_per_tick(int mbps)
{
module_param_named(home_node, g_home_node, int, S_IRUGO);
MODULE_PARM_DESC(home_node, "Home node for the device");
+#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
static char g_timeout_str[80];
module_param_string(timeout, g_timeout_str, sizeof(g_timeout_str), S_IRUGO);
+#endif
static int g_queue_mode = NULL_Q_MQ;
static bool should_timeout_request(struct request *rq)
{
+#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
if (g_timeout_str[0])
return should_fail(&null_timeout_attr, 1);
+#endif
return false;
}
static bool null_setup_fault(void)
{
+#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION
if (!g_timeout_str[0])
return true;
return false;
null_timeout_attr.verbose = 0;
+#endif
return true;
}