projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
lib
/
fault-inject.c
diff --git
a/lib/fault-inject.c
b/lib/fault-inject.c
index 0fabd12c39d79786e3bcf0ce1fa3bb68c48d01d9..a50a311554cc30e5e1b5d992988397a33f560ac6 100644
(file)
--- a/
lib/fault-inject.c
+++ b/
lib/fault-inject.c
@@
-72,9
+72,8
@@
static bool fail_stacktrace(struct fault_attr *attr)
trace.entries = entries;
trace.max_entries = depth;
trace.skip = 1;
trace.entries = entries;
trace.max_entries = depth;
trace.skip = 1;
- trace.all_contexts = 0;
- save_stack_trace(&trace
, NULL
);
+ save_stack_trace(&trace);
for (n = 0; n < trace.nr_entries; n++) {
if (attr->reject_start <= entries[n] &&
entries[n] < attr->reject_end)
for (n = 0; n < trace.nr_entries; n++) {
if (attr->reject_start <= entries[n] &&
entries[n] < attr->reject_end)
@@
-135,21
+134,26
@@
bool should_fail(struct fault_attr *attr, ssize_t size)
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
-static
void
debugfs_ul_set(void *data, u64 val)
+static
int
debugfs_ul_set(void *data, u64 val)
{
*(unsigned long *)data = val;
{
*(unsigned long *)data = val;
+ return 0;
}
}
-static void debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val)
+#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;
{
*(unsigned long *)data =
val < MAX_STACK_TRACE_DEPTH ?
val : MAX_STACK_TRACE_DEPTH;
+ return 0;
}
}
+#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
-static
u64 debugfs_ul_get(void *data
)
+static
int debugfs_ul_get(void *data, u64 *val
)
{
{
- return *(unsigned long *)data;
+ *val = *(unsigned long *)data;
+ return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n");
}
DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n");
@@
-160,6
+164,7
@@
static struct dentry *debugfs_create_ul(const char *name, mode_t mode,
return debugfs_create_file(name, mode, parent, value, &fops_ul);
}
return debugfs_create_file(name, mode, parent, value, &fops_ul);
}
+#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");
DEFINE_SIMPLE_ATTRIBUTE(fops_ul_MAX_STACK_TRACE_DEPTH, debugfs_ul_get,
debugfs_ul_set_MAX_STACK_TRACE_DEPTH, "%llu\n");
@@
-170,15
+175,18
@@
static struct dentry *debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
return debugfs_create_file(name, mode, parent, value,
&fops_ul_MAX_STACK_TRACE_DEPTH);
}
return debugfs_create_file(name, mode, parent, value,
&fops_ul_MAX_STACK_TRACE_DEPTH);
}
+#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
-static
void
debugfs_atomic_t_set(void *data, u64 val)
+static
int
debugfs_atomic_t_set(void *data, u64 val)
{
atomic_set((atomic_t *)data, val);
{
atomic_set((atomic_t *)data, val);
+ return 0;
}
}
-static
u64 debugfs_atomic_t_get(void *data
)
+static
int debugfs_atomic_t_get(void *data, u64 *val
)
{
{
- return atomic_read((atomic_t *)data);
+ *val = atomic_read((atomic_t *)data);
+ return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get,
}
DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get,