162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2001-2005 Silicon Graphics, Inc. 462306a36Sopenharmony_ci * All Rights Reserved. 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci#ifndef __XFS_SYSCTL_H__ 762306a36Sopenharmony_ci#define __XFS_SYSCTL_H__ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <linux/sysctl.h> 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* 1262306a36Sopenharmony_ci * Tunable xfs parameters 1362306a36Sopenharmony_ci */ 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_citypedef struct xfs_sysctl_val { 1662306a36Sopenharmony_ci int min; 1762306a36Sopenharmony_ci int val; 1862306a36Sopenharmony_ci int max; 1962306a36Sopenharmony_ci} xfs_sysctl_val_t; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_citypedef struct xfs_param { 2262306a36Sopenharmony_ci xfs_sysctl_val_t sgid_inherit; /* Inherit S_ISGID if process' GID is 2362306a36Sopenharmony_ci * not a member of parent dir GID. */ 2462306a36Sopenharmony_ci xfs_sysctl_val_t symlink_mode; /* Link creat mode affected by umask */ 2562306a36Sopenharmony_ci xfs_sysctl_val_t panic_mask; /* bitmask to cause panic on errors. */ 2662306a36Sopenharmony_ci xfs_sysctl_val_t error_level; /* Degree of reporting for problems */ 2762306a36Sopenharmony_ci xfs_sysctl_val_t syncd_timer; /* Interval between xfssyncd wakeups */ 2862306a36Sopenharmony_ci xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */ 2962306a36Sopenharmony_ci xfs_sysctl_val_t inherit_sync; /* Inherit the "sync" inode flag. */ 3062306a36Sopenharmony_ci xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */ 3162306a36Sopenharmony_ci xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */ 3262306a36Sopenharmony_ci xfs_sysctl_val_t xfs_buf_timer; /* Interval between xfsbufd wakeups. */ 3362306a36Sopenharmony_ci xfs_sysctl_val_t xfs_buf_age; /* Metadata buffer age before flush. */ 3462306a36Sopenharmony_ci xfs_sysctl_val_t inherit_nosym; /* Inherit the "nosymlinks" flag. */ 3562306a36Sopenharmony_ci xfs_sysctl_val_t rotorstep; /* inode32 AG rotoring control knob */ 3662306a36Sopenharmony_ci xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */ 3762306a36Sopenharmony_ci xfs_sysctl_val_t fstrm_timer; /* Filestream dir-AG assoc'n timeout. */ 3862306a36Sopenharmony_ci xfs_sysctl_val_t blockgc_timer; /* Interval between blockgc scans */ 3962306a36Sopenharmony_ci} xfs_param_t; 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci/* 4262306a36Sopenharmony_ci * xfs_error_level: 4362306a36Sopenharmony_ci * 4462306a36Sopenharmony_ci * How much error reporting will be done when internal problems are 4562306a36Sopenharmony_ci * encountered. These problems normally return an EFSCORRUPTED to their 4662306a36Sopenharmony_ci * caller, with no other information reported. 4762306a36Sopenharmony_ci * 4862306a36Sopenharmony_ci * 0 No error reports 4962306a36Sopenharmony_ci * 1 Report EFSCORRUPTED errors that will cause a filesystem shutdown 5062306a36Sopenharmony_ci * 5 Report all EFSCORRUPTED errors (all of the above errors, plus any 5162306a36Sopenharmony_ci * additional errors that are known to not cause shutdowns) 5262306a36Sopenharmony_ci * 5362306a36Sopenharmony_ci * xfs_panic_mask bit 0x8 turns the error reports into panics 5462306a36Sopenharmony_ci */ 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_cienum { 5762306a36Sopenharmony_ci /* XFS_REFCACHE_SIZE = 1 */ 5862306a36Sopenharmony_ci /* XFS_REFCACHE_PURGE = 2 */ 5962306a36Sopenharmony_ci /* XFS_RESTRICT_CHOWN = 3 */ 6062306a36Sopenharmony_ci XFS_SGID_INHERIT = 4, 6162306a36Sopenharmony_ci XFS_SYMLINK_MODE = 5, 6262306a36Sopenharmony_ci XFS_PANIC_MASK = 6, 6362306a36Sopenharmony_ci XFS_ERRLEVEL = 7, 6462306a36Sopenharmony_ci XFS_SYNCD_TIMER = 8, 6562306a36Sopenharmony_ci /* XFS_PROBE_DMAPI = 9 */ 6662306a36Sopenharmony_ci /* XFS_PROBE_IOOPS = 10 */ 6762306a36Sopenharmony_ci /* XFS_PROBE_QUOTA = 11 */ 6862306a36Sopenharmony_ci XFS_STATS_CLEAR = 12, 6962306a36Sopenharmony_ci XFS_INHERIT_SYNC = 13, 7062306a36Sopenharmony_ci XFS_INHERIT_NODUMP = 14, 7162306a36Sopenharmony_ci XFS_INHERIT_NOATIME = 15, 7262306a36Sopenharmony_ci XFS_BUF_TIMER = 16, 7362306a36Sopenharmony_ci XFS_BUF_AGE = 17, 7462306a36Sopenharmony_ci /* XFS_IO_BYPASS = 18 */ 7562306a36Sopenharmony_ci XFS_INHERIT_NOSYM = 19, 7662306a36Sopenharmony_ci XFS_ROTORSTEP = 20, 7762306a36Sopenharmony_ci XFS_INHERIT_NODFRG = 21, 7862306a36Sopenharmony_ci XFS_FILESTREAM_TIMER = 22, 7962306a36Sopenharmony_ci}; 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciextern xfs_param_t xfs_params; 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_cistruct xfs_globals { 8462306a36Sopenharmony_ci#ifdef DEBUG 8562306a36Sopenharmony_ci int pwork_threads; /* parallel workqueue threads */ 8662306a36Sopenharmony_ci bool larp; /* log attribute replay */ 8762306a36Sopenharmony_ci#endif 8862306a36Sopenharmony_ci int log_recovery_delay; /* log recovery delay (secs) */ 8962306a36Sopenharmony_ci int mount_delay; /* mount setup delay (secs) */ 9062306a36Sopenharmony_ci bool bug_on_assert; /* BUG() the kernel on assert failure */ 9162306a36Sopenharmony_ci bool always_cow; /* use COW fork for all overwrites */ 9262306a36Sopenharmony_ci}; 9362306a36Sopenharmony_ciextern struct xfs_globals xfs_globals; 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci#ifdef CONFIG_SYSCTL 9662306a36Sopenharmony_ciextern int xfs_sysctl_register(void); 9762306a36Sopenharmony_ciextern void xfs_sysctl_unregister(void); 9862306a36Sopenharmony_ci#else 9962306a36Sopenharmony_ci# define xfs_sysctl_register() (0) 10062306a36Sopenharmony_ci# define xfs_sysctl_unregister() do { } while (0) 10162306a36Sopenharmony_ci#endif /* CONFIG_SYSCTL */ 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#endif /* __XFS_SYSCTL_H__ */ 104