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