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. */ 38579b62faSBrian Foster xfs_sysctl_val_t eofb_timer; /* Interval between eofb scan wakeups */ 3983104d44SDarrick J. Wong xfs_sysctl_val_t cowb_timer; /* Interval between cowb scan wakeups */ 40c59d87c4SChristoph Hellwig } xfs_param_t; 41c59d87c4SChristoph Hellwig 42c59d87c4SChristoph Hellwig /* 43c59d87c4SChristoph Hellwig * xfs_error_level: 44c59d87c4SChristoph Hellwig * 45c59d87c4SChristoph Hellwig * How much error reporting will be done when internal problems are 46c59d87c4SChristoph Hellwig * encountered. These problems normally return an EFSCORRUPTED to their 47c59d87c4SChristoph Hellwig * caller, with no other information reported. 48c59d87c4SChristoph Hellwig * 49c59d87c4SChristoph Hellwig * 0 No error reports 50c59d87c4SChristoph Hellwig * 1 Report EFSCORRUPTED errors that will cause a filesystem shutdown 51c59d87c4SChristoph Hellwig * 5 Report all EFSCORRUPTED errors (all of the above errors, plus any 52c59d87c4SChristoph Hellwig * additional errors that are known to not cause shutdowns) 53c59d87c4SChristoph Hellwig * 54c59d87c4SChristoph Hellwig * xfs_panic_mask bit 0x8 turns the error reports into panics 55c59d87c4SChristoph Hellwig */ 56c59d87c4SChristoph Hellwig 57c59d87c4SChristoph Hellwig enum { 58c59d87c4SChristoph Hellwig /* XFS_REFCACHE_SIZE = 1 */ 59c59d87c4SChristoph Hellwig /* XFS_REFCACHE_PURGE = 2 */ 60c59d87c4SChristoph Hellwig /* XFS_RESTRICT_CHOWN = 3 */ 61c59d87c4SChristoph Hellwig XFS_SGID_INHERIT = 4, 62c59d87c4SChristoph Hellwig XFS_SYMLINK_MODE = 5, 63c59d87c4SChristoph Hellwig XFS_PANIC_MASK = 6, 64c59d87c4SChristoph Hellwig XFS_ERRLEVEL = 7, 65c59d87c4SChristoph Hellwig XFS_SYNCD_TIMER = 8, 66c59d87c4SChristoph Hellwig /* XFS_PROBE_DMAPI = 9 */ 67c59d87c4SChristoph Hellwig /* XFS_PROBE_IOOPS = 10 */ 68c59d87c4SChristoph Hellwig /* XFS_PROBE_QUOTA = 11 */ 69c59d87c4SChristoph Hellwig XFS_STATS_CLEAR = 12, 70c59d87c4SChristoph Hellwig XFS_INHERIT_SYNC = 13, 71c59d87c4SChristoph Hellwig XFS_INHERIT_NODUMP = 14, 72c59d87c4SChristoph Hellwig XFS_INHERIT_NOATIME = 15, 73c59d87c4SChristoph Hellwig XFS_BUF_TIMER = 16, 74c59d87c4SChristoph Hellwig XFS_BUF_AGE = 17, 75c59d87c4SChristoph Hellwig /* XFS_IO_BYPASS = 18 */ 76c59d87c4SChristoph Hellwig XFS_INHERIT_NOSYM = 19, 77c59d87c4SChristoph Hellwig XFS_ROTORSTEP = 20, 78c59d87c4SChristoph Hellwig XFS_INHERIT_NODFRG = 21, 79c59d87c4SChristoph Hellwig XFS_FILESTREAM_TIMER = 22, 80c59d87c4SChristoph Hellwig }; 81c59d87c4SChristoph Hellwig 82c59d87c4SChristoph Hellwig extern xfs_param_t xfs_params; 83c59d87c4SChristoph Hellwig 842e227178SBrian Foster struct xfs_globals { 852e227178SBrian Foster int log_recovery_delay; /* log recovery delay (secs) */ 86dae5cd81SDave Chinner int mount_delay; /* mount setup delay (secs) */ 87ccdab3d6SBrian Foster bool bug_on_assert; /* BUG() the kernel on assert failure */ 88*66ae56a5SChristoph Hellwig bool always_cow; /* use COW fork for all overwrites */ 892e227178SBrian Foster }; 902e227178SBrian Foster extern struct xfs_globals xfs_globals; 912e227178SBrian Foster 92c59d87c4SChristoph Hellwig #ifdef CONFIG_SYSCTL 93c59d87c4SChristoph Hellwig extern int xfs_sysctl_register(void); 94c59d87c4SChristoph Hellwig extern void xfs_sysctl_unregister(void); 95c59d87c4SChristoph Hellwig #else 96c59d87c4SChristoph Hellwig # define xfs_sysctl_register() (0) 97c59d87c4SChristoph Hellwig # define xfs_sysctl_unregister() do { } while (0) 98c59d87c4SChristoph Hellwig #endif /* CONFIG_SYSCTL */ 99c59d87c4SChristoph Hellwig 100c59d87c4SChristoph Hellwig #endif /* __XFS_SYSCTL_H__ */ 101