diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-12 15:24:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-12 15:24:03 -0400 |
commit | f632a8170a6b667ee4e3f552087588f0fe13c4bb (patch) | |
tree | 9fbdd3505f1471364265727dea1bc9d034cbed8f /lib/fault-inject.c | |
parent | ef8f3d48afd6a17a0dae8c277c2f539c2f19fd16 (diff) | |
parent | c33d442328f556460b79aba6058adb37bb555389 (diff) |
Merge tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core and debugfs updates from Greg KH:
"Here is the "big" driver core and debugfs changes for 5.3-rc1
It's a lot of different patches, all across the tree due to some api
changes and lots of debugfs cleanups.
Other than the debugfs cleanups, in this set of changes we have:
- bus iteration function cleanups
- scripts/get_abi.pl tool to display and parse Documentation/ABI
entries in a simple way
- cleanups to Documenatation/ABI/ entries to make them parse easier
due to typos and other minor things
- default_attrs use for some ktype users
- driver model documentation file conversions to .rst
- compressed firmware file loading
- deferred probe fixes
All of these have been in linux-next for a while, with a bunch of
merge issues that Stephen has been patient with me for"
* tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits)
debugfs: make error message a bit more verbose
orangefs: fix build warning from debugfs cleanup patch
ubifs: fix build warning after debugfs cleanup patch
driver: core: Allow subsystems to continue deferring probe
drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT
arch_topology: Remove error messages on out-of-memory conditions
lib: notifier-error-inject: no need to check return value of debugfs_create functions
swiotlb: no need to check return value of debugfs_create functions
ceph: no need to check return value of debugfs_create functions
sunrpc: no need to check return value of debugfs_create functions
ubifs: no need to check return value of debugfs_create functions
orangefs: no need to check return value of debugfs_create functions
nfsd: no need to check return value of debugfs_create functions
lib: 842: no need to check return value of debugfs_create functions
debugfs: provide pr_fmt() macro
debugfs: log errors when something goes wrong
drivers: s390/cio: Fix compilation warning about const qualifiers
drivers: Add generic helper to match by of_node
driver_find_device: Unify the match function with class_find_device()
bus_find_device: Unify the match callback with class_find_device
...
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r-- | lib/fault-inject.c | 73 |
1 files changed, 26 insertions, 47 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c index 3cb21b2bf088..8186ca84910b 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c | |||
@@ -166,10 +166,10 @@ static int debugfs_ul_get(void *data, u64 *val) | |||
166 | 166 | ||
167 | DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n"); | 167 | DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n"); |
168 | 168 | ||
169 | static struct dentry *debugfs_create_ul(const char *name, umode_t mode, | 169 | static void debugfs_create_ul(const char *name, umode_t mode, |
170 | struct dentry *parent, unsigned long *value) | 170 | struct dentry *parent, unsigned long *value) |
171 | { | 171 | { |
172 | return debugfs_create_file(name, mode, parent, value, &fops_ul); | 172 | debugfs_create_file(name, mode, parent, value, &fops_ul); |
173 | } | 173 | } |
174 | 174 | ||
175 | #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER | 175 | #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER |
@@ -185,12 +185,11 @@ static int debugfs_stacktrace_depth_set(void *data, u64 val) | |||
185 | DEFINE_SIMPLE_ATTRIBUTE(fops_stacktrace_depth, debugfs_ul_get, | 185 | DEFINE_SIMPLE_ATTRIBUTE(fops_stacktrace_depth, debugfs_ul_get, |
186 | debugfs_stacktrace_depth_set, "%llu\n"); | 186 | debugfs_stacktrace_depth_set, "%llu\n"); |
187 | 187 | ||
188 | static struct dentry *debugfs_create_stacktrace_depth( | 188 | static void debugfs_create_stacktrace_depth(const char *name, umode_t mode, |
189 | const char *name, umode_t mode, | 189 | struct dentry *parent, |
190 | struct dentry *parent, unsigned long *value) | 190 | unsigned long *value) |
191 | { | 191 | { |
192 | return debugfs_create_file(name, mode, parent, value, | 192 | debugfs_create_file(name, mode, parent, value, &fops_stacktrace_depth); |
193 | &fops_stacktrace_depth); | ||
194 | } | 193 | } |
195 | 194 | ||
196 | #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ | 195 | #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ |
@@ -202,51 +201,31 @@ struct dentry *fault_create_debugfs_attr(const char *name, | |||
202 | struct dentry *dir; | 201 | struct dentry *dir; |
203 | 202 | ||
204 | dir = debugfs_create_dir(name, parent); | 203 | dir = debugfs_create_dir(name, parent); |
205 | if (!dir) | 204 | if (IS_ERR(dir)) |
206 | return ERR_PTR(-ENOMEM); | 205 | return dir; |
207 | 206 | ||
208 | if (!debugfs_create_ul("probability", mode, dir, &attr->probability)) | 207 | debugfs_create_ul("probability", mode, dir, &attr->probability); |
209 | goto fail; | 208 | debugfs_create_ul("interval", mode, dir, &attr->interval); |
210 | if (!debugfs_create_ul("interval", mode, dir, &attr->interval)) | 209 | debugfs_create_atomic_t("times", mode, dir, &attr->times); |
211 | goto fail; | 210 | debugfs_create_atomic_t("space", mode, dir, &attr->space); |
212 | if (!debugfs_create_atomic_t("times", mode, dir, &attr->times)) | 211 | debugfs_create_ul("verbose", mode, dir, &attr->verbose); |
213 | goto fail; | 212 | debugfs_create_u32("verbose_ratelimit_interval_ms", mode, dir, |
214 | if (!debugfs_create_atomic_t("space", mode, dir, &attr->space)) | 213 | &attr->ratelimit_state.interval); |
215 | goto fail; | 214 | debugfs_create_u32("verbose_ratelimit_burst", mode, dir, |
216 | if (!debugfs_create_ul("verbose", mode, dir, &attr->verbose)) | 215 | &attr->ratelimit_state.burst); |
217 | goto fail; | 216 | debugfs_create_bool("task-filter", mode, dir, &attr->task_filter); |
218 | if (!debugfs_create_u32("verbose_ratelimit_interval_ms", mode, dir, | ||
219 | &attr->ratelimit_state.interval)) | ||
220 | goto fail; | ||
221 | if (!debugfs_create_u32("verbose_ratelimit_burst", mode, dir, | ||
222 | &attr->ratelimit_state.burst)) | ||
223 | goto fail; | ||
224 | if (!debugfs_create_bool("task-filter", mode, dir, &attr->task_filter)) | ||
225 | goto fail; | ||
226 | 217 | ||
227 | #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER | 218 | #ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER |
228 | 219 | debugfs_create_stacktrace_depth("stacktrace-depth", mode, dir, | |
229 | if (!debugfs_create_stacktrace_depth("stacktrace-depth", mode, dir, | 220 | &attr->stacktrace_depth); |
230 | &attr->stacktrace_depth)) | 221 | debugfs_create_ul("require-start", mode, dir, &attr->require_start); |
231 | goto fail; | 222 | debugfs_create_ul("require-end", mode, dir, &attr->require_end); |
232 | if (!debugfs_create_ul("require-start", mode, dir, | 223 | debugfs_create_ul("reject-start", mode, dir, &attr->reject_start); |
233 | &attr->require_start)) | 224 | debugfs_create_ul("reject-end", mode, dir, &attr->reject_end); |
234 | goto fail; | ||
235 | if (!debugfs_create_ul("require-end", mode, dir, &attr->require_end)) | ||
236 | goto fail; | ||
237 | if (!debugfs_create_ul("reject-start", mode, dir, &attr->reject_start)) | ||
238 | goto fail; | ||
239 | if (!debugfs_create_ul("reject-end", mode, dir, &attr->reject_end)) | ||
240 | goto fail; | ||
241 | |||
242 | #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ | 225 | #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ |
243 | 226 | ||
244 | attr->dname = dget(dir); | 227 | attr->dname = dget(dir); |
245 | return dir; | 228 | return dir; |
246 | fail: | ||
247 | debugfs_remove_recursive(dir); | ||
248 | |||
249 | return ERR_PTR(-ENOMEM); | ||
250 | } | 229 | } |
251 | EXPORT_SYMBOL_GPL(fault_create_debugfs_attr); | 230 | EXPORT_SYMBOL_GPL(fault_create_debugfs_attr); |
252 | 231 | ||