#include <linux/random.h>
 #include <linux/xarray.h>
 #include <linux/prefetch.h>
+#include <linux/debugfs.h>
 
 #include <net/checksum.h>
 
 
 static const int condition_met_result = SAM_STAT_CONDITION_MET;
 
+static struct dentry *sdebug_debugfs_root;
+
 
 /* Only do the extra work involved in logical block provisioning if one or
  * more of the lbpu, lbpws or lbpws10 parameters are given and we are doing
                goto driver_unreg;
        }
 
+       sdebug_debugfs_root = debugfs_create_dir("scsi_debug", NULL);
+       if (IS_ERR_OR_NULL(sdebug_debugfs_root))
+               pr_info("%s: failed to create initial debugfs directory\n", __func__);
+
        for (k = 0; k < hosts_to_add; k++) {
                if (want_store && k == 0) {
                        ret = sdebug_add_host_helper(idx);
 
        sdebug_erase_all_stores(false);
        xa_destroy(per_store_ap);
+       debugfs_remove(sdebug_debugfs_root);
 }
 
 device_initcall(scsi_debug_init);