Deleted Added
full compact
bcache.c (119483) bcache.c (136097)
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@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) 1998 Michael Smith <msmith@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/boot/common/bcache.c 119483 2003-08-25 23:30:41Z obrien $");
28__FBSDID("$FreeBSD: head/sys/boot/common/bcache.c 136097 2004-10-03 16:34:01Z stefanf $");
29
30/*
31 * Simple LRU block cache
32 */
33
29
30/*
31 * Simple LRU block cache
32 */
33
34#include <sys/stdint.h>
35
34#include <stand.h>
35#include <string.h>
36#include <bitstring.h>
37
38#include "bootstrap.h"
39
40/* #define BCACHE_DEBUG */
41

--- 290 unchanged lines hidden (view full) ---

332COMMAND_SET(bcachestat, "bcachestat", "get disk block cache stats", command_bcache);
333
334static int
335command_bcache(int argc, char *argv[])
336{
337 u_int i;
338
339 for (i = 0; i < bcache_nblks; i++) {
36#include <stand.h>
37#include <string.h>
38#include <bitstring.h>
39
40#include "bootstrap.h"
41
42/* #define BCACHE_DEBUG */
43

--- 290 unchanged lines hidden (view full) ---

334COMMAND_SET(bcachestat, "bcachestat", "get disk block cache stats", command_bcache);
335
336static int
337command_bcache(int argc, char *argv[])
338{
339 u_int i;
340
341 for (i = 0; i < bcache_nblks; i++) {
340 printf("%08x %04x %04x|", bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
342 printf("%08jx %04x %04x|", (uintmax_t)bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);
341 if (((i + 1) % 4) == 0)
342 printf("\n");
343 }
344 printf("\n%d ops %d bypasses %d hits %d misses %d flushes\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses, bcache_flushes);
345 return(CMD_OK);
346}
347
343 if (((i + 1) % 4) == 0)
344 printf("\n");
345 }
346 printf("\n%d ops %d bypasses %d hits %d misses %d flushes\n", bcache_ops, bcache_bypasses, bcache_hits, bcache_misses, bcache_flushes);
347 return(CMD_OK);
348}
349