xref: /linux/fs/xfs/xfs_sysctl.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
10b61f8a4SDave Chinner // SPDX-License-Identifier: GPL-2.0
2c59d87c4SChristoph Hellwig /*
3c59d87c4SChristoph Hellwig  * Copyright (c) 2001-2005 Silicon Graphics, Inc.
4c59d87c4SChristoph Hellwig  * All Rights Reserved.
5c59d87c4SChristoph Hellwig  */
6c59d87c4SChristoph Hellwig #ifndef __XFS_SYSCTL_H__
7c59d87c4SChristoph Hellwig #define __XFS_SYSCTL_H__
8c59d87c4SChristoph Hellwig 
9c59d87c4SChristoph Hellwig #include <linux/sysctl.h>
10c59d87c4SChristoph Hellwig 
11c59d87c4SChristoph Hellwig /*
12c59d87c4SChristoph Hellwig  * Tunable xfs parameters
13c59d87c4SChristoph Hellwig  */
14c59d87c4SChristoph Hellwig 
15c59d87c4SChristoph Hellwig typedef struct xfs_sysctl_val {
16c59d87c4SChristoph Hellwig 	int min;
17c59d87c4SChristoph Hellwig 	int val;
18c59d87c4SChristoph Hellwig 	int max;
19c59d87c4SChristoph Hellwig } xfs_sysctl_val_t;
20c59d87c4SChristoph Hellwig 
21c59d87c4SChristoph Hellwig typedef struct xfs_param {
22c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t sgid_inherit;	/* Inherit S_ISGID if process' GID is
23c59d87c4SChristoph Hellwig 					 * not a member of parent dir GID. */
24c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t symlink_mode;	/* Link creat mode affected by umask */
25c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t panic_mask;	/* bitmask to cause panic on errors. */
26c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t error_level;	/* Degree of reporting for problems  */
27c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t syncd_timer;	/* Interval between xfssyncd wakeups */
28c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t stats_clear;	/* Reset all XFS statistics to zero. */
29c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t inherit_sync;	/* Inherit the "sync" inode flag. */
30c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */
31c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */
32c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t xfs_buf_timer;	/* Interval between xfsbufd wakeups. */
33c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t xfs_buf_age;	/* Metadata buffer age before flush. */
34c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t inherit_nosym;	/* Inherit the "nosymlinks" flag. */
35c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t rotorstep;	/* inode32 AG rotoring control knob */
36c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */
37c59d87c4SChristoph Hellwig 	xfs_sysctl_val_t fstrm_timer;	/* Filestream dir-AG assoc'n timeout. */
389669f51dSDarrick J. Wong 	xfs_sysctl_val_t blockgc_timer;	/* Interval between blockgc scans */
39c59d87c4SChristoph Hellwig } xfs_param_t;
40c59d87c4SChristoph Hellwig 
41c59d87c4SChristoph Hellwig /*
42c59d87c4SChristoph Hellwig  * xfs_error_level:
43c59d87c4SChristoph Hellwig  *
44c59d87c4SChristoph Hellwig  * How much error reporting will be done when internal problems are
45c59d87c4SChristoph Hellwig  * encountered.  These problems normally return an EFSCORRUPTED to their
46c59d87c4SChristoph Hellwig  * caller, with no other information reported.
47c59d87c4SChristoph Hellwig  *
48c59d87c4SChristoph Hellwig  * 0	No error reports
49c59d87c4SChristoph Hellwig  * 1	Report EFSCORRUPTED errors that will cause a filesystem shutdown
50c59d87c4SChristoph Hellwig  * 5	Report all EFSCORRUPTED errors (all of the above errors, plus any
51c59d87c4SChristoph Hellwig  *	additional errors that are known to not cause shutdowns)
52c59d87c4SChristoph Hellwig  *
53c59d87c4SChristoph Hellwig  * xfs_panic_mask bit 0x8 turns the error reports into panics
54c59d87c4SChristoph Hellwig  */
55c59d87c4SChristoph Hellwig 
56c59d87c4SChristoph Hellwig enum {
57c59d87c4SChristoph Hellwig 	/* XFS_REFCACHE_SIZE = 1 */
58c59d87c4SChristoph Hellwig 	/* XFS_REFCACHE_PURGE = 2 */
59c59d87c4SChristoph Hellwig 	/* XFS_RESTRICT_CHOWN = 3 */
60c59d87c4SChristoph Hellwig 	XFS_SGID_INHERIT = 4,
61c59d87c4SChristoph Hellwig 	XFS_SYMLINK_MODE = 5,
62c59d87c4SChristoph Hellwig 	XFS_PANIC_MASK = 6,
63c59d87c4SChristoph Hellwig 	XFS_ERRLEVEL = 7,
64c59d87c4SChristoph Hellwig 	XFS_SYNCD_TIMER = 8,
65c59d87c4SChristoph Hellwig 	/* XFS_PROBE_DMAPI = 9 */
66c59d87c4SChristoph Hellwig 	/* XFS_PROBE_IOOPS = 10 */
67c59d87c4SChristoph Hellwig 	/* XFS_PROBE_QUOTA = 11 */
68c59d87c4SChristoph Hellwig 	XFS_STATS_CLEAR = 12,
69c59d87c4SChristoph Hellwig 	XFS_INHERIT_SYNC = 13,
70c59d87c4SChristoph Hellwig 	XFS_INHERIT_NODUMP = 14,
71c59d87c4SChristoph Hellwig 	XFS_INHERIT_NOATIME = 15,
72c59d87c4SChristoph Hellwig 	XFS_BUF_TIMER = 16,
73c59d87c4SChristoph Hellwig 	XFS_BUF_AGE = 17,
74c59d87c4SChristoph Hellwig 	/* XFS_IO_BYPASS = 18 */
75c59d87c4SChristoph Hellwig 	XFS_INHERIT_NOSYM = 19,
76c59d87c4SChristoph Hellwig 	XFS_ROTORSTEP = 20,
77c59d87c4SChristoph Hellwig 	XFS_INHERIT_NODFRG = 21,
78c59d87c4SChristoph Hellwig 	XFS_FILESTREAM_TIMER = 22,
79c59d87c4SChristoph Hellwig };
80c59d87c4SChristoph Hellwig 
81c59d87c4SChristoph Hellwig extern xfs_param_t	xfs_params;
82c59d87c4SChristoph Hellwig 
832e227178SBrian Foster struct xfs_globals {
8440786717SDarrick J. Wong #ifdef DEBUG
8540786717SDarrick J. Wong 	int	pwork_threads;		/* parallel workqueue threads */
86535e2f75SAllison Henderson 	bool	larp;			/* log attribute replay */
8740786717SDarrick J. Wong #endif
88*a20ffa7dSDarrick J. Wong 	int	bload_leaf_slack;	/* btree bulk load leaf slack */
89*a20ffa7dSDarrick J. Wong 	int	bload_node_slack;	/* btree bulk load node slack */
902e227178SBrian Foster 	int	log_recovery_delay;	/* log recovery delay (secs) */
91dae5cd81SDave Chinner 	int	mount_delay;		/* mount setup delay (secs) */
92ccdab3d6SBrian Foster 	bool	bug_on_assert;		/* BUG() the kernel on assert failure */
9366ae56a5SChristoph Hellwig 	bool	always_cow;		/* use COW fork for all overwrites */
942e227178SBrian Foster };
952e227178SBrian Foster extern struct xfs_globals	xfs_globals;
962e227178SBrian Foster 
97c59d87c4SChristoph Hellwig #ifdef CONFIG_SYSCTL
98c59d87c4SChristoph Hellwig extern int xfs_sysctl_register(void);
99c59d87c4SChristoph Hellwig extern void xfs_sysctl_unregister(void);
100c59d87c4SChristoph Hellwig #else
101c59d87c4SChristoph Hellwig # define xfs_sysctl_register()		(0)
102c59d87c4SChristoph Hellwig # define xfs_sysctl_unregister()	do { } while (0)
103c59d87c4SChristoph Hellwig #endif /* CONFIG_SYSCTL */
104c59d87c4SChristoph Hellwig 
105c59d87c4SChristoph Hellwig #endif /* __XFS_SYSCTL_H__ */
106