Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (c) 2001-2005 Silicon Graphics, Inc.
0004  * All Rights Reserved.
0005  */
0006 #ifndef __XFS_SYSCTL_H__
0007 #define __XFS_SYSCTL_H__
0008 
0009 #include <linux/sysctl.h>
0010 
0011 /*
0012  * Tunable xfs parameters
0013  */
0014 
0015 typedef struct xfs_sysctl_val {
0016     int min;
0017     int val;
0018     int max;
0019 } xfs_sysctl_val_t;
0020 
0021 typedef struct xfs_param {
0022     xfs_sysctl_val_t sgid_inherit;  /* Inherit S_ISGID if process' GID is
0023                      * not a member of parent dir GID. */
0024     xfs_sysctl_val_t symlink_mode;  /* Link creat mode affected by umask */
0025     xfs_sysctl_val_t panic_mask;    /* bitmask to cause panic on errors. */
0026     xfs_sysctl_val_t error_level;   /* Degree of reporting for problems  */
0027     xfs_sysctl_val_t syncd_timer;   /* Interval between xfssyncd wakeups */
0028     xfs_sysctl_val_t stats_clear;   /* Reset all XFS statistics to zero. */
0029     xfs_sysctl_val_t inherit_sync;  /* Inherit the "sync" inode flag. */
0030     xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */
0031     xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */
0032     xfs_sysctl_val_t xfs_buf_timer; /* Interval between xfsbufd wakeups. */
0033     xfs_sysctl_val_t xfs_buf_age;   /* Metadata buffer age before flush. */
0034     xfs_sysctl_val_t inherit_nosym; /* Inherit the "nosymlinks" flag. */
0035     xfs_sysctl_val_t rotorstep; /* inode32 AG rotoring control knob */
0036     xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */
0037     xfs_sysctl_val_t fstrm_timer;   /* Filestream dir-AG assoc'n timeout. */
0038     xfs_sysctl_val_t blockgc_timer; /* Interval between blockgc scans */
0039 } xfs_param_t;
0040 
0041 /*
0042  * xfs_error_level:
0043  *
0044  * How much error reporting will be done when internal problems are
0045  * encountered.  These problems normally return an EFSCORRUPTED to their
0046  * caller, with no other information reported.
0047  *
0048  * 0    No error reports
0049  * 1    Report EFSCORRUPTED errors that will cause a filesystem shutdown
0050  * 5    Report all EFSCORRUPTED errors (all of the above errors, plus any
0051  *  additional errors that are known to not cause shutdowns)
0052  *
0053  * xfs_panic_mask bit 0x8 turns the error reports into panics
0054  */
0055 
0056 enum {
0057     /* XFS_REFCACHE_SIZE = 1 */
0058     /* XFS_REFCACHE_PURGE = 2 */
0059     /* XFS_RESTRICT_CHOWN = 3 */
0060     XFS_SGID_INHERIT = 4,
0061     XFS_SYMLINK_MODE = 5,
0062     XFS_PANIC_MASK = 6,
0063     XFS_ERRLEVEL = 7,
0064     XFS_SYNCD_TIMER = 8,
0065     /* XFS_PROBE_DMAPI = 9 */
0066     /* XFS_PROBE_IOOPS = 10 */
0067     /* XFS_PROBE_QUOTA = 11 */
0068     XFS_STATS_CLEAR = 12,
0069     XFS_INHERIT_SYNC = 13,
0070     XFS_INHERIT_NODUMP = 14,
0071     XFS_INHERIT_NOATIME = 15,
0072     XFS_BUF_TIMER = 16,
0073     XFS_BUF_AGE = 17,
0074     /* XFS_IO_BYPASS = 18 */
0075     XFS_INHERIT_NOSYM = 19,
0076     XFS_ROTORSTEP = 20,
0077     XFS_INHERIT_NODFRG = 21,
0078     XFS_FILESTREAM_TIMER = 22,
0079 };
0080 
0081 extern xfs_param_t  xfs_params;
0082 
0083 struct xfs_globals {
0084 #ifdef DEBUG
0085     int pwork_threads;      /* parallel workqueue threads */
0086     bool    larp;           /* log attribute replay */
0087 #endif
0088     int log_recovery_delay; /* log recovery delay (secs) */
0089     int mount_delay;        /* mount setup delay (secs) */
0090     bool    bug_on_assert;      /* BUG() the kernel on assert failure */
0091     bool    always_cow;     /* use COW fork for all overwrites */
0092 };
0093 extern struct xfs_globals   xfs_globals;
0094 
0095 #ifdef CONFIG_SYSCTL
0096 extern int xfs_sysctl_register(void);
0097 extern void xfs_sysctl_unregister(void);
0098 #else
0099 # define xfs_sysctl_register()      (0)
0100 # define xfs_sysctl_unregister()    do { } while (0)
0101 #endif /* CONFIG_SYSCTL */
0102 
0103 #endif /* __XFS_SYSCTL_H__ */