Commit 810f09b8 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

failslab: simplify debugfs initialization

Now cleanup_fault_attr_dentries() recursively removes a directory, So we
can simplify the error handling in the initialization code and no need
to hold dentry structs for each debugfs file.

Signed-off-by: default avatarAkinobu Mita <>
Cc: Christoph Lameter <>
Cc: Pekka Enberg <>
Cc: Matt Mackall <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 7f5ddcc8
......@@ -5,10 +5,6 @@ static struct {
struct fault_attr attr;
u32 ignore_gfp_wait;
int cache_filter;
struct dentry *ignore_gfp_wait_file;
struct dentry *cache_filter_file;
} failslab = {
.ignore_gfp_wait = 1,
......@@ -39,31 +35,24 @@ __setup("failslab=", setup_failslab);
static int __init failslab_debugfs_init(void)
mode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
struct dentry *dir;
int err;
err = init_fault_attr_dentries(&failslab.attr, "failslab");
if (err)
return err;
dir = failslab.attr.dir;
failslab.ignore_gfp_wait_file =
debugfs_create_bool("ignore-gfp-wait", mode, dir,
failslab.cache_filter_file =
debugfs_create_bool("cache-filter", mode, dir,
if (!debugfs_create_bool("ignore-gfp-wait", mode, failslab.attr.dir,
goto fail;
if (!debugfs_create_bool("cache-filter", mode, failslab.attr.dir,
goto fail;
if (!failslab.ignore_gfp_wait_file ||
!failslab.cache_filter_file) {
err = -ENOMEM;
return 0;
return err;
return -ENOMEM;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment