xfs_sysfs.c (250d4b4c409778bc44577dfc59909935c92fd006) xfs_sysfs.c (40786717c88c2d4cb426cc2eb99ac50000e5a910)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2014 Red Hat, Inc.
4 * All Rights Reserved.
5 */
6
7#include "xfs.h"
8#include "xfs_shared.h"

--- 190 unchanged lines hidden (view full) ---

199always_cow_show(
200 struct kobject *kobject,
201 char *buf)
202{
203 return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.always_cow);
204}
205XFS_SYSFS_ATTR_RW(always_cow);
206
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2014 Red Hat, Inc.
4 * All Rights Reserved.
5 */
6
7#include "xfs.h"
8#include "xfs_shared.h"

--- 190 unchanged lines hidden (view full) ---

199always_cow_show(
200 struct kobject *kobject,
201 char *buf)
202{
203 return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.always_cow);
204}
205XFS_SYSFS_ATTR_RW(always_cow);
206
207#ifdef DEBUG
208/*
209 * Override how many threads the parallel work queue is allowed to create.
210 * This has to be a debug-only global (instead of an errortag) because one of
211 * the main users of parallel workqueues is mount time quotacheck.
212 */
213STATIC ssize_t
214pwork_threads_store(
215 struct kobject *kobject,
216 const char *buf,
217 size_t count)
218{
219 int ret;
220 int val;
221
222 ret = kstrtoint(buf, 0, &val);
223 if (ret)
224 return ret;
225
226 if (val < -1 || val > num_possible_cpus())
227 return -EINVAL;
228
229 xfs_globals.pwork_threads = val;
230
231 return count;
232}
233
234STATIC ssize_t
235pwork_threads_show(
236 struct kobject *kobject,
237 char *buf)
238{
239 return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.pwork_threads);
240}
241XFS_SYSFS_ATTR_RW(pwork_threads);
242#endif /* DEBUG */
243
207static struct attribute *xfs_dbg_attrs[] = {
208 ATTR_LIST(bug_on_assert),
209 ATTR_LIST(log_recovery_delay),
210 ATTR_LIST(mount_delay),
211 ATTR_LIST(always_cow),
244static struct attribute *xfs_dbg_attrs[] = {
245 ATTR_LIST(bug_on_assert),
246 ATTR_LIST(log_recovery_delay),
247 ATTR_LIST(mount_delay),
248 ATTR_LIST(always_cow),
249#ifdef DEBUG
250 ATTR_LIST(pwork_threads),
251#endif
212 NULL,
213};
214
215struct kobj_type xfs_dbg_ktype = {
216 .release = xfs_sysfs_release,
217 .sysfs_ops = &xfs_sysfs_ops,
218 .default_attrs = xfs_dbg_attrs,
219};

--- 456 unchanged lines hidden ---
252 NULL,
253};
254
255struct kobj_type xfs_dbg_ktype = {
256 .release = xfs_sysfs_release,
257 .sysfs_ops = &xfs_sysfs_ops,
258 .default_attrs = xfs_dbg_attrs,
259};

--- 456 unchanged lines hidden ---