summaryrefslogtreecommitdiffstats
path: root/lib/fault-inject.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-09-19 16:46:07 +0200
committerPekka Enberg <penberg@kernel.org>2011-09-19 16:46:07 +0200
commitd20bbfab01802e195a50435940f7e4aa747c217c (patch)
tree82b0007e33c083050a4e60a49dbb2f5477b4c99d /lib/fault-inject.c
parentslub: doc: update the slabinfo.c file path (diff)
parentslub: explicitly document position of inserting slab to partial list (diff)
downloadlinux-d20bbfab01802e195a50435940f7e4aa747c217c.tar.xz
linux-d20bbfab01802e195a50435940f7e4aa747c217c.zip
Merge branch 'slab/urgent' into slab/next
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r--lib/fault-inject.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index 2577b121c7c1..f193b7796449 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -197,21 +197,15 @@ static struct dentry *debugfs_create_atomic_t(const char *name, mode_t mode,
return debugfs_create_file(name, mode, parent, value, &fops_atomic_t);
}
-void cleanup_fault_attr_dentries(struct fault_attr *attr)
-{
- debugfs_remove_recursive(attr->dir);
-}
-
-int init_fault_attr_dentries(struct fault_attr *attr, const char *name)
+struct dentry *fault_create_debugfs_attr(const char *name,
+ struct dentry *parent, struct fault_attr *attr)
{
mode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
struct dentry *dir;
- dir = debugfs_create_dir(name, NULL);
+ dir = debugfs_create_dir(name, parent);
if (!dir)
- return -ENOMEM;
-
- attr->dir = dir;
+ return ERR_PTR(-ENOMEM);
if (!debugfs_create_ul("probability", mode, dir, &attr->probability))
goto fail;
@@ -243,11 +237,11 @@ int init_fault_attr_dentries(struct fault_attr *attr, const char *name)
#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
- return 0;
+ return dir;
fail:
- debugfs_remove_recursive(attr->dir);
+ debugfs_remove_recursive(dir);
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
}
#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */