1c59d87c4SChristoph Hellwig /* 2c59d87c4SChristoph Hellwig * Copyright (c) 2001-2005 Silicon Graphics, Inc. 3c59d87c4SChristoph Hellwig * All Rights Reserved. 4c59d87c4SChristoph Hellwig * 5c59d87c4SChristoph Hellwig * This program is free software; you can redistribute it and/or 6c59d87c4SChristoph Hellwig * modify it under the terms of the GNU General Public License as 7c59d87c4SChristoph Hellwig * published by the Free Software Foundation. 8c59d87c4SChristoph Hellwig * 9c59d87c4SChristoph Hellwig * This program is distributed in the hope that it would be useful, 10c59d87c4SChristoph Hellwig * but WITHOUT ANY WARRANTY; without even the implied warranty of 11c59d87c4SChristoph Hellwig * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12c59d87c4SChristoph Hellwig * GNU General Public License for more details. 13c59d87c4SChristoph Hellwig * 14c59d87c4SChristoph Hellwig * You should have received a copy of the GNU General Public License 15c59d87c4SChristoph Hellwig * along with this program; if not, write the Free Software Foundation, 16c59d87c4SChristoph Hellwig * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17c59d87c4SChristoph Hellwig */ 18c59d87c4SChristoph Hellwig #ifndef __XFS_SYSCTL_H__ 19c59d87c4SChristoph Hellwig #define __XFS_SYSCTL_H__ 20c59d87c4SChristoph Hellwig 21c59d87c4SChristoph Hellwig #include <linux/sysctl.h> 22c59d87c4SChristoph Hellwig 23c59d87c4SChristoph Hellwig /* 24c59d87c4SChristoph Hellwig * Tunable xfs parameters 25c59d87c4SChristoph Hellwig */ 26c59d87c4SChristoph Hellwig 27c59d87c4SChristoph Hellwig typedef struct xfs_sysctl_val { 28c59d87c4SChristoph Hellwig int min; 29c59d87c4SChristoph Hellwig int val; 30c59d87c4SChristoph Hellwig int max; 31c59d87c4SChristoph Hellwig } xfs_sysctl_val_t; 32c59d87c4SChristoph Hellwig 33c59d87c4SChristoph Hellwig typedef struct xfs_param { 34c59d87c4SChristoph Hellwig xfs_sysctl_val_t sgid_inherit; /* Inherit S_ISGID if process' GID is 35c59d87c4SChristoph Hellwig * not a member of parent dir GID. */ 36c59d87c4SChristoph Hellwig xfs_sysctl_val_t symlink_mode; /* Link creat mode affected by umask */ 37c59d87c4SChristoph Hellwig xfs_sysctl_val_t panic_mask; /* bitmask to cause panic on errors. */ 38c59d87c4SChristoph Hellwig xfs_sysctl_val_t error_level; /* Degree of reporting for problems */ 39c59d87c4SChristoph Hellwig xfs_sysctl_val_t syncd_timer; /* Interval between xfssyncd wakeups */ 40c59d87c4SChristoph Hellwig xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */ 41c59d87c4SChristoph Hellwig xfs_sysctl_val_t inherit_sync; /* Inherit the "sync" inode flag. */ 42c59d87c4SChristoph Hellwig xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */ 43c59d87c4SChristoph Hellwig xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */ 44c59d87c4SChristoph Hellwig xfs_sysctl_val_t xfs_buf_timer; /* Interval between xfsbufd wakeups. */ 45c59d87c4SChristoph Hellwig xfs_sysctl_val_t xfs_buf_age; /* Metadata buffer age before flush. */ 46c59d87c4SChristoph Hellwig xfs_sysctl_val_t inherit_nosym; /* Inherit the "nosymlinks" flag. */ 47c59d87c4SChristoph Hellwig xfs_sysctl_val_t rotorstep; /* inode32 AG rotoring control knob */ 48c59d87c4SChristoph Hellwig xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */ 49c59d87c4SChristoph Hellwig xfs_sysctl_val_t fstrm_timer; /* Filestream dir-AG assoc'n timeout. */ 50579b62faSBrian Foster xfs_sysctl_val_t eofb_timer; /* Interval between eofb scan wakeups */ 5183104d44SDarrick J. Wong xfs_sysctl_val_t cowb_timer; /* Interval between cowb scan wakeups */ 52c59d87c4SChristoph Hellwig } xfs_param_t; 53c59d87c4SChristoph Hellwig 54c59d87c4SChristoph Hellwig /* 55c59d87c4SChristoph Hellwig * xfs_error_level: 56c59d87c4SChristoph Hellwig * 57c59d87c4SChristoph Hellwig * How much error reporting will be done when internal problems are 58c59d87c4SChristoph Hellwig * encountered. These problems normally return an EFSCORRUPTED to their 59c59d87c4SChristoph Hellwig * caller, with no other information reported. 60c59d87c4SChristoph Hellwig * 61c59d87c4SChristoph Hellwig * 0 No error reports 62c59d87c4SChristoph Hellwig * 1 Report EFSCORRUPTED errors that will cause a filesystem shutdown 63c59d87c4SChristoph Hellwig * 5 Report all EFSCORRUPTED errors (all of the above errors, plus any 64c59d87c4SChristoph Hellwig * additional errors that are known to not cause shutdowns) 65c59d87c4SChristoph Hellwig * 66c59d87c4SChristoph Hellwig * xfs_panic_mask bit 0x8 turns the error reports into panics 67c59d87c4SChristoph Hellwig */ 68c59d87c4SChristoph Hellwig 69c59d87c4SChristoph Hellwig enum { 70c59d87c4SChristoph Hellwig /* XFS_REFCACHE_SIZE = 1 */ 71c59d87c4SChristoph Hellwig /* XFS_REFCACHE_PURGE = 2 */ 72c59d87c4SChristoph Hellwig /* XFS_RESTRICT_CHOWN = 3 */ 73c59d87c4SChristoph Hellwig XFS_SGID_INHERIT = 4, 74c59d87c4SChristoph Hellwig XFS_SYMLINK_MODE = 5, 75c59d87c4SChristoph Hellwig XFS_PANIC_MASK = 6, 76c59d87c4SChristoph Hellwig XFS_ERRLEVEL = 7, 77c59d87c4SChristoph Hellwig XFS_SYNCD_TIMER = 8, 78c59d87c4SChristoph Hellwig /* XFS_PROBE_DMAPI = 9 */ 79c59d87c4SChristoph Hellwig /* XFS_PROBE_IOOPS = 10 */ 80c59d87c4SChristoph Hellwig /* XFS_PROBE_QUOTA = 11 */ 81c59d87c4SChristoph Hellwig XFS_STATS_CLEAR = 12, 82c59d87c4SChristoph Hellwig XFS_INHERIT_SYNC = 13, 83c59d87c4SChristoph Hellwig XFS_INHERIT_NODUMP = 14, 84c59d87c4SChristoph Hellwig XFS_INHERIT_NOATIME = 15, 85c59d87c4SChristoph Hellwig XFS_BUF_TIMER = 16, 86c59d87c4SChristoph Hellwig XFS_BUF_AGE = 17, 87c59d87c4SChristoph Hellwig /* XFS_IO_BYPASS = 18 */ 88c59d87c4SChristoph Hellwig XFS_INHERIT_NOSYM = 19, 89c59d87c4SChristoph Hellwig XFS_ROTORSTEP = 20, 90c59d87c4SChristoph Hellwig XFS_INHERIT_NODFRG = 21, 91c59d87c4SChristoph Hellwig XFS_FILESTREAM_TIMER = 22, 92c59d87c4SChristoph Hellwig }; 93c59d87c4SChristoph Hellwig 94c59d87c4SChristoph Hellwig extern xfs_param_t xfs_params; 95c59d87c4SChristoph Hellwig 962e227178SBrian Foster struct xfs_globals { 972e227178SBrian Foster int log_recovery_delay; /* log recovery delay (secs) */ 98*ccdab3d6SBrian Foster bool bug_on_assert; /* BUG() the kernel on assert failure */ 992e227178SBrian Foster }; 1002e227178SBrian Foster extern struct xfs_globals xfs_globals; 1012e227178SBrian Foster 102c59d87c4SChristoph Hellwig #ifdef CONFIG_SYSCTL 103c59d87c4SChristoph Hellwig extern int xfs_sysctl_register(void); 104c59d87c4SChristoph Hellwig extern void xfs_sysctl_unregister(void); 105c59d87c4SChristoph Hellwig #else 106c59d87c4SChristoph Hellwig # define xfs_sysctl_register() (0) 107c59d87c4SChristoph Hellwig # define xfs_sysctl_unregister() do { } while (0) 108c59d87c4SChristoph Hellwig #endif /* CONFIG_SYSCTL */ 109c59d87c4SChristoph Hellwig 110c59d87c4SChristoph Hellwig #endif /* __XFS_SYSCTL_H__ */ 111