subr_sbuf.c (212181) | subr_sbuf.c (212182) |
---|---|
1/*- 2 * Copyright (c) 2000-2008 Poul-Henning Kamp 3 * Copyright (c) 2000-2008 Dag-Erling Co��dan Sm��rgrav 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000-2008 Poul-Henning Kamp 3 * Copyright (c) 2000-2008 Dag-Erling Co��dan Sm��rgrav 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/subr_sbuf.c 212181 2010-09-03 16:12:39Z mdf $"); | 30__FBSDID("$FreeBSD: head/sys/kern/subr_sbuf.c 212182 2010-09-03 17:23:26Z mdf $"); |
31 32#include <sys/param.h> 33 34#ifdef _KERNEL 35#include <sys/ctype.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/systm.h> --- 72 unchanged lines hidden (view full) --- 111 112#else /* _KERNEL && INVARIANTS */ 113 114#define assert_sbuf_integrity(s) do { } while (0) 115#define assert_sbuf_state(s, i) do { } while (0) 116 117#endif /* _KERNEL && INVARIANTS */ 118 | 31 32#include <sys/param.h> 33 34#ifdef _KERNEL 35#include <sys/ctype.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/systm.h> --- 72 unchanged lines hidden (view full) --- 111 112#else /* _KERNEL && INVARIANTS */ 113 114#define assert_sbuf_integrity(s) do { } while (0) 115#define assert_sbuf_state(s, i) do { } while (0) 116 117#endif /* _KERNEL && INVARIANTS */ 118 |
119#ifdef _KERNEL |
|
119CTASSERT(powerof2(SBUF_MAXEXTENDSIZE)); 120CTASSERT(powerof2(SBUF_MAXEXTENDINCR)); | 120CTASSERT(powerof2(SBUF_MAXEXTENDSIZE)); 121CTASSERT(powerof2(SBUF_MAXEXTENDINCR)); |
122#endif |
|
121 122static int 123sbuf_extendsize(int size) 124{ 125 int newsize; 126 127 if (size < (int)SBUF_MAXEXTENDSIZE) { 128 newsize = SBUF_MINEXTENDSIZE; --- 468 unchanged lines hidden --- | 123 124static int 125sbuf_extendsize(int size) 126{ 127 int newsize; 128 129 if (size < (int)SBUF_MAXEXTENDSIZE) { 130 newsize = SBUF_MINEXTENDSIZE; --- 468 unchanged lines hidden --- |