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