Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260440
b: refs/heads/master
c: 8307fc2
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Jul 26, 2011
1 parent f236156 commit 4ca083c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b16f748a0d4546726bb53cad58525adfd6425e9
refs/heads/master: 8307fc257cf3931d87e172bd8663e80c3d1e56a3
30 changes: 15 additions & 15 deletions trunk/lib/fault-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ static int debugfs_ul_set(void *data, u64 val)
return 0;
}

#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
static int debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val)
{
*(unsigned long *)data =
val < MAX_STACK_TRACE_DEPTH ?
val : MAX_STACK_TRACE_DEPTH;
return 0;
}
#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */

static int debugfs_ul_get(void *data, u64 *val)
{
*val = *(unsigned long *)data;
Expand All @@ -164,16 +154,26 @@ static struct dentry *debugfs_create_ul(const char *name, mode_t mode,
}

#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
DEFINE_SIMPLE_ATTRIBUTE(fops_ul_MAX_STACK_TRACE_DEPTH, debugfs_ul_get,
debugfs_ul_set_MAX_STACK_TRACE_DEPTH, "%llu\n");

static struct dentry *debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
static int debugfs_stacktrace_depth_set(void *data, u64 val)
{
*(unsigned long *)data =
min_t(unsigned long, val, MAX_STACK_TRACE_DEPTH);

return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(fops_stacktrace_depth, debugfs_ul_get,
debugfs_stacktrace_depth_set, "%llu\n");

static struct dentry *debugfs_create_stacktrace_depth(
const char *name, mode_t mode,
struct dentry *parent, unsigned long *value)
{
return debugfs_create_file(name, mode, parent, value,
&fops_ul_MAX_STACK_TRACE_DEPTH);
&fops_stacktrace_depth);
}

#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */

static int debugfs_atomic_t_set(void *data, u64 val)
Expand Down Expand Up @@ -281,7 +281,7 @@ int init_fault_attr_dentries(struct fault_attr *attr, const char *name)
#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER

attr->dentries.stacktrace_depth_file =
debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
debugfs_create_stacktrace_depth(
"stacktrace-depth", mode, dir, &attr->stacktrace_depth);

attr->dentries.require_start_file =
Expand Down

0 comments on commit 4ca083c

Please sign in to comment.