g_stripe.c (135522) | g_stripe.c (138623) |
---|---|
1/*- 2 * Copyright (c) 2003 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/geom/stripe/g_stripe.c 135522 2004-09-20 17:26:25Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/geom/stripe/g_stripe.c 138623 2004-12-09 12:26:47Z pjd $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/module.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/bio.h> --- 30 unchanged lines hidden (view full) --- 67}; 68 69SYSCTL_DECL(_kern_geom); 70SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW, 0, "GEOM_STRIPE stuff"); 71static u_int g_stripe_debug = 0; 72TUNABLE_INT("kern.geom.stripe.debug", &g_stripe_debug); 73SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RW, &g_stripe_debug, 0, 74 "Debug level"); | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/module.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/bio.h> --- 30 unchanged lines hidden (view full) --- 67}; 68 69SYSCTL_DECL(_kern_geom); 70SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW, 0, "GEOM_STRIPE stuff"); 71static u_int g_stripe_debug = 0; 72TUNABLE_INT("kern.geom.stripe.debug", &g_stripe_debug); 73SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RW, &g_stripe_debug, 0, 74 "Debug level"); |
75static int g_stripe_fast = 1; | 75static int g_stripe_fast = 0; |
76TUNABLE_INT("kern.geom.stripe.fast", &g_stripe_fast); 77static int 78g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS) 79{ 80 int error, fast; 81 82 fast = g_stripe_fast; 83 error = sysctl_handle_int(oidp, &fast, sizeof(fast), req); 84 if (error == 0 && req->newptr != NULL) 85 g_stripe_fast = fast; 86 return (error); 87} 88SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW, 89 NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode"); | 76TUNABLE_INT("kern.geom.stripe.fast", &g_stripe_fast); 77static int 78g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS) 79{ 80 int error, fast; 81 82 fast = g_stripe_fast; 83 error = sysctl_handle_int(oidp, &fast, sizeof(fast), req); 84 if (error == 0 && req->newptr != NULL) 85 g_stripe_fast = fast; 86 return (error); 87} 88SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW, 89 NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode"); |
90static u_int g_stripe_maxmem = MAX_IO_SIZE * 50; | 90static u_int g_stripe_maxmem = MAX_IO_SIZE * 100; |
91TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem); 92SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem, 93 0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)"); 94static u_int g_stripe_fast_failed = 0; 95SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, fast_failed, CTLFLAG_RD, 96 &g_stripe_fast_failed, 0, "How many times \"fast\" mode failed"); 97 98/* --- 1089 unchanged lines hidden --- | 91TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem); 92SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem, 93 0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)"); 94static u_int g_stripe_fast_failed = 0; 95SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, fast_failed, CTLFLAG_RD, 96 &g_stripe_fast_failed, 0, "How many times \"fast\" mode failed"); 97 98/* --- 1089 unchanged lines hidden --- |