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