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