confusion in the future over which constants apply to which initializers.
with the IRIX version of XFS.
-Options
-=======
+Mount Options
+=============
When mounting an XFS filesystem, the following options are accepted.
Don't check for double mounted file systems using the file system uuid.
This is useful to mount LVM snapshot volumes.
+sysctls
+=======
+
+The following sysctls are available for the XFS filesystem:
+
+ fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1)
+ Setting this to "1" clears accumulated XFS statistics
+ in /proc/fs/xfs/stat. It then immediately reset to "0".
+
+ fs.xfs.sync_interval (Min: HZ Default: 30*HZ Max: 60*HZ)
+ The interval at which the xfssyncd thread for xfs filesystems
+ flushes metadata out to disk. This thread will flush log
+ activity out, and do some processing on unlinked inodes
+
+ fs.xfs.error_level (Min: 0 Default: 3 Max: 11)
+ A volume knob for error reporting when internal errors occur.
+ This will generate detailed messages & backtraces for filesystem
+ shutdowns, for example. Current threshold values are:
+
+ XFS_ERRLEVEL_OFF: 0
+ XFS_ERRLEVEL_LOW: 1
+ XFS_ERRLEVEL_HIGH: 5
+
+ fs.xfs.panic_mask (Min: 0 Default: 0 Max: 127)
+ Causes certain error conditions to call BUG(). Value is a bitmask;
+ AND together the tags which represent errors which should cause panics:
+
+ XFS_NO_PTAG 0LL
+ XFS_PTAG_IFLUSH 0x0000000000000001LL
+ XFS_PTAG_LOGRES 0x0000000000000002LL
+ XFS_PTAG_AILDELETE 0x0000000000000004LL
+ XFS_PTAG_ERROR_REPORT 0x0000000000000008LL
+ XFS_PTAG_SHUTDOWN_CORRUPT 0x0000000000000010LL
+ XFS_PTAG_SHUTDOWN_IOERROR 0x0000000000000020LL
+ XFS_PTAG_SHUTDOWN_LOGERROR 0x0000000000000040LL
+
+ This option is intended for debugging only.
+
+ fs.xfs.irix_symlink_mode (Min: 0 Default: 0 Max: 1)
+ Controls whether symlinks are created with mode 0777 (default)
+ or whether their mode is affected by the umask (irix mode).
+
+ fs.xfs.irix_sgid_inherit (Min: 0 Default: 0 Max: 1)
+ Controls files created in SGID directories.
+ If the group ID of the new file does not match the effective group
+ ID or one of the supplementary group IDs of the parent dir, the
+ ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl
+ is set.
+
+ fs.xfs.restrict_chown (Min: 0 Default: 1 Max: 1)
+ Controls whether unprivileged users can use chown to "give away"
+ a file to another user.
+
+ vm.pagebuf.stats_clear (Min: 0 Default: 0 Max: 1)
+ Setting this to "1" clears accumulated pagebuf statistics
+ in /proc/fs/pagebuf/stat. It then immediately reset to "0".
+
+ vm.pagebuf.flush_age (Min: 1*HZ Default: 15*HZ Max: 300*HZ)
+ The age at which dirty metadata buffers are flushed to disk
+
+ vm.pagebuf.flush_int (Min: HZ/2 Default: HZ Max: 30*HZ)
+ The interval at which the list of dirty metadata buffers is
+ scanned.
#include "xfs.h"
#include "xfs_bmap_btree.h"
#include "xfs_bit.h"
+#include "xfs_rw.h"
/*
* System memory size - used to scale certain data structures in XFS.
* Tunable XFS parameters. xfs_params is required even when CONFIG_SYSCTL=n,
* other XFS code uses these values.
*/
-xfs_param_t xfs_params = { 0, 1, 0, 0, 3, 30 * HZ, 0 };
+
+xfs_param_t xfs_params = {
+ /* MIN DFLT MAX */
+ restrict_chown: { 0, 1, 1 },
+ sgid_inherit: { 0, 0, 1 },
+ symlink_mode: { 0, 0, 1 },
+ panic_mask: { 0, 0, 127 },
+ error_level: { 0, 3, 11 },
+ sync_interval: { HZ, 30*HZ, 60*HZ },
+ stats_clear: { 0, 0, 1 },
+
+};
/*
* Global system credential structure.
bh->b_end_io = linvfs_unwritten_done;
}
-#define restricted_chown xfs_params.restrict_chown
-#define irix_sgid_inherit xfs_params.sgid_inherit
-#define irix_symlink_mode xfs_params.symlink_mode
-#define xfs_panic_mask xfs_params.panic_mask
-#define xfs_error_level xfs_params.error_level
+#define xfs_refcache_size xfs_params.refcache_size.val
+#define xfs_refcache_purge_count xfs_params.refcache_purge.val
+#define restricted_chown xfs_params.restrict_chown.val
+#define irix_sgid_inherit xfs_params.sgid_inherit.val
+#define irix_symlink_mode xfs_params.symlink_mode.val
+#define xfs_panic_mask xfs_params.panic_mask.val
+#define xfs_error_level xfs_params.error_level.val
+#define xfs_syncd_interval xfs_params.sync_interval.val
+#define xfs_stats_clear xfs_params.stats_clear.val
#define NBPP PAGE_SIZE
#define DPPSHFT (PAGE_SHIFT - 9)
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(xfs_params.sync_interval);
+ schedule_timeout(xfs_syncd_interval);
/* swsusp */
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
#include <linux/proc_fs.h>
-STATIC ulong xfs_min[XFS_PARAM] = { 0, 0, 0, 0, 0, HZ, 0 };
-STATIC ulong xfs_max[XFS_PARAM] = { 1, 1, 1, 127, 3, HZ * 60, 1 };
-
static struct ctl_table_header *xfs_table_header;
vn_active = xfsstats.vn_active;
memset(&xfsstats, 0, sizeof(xfsstats));
xfsstats.vn_active = vn_active;
- xfs_params.stats_clear = 0;
+ xfs_stats_clear = 0;
}
return ret;
#endif /* CONFIG_PROC_FS */
STATIC ctl_table xfs_table[] = {
- {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown,
+ {XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[0], &xfs_max[0]},
+ &sysctl_intvec, NULL,
+ &xfs_params.restrict_chown.min, &xfs_params.restrict_chown.max},
- {XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit,
+ {XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[1], &xfs_max[1]},
+ &sysctl_intvec, NULL,
+ &xfs_params.sgid_inherit.min, &xfs_params.sgid_inherit.max},
- {XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode,
+ {XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[2], &xfs_max[2]},
+ &sysctl_intvec, NULL,
+ &xfs_params.symlink_mode.min, &xfs_params.symlink_mode.max},
- {XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask,
+ {XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[3], &xfs_max[3]},
+ &sysctl_intvec, NULL,
+ &xfs_params.panic_mask.min, &xfs_params.panic_mask.max},
- {XFS_ERRLEVEL, "error_level", &xfs_params.error_level,
+ {XFS_ERRLEVEL, "error_level", &xfs_params.error_level.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[4], &xfs_max[4]},
+ &sysctl_intvec, NULL,
+ &xfs_params.error_level.min, &xfs_params.error_level.max},
- {XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.sync_interval,
+ {XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.sync_interval.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &xfs_min[5], &xfs_max[5]},
+ &sysctl_intvec, NULL,
+ &xfs_params.sync_interval.min, &xfs_params.sync_interval.max},
/* please keep this the last entry */
#ifdef CONFIG_PROC_FS
- {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear,
+ {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val,
sizeof(ulong), 0644, NULL, &xfs_stats_clear_proc_handler,
- &sysctl_intvec, NULL, &xfs_min[6], &xfs_max[6]},
+ &sysctl_intvec, NULL,
+ &xfs_params.stats_clear.min, &xfs_params.stats_clear.max},
#endif /* CONFIG_PROC_FS */
{0}
* Tunable xfs parameters
*/
-#define XFS_PARAM (sizeof(struct xfs_param) / sizeof(ulong))
+typedef struct xfs_sysctl_val {
+ ulong min;
+ ulong val;
+ ulong max;
+} xfs_sysctl_val_t;
typedef struct xfs_param {
- ulong restrict_chown; /* Root/non-root can give away files. */
- ulong sgid_inherit; /* Inherit ISGID bit if process' GID is */
- /* not a member of the parent dir GID. */
- ulong symlink_mode; /* Symlink creat mode affected by umask. */
- ulong panic_mask; /* bitmask to specify panics on errors. */
- ulong error_level; /* Degree of reporting for internal probs*/
- ulong sync_interval; /* time between sync calls */
- ulong stats_clear; /* Reset all XFS statistics to zero. */
+ xfs_sysctl_val_t restrict_chown;/* Root/non-root can give away files.*/
+ xfs_sysctl_val_t sgid_inherit; /* Inherit ISGID bit if process' GID
+ * is not a member of the parent dir
+ * GID */
+ xfs_sysctl_val_t symlink_mode; /* Link creat mode affected by umask */
+ xfs_sysctl_val_t panic_mask; /* bitmask to cause panic on errors. */
+ xfs_sysctl_val_t error_level; /* Degree of reporting for problems */
+ xfs_sysctl_val_t sync_interval; /* time between sync calls */
+ xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */
} xfs_param_t;
/*
int j;
unsigned long flags;
- if (!pb_params.p_un.debug) return;
+ if (!pb_params.debug.val) return;
if (ra == NULL) ra = (void *)__builtin_return_address(0);
* /proc/sys/vm/pagebuf
*/
-unsigned long pagebuf_min[P_PARAM] = { HZ/2, 1*HZ, 0, 0 };
-unsigned long pagebuf_max[P_PARAM] = { HZ*30, HZ*300, 1, 1 };
-
-pagebuf_param_t pb_params = {{ HZ, 15 * HZ, 0, 0 }};
+pagebuf_param_t pb_params = {
+ /* MIN DFLT MAX */
+ flush_interval: { HZ/2, HZ, 30*HZ },
+ age_buffer: { 1*HZ, 15*HZ, 300*HZ },
+ stats_clear: { 0, 0, 1 },
+ debug: { 0, 0, 1 },
+};
/*
* Pagebuf statistics variables
}
list_add_tail(&pb->pb_list, &pbd_delwrite_queue);
- pb->pb_flushtime = jiffies + pb_params.p_un.age_buffer;
+ pb->pb_flushtime = jiffies + pb_params.age_buffer.val;
spin_unlock(&pbd_delwrite_lock);
if (unlock && (pb->pb_flags & _PBF_LOCKABLE)) {
if (pbd_active == 1) {
mod_timer(&pb_daemon_timer,
- jiffies + pb_params.p_un.flush_interval);
+ jiffies + pb_params.flush_interval.val);
interruptible_sleep_on(&pbd_waitq);
}
if (!ret && write && *valp) {
printk("XFS Clearing pbstats\n");
memset(&pbstats, 0, sizeof(pbstats));
- pb_params.p_un.stats_clear = 0;
+ pb_params.stats_clear.val = 0;
}
return ret;
STATIC struct ctl_table_header *pagebuf_table_header;
STATIC ctl_table pagebuf_table[] = {
- {PB_FLUSH_INT, "flush_int", &pb_params.data[0],
+ {PB_FLUSH_INT, "flush_int", &pb_params.flush_interval.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_ms_jiffies_minmax,
- &sysctl_intvec, NULL, &pagebuf_min[0], &pagebuf_max[0]},
+ &sysctl_intvec, NULL,
+ &pb_params.flush_interval.min, &pb_params.flush_interval.max},
- {PB_FLUSH_AGE, "flush_age", &pb_params.data[1],
+ {PB_FLUSH_AGE, "flush_age", &pb_params.age_buffer.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_ms_jiffies_minmax,
- &sysctl_intvec, NULL, &pagebuf_min[1], &pagebuf_max[1]},
+ &sysctl_intvec, NULL,
+ &pb_params.age_buffer.min, &pb_params.age_buffer.max},
- {PB_STATS_CLEAR, "stats_clear", &pb_params.data[2],
+ {PB_STATS_CLEAR, "stats_clear", &pb_params.stats_clear.val,
sizeof(ulong), 0644, NULL, &pb_stats_clear_handler,
- &sysctl_intvec, NULL, &pagebuf_min[2], &pagebuf_max[2]},
+ &sysctl_intvec, NULL,
+ &pb_params.stats_clear.min, &pb_params.stats_clear.max},
#ifdef PAGEBUF_TRACE
- {PB_DEBUG, "debug", &pb_params.data[3],
+ {PB_DEBUG, "debug", &pb_params.debug.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
- &sysctl_intvec, NULL, &pagebuf_min[3], &pagebuf_max[3]},
+ &sysctl_intvec, NULL,
+ &pb_params.debug.min, &pb_params.debug.max},
#endif
{0}
};
* Tunable pagebuf parameters
*/
-#define P_PARAM 4
-
-typedef union pagebuf_param {
- struct {
- ulong flush_interval; /* interval between runs of the
+typedef struct pb_sysctl_val {
+ ulong min;
+ ulong val;
+ ulong max;
+} pb_sysctl_val_t;
+
+typedef struct pagebuf_param {
+ pb_sysctl_val_t flush_interval; /* interval between runs of the
* delwri flush daemon. */
- ulong age_buffer; /* time for buffer to age before
+ pb_sysctl_val_t age_buffer; /* time for buffer to age before
* we flush it. */
- ulong debug; /* debug tracing on or off */
- ulong stats_clear; /* clear the pagebuf stats */
- } p_un;
- ulong data[P_PARAM];
+ pb_sysctl_val_t stats_clear; /* clear the pagebuf stats */
+ pb_sysctl_val_t debug; /* debug tracing on or off */
} pagebuf_param_t;
enum {
#endif /* DEBUG */
#ifdef XFS_DABUF_DEBUG
extern lock_t xfs_dabuf_global_lock;
-#endif
-
-#ifdef XFS_DABUF_DEBUG
spinlock_init(&xfs_dabuf_global_lock, "xfsda");
#endif