|
41 | 41 | #include <linux/random.h>
|
42 | 42 | #include <linux/xarray.h>
|
43 | 43 | #include <linux/prefetch.h>
|
| 44 | +#include <linux/debugfs.h> |
44 | 45 |
|
45 | 46 | #include <net/checksum.h>
|
46 | 47 |
|
@@ -862,6 +863,8 @@ static const int device_qfull_result =
|
862 | 863 |
|
863 | 864 | static const int condition_met_result = SAM_STAT_CONDITION_MET;
|
864 | 865 |
|
| 866 | +static struct dentry *sdebug_debugfs_root; |
| 867 | + |
865 | 868 |
|
866 | 869 | /* Only do the extra work involved in logical block provisioning if one or
|
867 | 870 | * more of the lbpu, lbpws or lbpws10 parameters are given and we are doing
|
@@ -7011,6 +7014,10 @@ static int __init scsi_debug_init(void)
|
7011 | 7014 | goto driver_unreg;
|
7012 | 7015 | }
|
7013 | 7016 |
|
| 7017 | + sdebug_debugfs_root = debugfs_create_dir("scsi_debug", NULL); |
| 7018 | + if (IS_ERR_OR_NULL(sdebug_debugfs_root)) |
| 7019 | + pr_info("%s: failed to create initial debugfs directory\n", __func__); |
| 7020 | + |
7014 | 7021 | for (k = 0; k < hosts_to_add; k++) {
|
7015 | 7022 | if (want_store && k == 0) {
|
7016 | 7023 | ret = sdebug_add_host_helper(idx);
|
@@ -7057,6 +7064,7 @@ static void __exit scsi_debug_exit(void)
|
7057 | 7064 |
|
7058 | 7065 | sdebug_erase_all_stores(false);
|
7059 | 7066 | xa_destroy(per_store_ap);
|
| 7067 | + debugfs_remove(sdebug_debugfs_root); |
7060 | 7068 | }
|
7061 | 7069 |
|
7062 | 7070 | device_initcall(scsi_debug_init);
|
|
0 commit comments