xfs_sysctl.h 3.2 KB

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