blob: 168488130a1906e34e1181da624891e20b73436a [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Nathan Scott7b718762005-11-02 14:58:39 +11003 * Copyright (c) 2001-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#ifndef __XFS_SYSCTL_H__
7#define __XFS_SYSCTL_H__
8
9#include <linux/sysctl.h>
10
11/*
12 * Tunable xfs parameters
13 */
14
15typedef struct xfs_sysctl_val {
16 int min;
17 int val;
18 int max;
19} xfs_sysctl_val_t;
20
21typedef struct xfs_param {
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 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 Naujokd3446ea2006-06-09 14:54:19 +100036 xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */
David Chinner2a82b8b2007-07-11 11:09:12 +100037 xfs_sysctl_val_t fstrm_timer; /* Filestream dir-AG assoc'n timeout. */
Brian Foster579b62f2012-11-06 09:50:47 -050038 xfs_sysctl_val_t eofb_timer; /* Interval between eofb scan wakeups */
Darrick J. Wong83104d42016-10-03 09:11:46 -070039 xfs_sysctl_val_t cowb_timer; /* Interval between cowb scan wakeups */
Linus Torvalds1da177e2005-04-16 15:20:36 -070040} xfs_param_t;
41
42/*
43 * xfs_error_level:
44 *
45 * How much error reporting will be done when internal problems are
46 * encountered. These problems normally return an EFSCORRUPTED to their
47 * caller, with no other information reported.
48 *
49 * 0 No error reports
50 * 1 Report EFSCORRUPTED errors that will cause a filesystem shutdown
51 * 5 Report all EFSCORRUPTED errors (all of the above errors, plus any
52 * additional errors that are known to not cause shutdowns)
53 *
54 * xfs_panic_mask bit 0x8 turns the error reports into panics
55 */
56
57enum {
58 /* XFS_REFCACHE_SIZE = 1 */
59 /* XFS_REFCACHE_PURGE = 2 */
Tim Shimmine0b8e8b2008-10-30 18:30:48 +110060 /* XFS_RESTRICT_CHOWN = 3 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 XFS_SGID_INHERIT = 4,
62 XFS_SYMLINK_MODE = 5,
63 XFS_PANIC_MASK = 6,
64 XFS_ERRLEVEL = 7,
65 XFS_SYNCD_TIMER = 8,
66 /* XFS_PROBE_DMAPI = 9 */
67 /* XFS_PROBE_IOOPS = 10 */
68 /* XFS_PROBE_QUOTA = 11 */
69 XFS_STATS_CLEAR = 12,
70 XFS_INHERIT_SYNC = 13,
71 XFS_INHERIT_NODUMP = 14,
72 XFS_INHERIT_NOATIME = 15,
73 XFS_BUF_TIMER = 16,
74 XFS_BUF_AGE = 17,
75 /* XFS_IO_BYPASS = 18 */
76 XFS_INHERIT_NOSYM = 19,
77 XFS_ROTORSTEP = 20,
Barry Naujokd3446ea2006-06-09 14:54:19 +100078 XFS_INHERIT_NODFRG = 21,
David Chinner2a82b8b2007-07-11 11:09:12 +100079 XFS_FILESTREAM_TIMER = 22,
Linus Torvalds1da177e2005-04-16 15:20:36 -070080};
81
82extern xfs_param_t xfs_params;
83
Brian Foster2e227172014-09-09 11:56:13 +100084struct xfs_globals {
85 int log_recovery_delay; /* log recovery delay (secs) */
Dave Chinnerdae5cd82018-05-10 21:50:23 -070086 int mount_delay; /* mount setup delay (secs) */
Brian Fosterccdab3d2017-06-14 21:29:12 -070087 bool bug_on_assert; /* BUG() the kernel on assert failure */
Brian Foster2e227172014-09-09 11:56:13 +100088};
89extern struct xfs_globals xfs_globals;
90
Linus Torvalds1da177e2005-04-16 15:20:36 -070091#ifdef CONFIG_SYSCTL
Christoph Hellwig9f8868f2008-07-18 17:11:46 +100092extern int xfs_sysctl_register(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093extern void xfs_sysctl_unregister(void);
94#else
Christoph Hellwig9f8868f2008-07-18 17:11:46 +100095# define xfs_sysctl_register() (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070096# define xfs_sysctl_unregister() do { } while (0)
97#endif /* CONFIG_SYSCTL */
98
99#endif /* __XFS_SYSCTL_H__ */