Commit 1db72c60 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/lord/xfs-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents 4eabfbb6 61975ead
......@@ -14,8 +14,8 @@ for further details. This implementation is on-disk compatible
with the IRIX version of XFS.
Options
=======
Mount Options
=============
When mounting an XFS filesystem, the following options are accepted.
......@@ -107,3 +107,66 @@ 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.
......@@ -38,6 +38,7 @@
#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.
......@@ -48,7 +49,18 @@ unsigned long xfs_physmem;
* 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.
......
......@@ -87,11 +87,15 @@ static inline void set_buffer_unwritten_io(struct buffer_head *bh)
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)
......
......@@ -71,6 +71,7 @@
#include <linux/namei.h>
#include <linux/init.h>
#include <linux/mount.h>
#include <linux/suspend.h>
STATIC struct quotactl_ops linvfs_qops;
STATIC struct super_operations linvfs_sops;
......@@ -400,7 +401,10 @@ syncd(void *arg)
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);
if (vfsp->vfs_flag & VFS_UMOUNT)
break;
if (vfsp->vfs_flag & VFS_RDONLY)
......
/*
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include <xfs.h>
#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR)
int syncd(void *arg)
{
vfs_t *vfsp = (vfs_t *) arg;
int error;
daemonize("xfs_syncd");
vfsp->vfs_sync_task = current;
wmb();
wake_up(&vfsp->vfs_wait_sync_task);
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(xfs_params.sync_interval);
if (vfsp->vfs_flag & VFS_UMOUNT)
break;
if (vfsp->vfs_flag & VFS_RDONLY);
continue;
VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error);
}
vfsp->vfs_sync_task = NULL;
wmb();
wake_up(&vfsp->vfs_wait_sync_task);
return 0;
}
int
linvfs_start_syncd(vfs_t *vfsp)
{
int pid;
pid = kernel_thread(syncd, (void *) vfsp,
CLONE_VM | CLONE_FS | CLONE_FILES);
if (pid < 0)
return pid;
wait_event(vfsp->vfs_wait_sync_task, vfsp->vfs_sync_task);
return 0;
}
void
linvfs_stop_syncd(vfs_t *vfsp)
{
vfsp->vfs_flag |= VFS_UMOUNT;
wmb();
wake_up_process(vfsp->vfs_sync_task);
wait_event(vfsp->vfs_wait_sync_task, !vfsp->vfs_sync_task);
}
......@@ -36,9 +36,6 @@
#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;
......@@ -62,7 +59,7 @@ xfs_stats_clear_proc_handler(
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;
......@@ -70,35 +67,42 @@ xfs_stats_clear_proc_handler(
#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}
......
......@@ -39,17 +39,22 @@
* 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;
/*
......
......@@ -92,7 +92,7 @@ pb_trace_func(
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);
......@@ -129,10 +129,13 @@ STATIC struct workqueue_struct *pagebuf_dataio_workqueue;
* /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
......@@ -1556,7 +1559,7 @@ pagebuf_delwri_queue(
}
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)) {
......@@ -1621,7 +1624,7 @@ pagebuf_daemon(
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);
}
......@@ -1824,7 +1827,7 @@ pb_stats_clear_handler(
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;
......@@ -1833,22 +1836,26 @@ pb_stats_clear_handler(
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}
};
......
......@@ -85,18 +85,19 @@ struct pagebuf_trace_buf {
* 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 {
......
......@@ -96,9 +96,6 @@ xfs_init(void)
#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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment