Deleted Added
full compact
vfs_bio.c (38799) vfs_bio.c (38862)
1/*
2 * Copyright (c) 1994,1997 John S. Dyson
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
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Absolutely no warranty of function or purpose is made by the author
12 * John S. Dyson.
13 *
1/*
2 * Copyright (c) 1994,1997 John S. Dyson
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
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Absolutely no warranty of function or purpose is made by the author
12 * John S. Dyson.
13 *
14 * $Id: vfs_bio.c,v 1.173 1998/08/28 20:07:13 luoqi Exp $
14 * $Id: vfs_bio.c,v 1.174 1998/09/04 08:06:55 dfr Exp $
15 */
16
17/*
18 * this file contains a new buffer I/O scheme implementing a coherent
19 * VM object and buffer cache scheme. Pains have been taken to make
20 * sure that the performance degradation associated with schemes such
21 * as this is not realized.
22 *

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

582 if (bp->b_flags & B_WANTED) {
583 bp->b_flags &= ~(B_WANTED | B_AGE);
584 wakeup(bp);
585 }
586
587 if (bp->b_flags & B_LOCKED)
588 bp->b_flags &= ~B_ERROR;
589
15 */
16
17/*
18 * this file contains a new buffer I/O scheme implementing a coherent
19 * VM object and buffer cache scheme. Pains have been taken to make
20 * sure that the performance degradation associated with schemes such
21 * as this is not realized.
22 *

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

582 if (bp->b_flags & B_WANTED) {
583 bp->b_flags &= ~(B_WANTED | B_AGE);
584 wakeup(bp);
585 }
586
587 if (bp->b_flags & B_LOCKED)
588 bp->b_flags &= ~B_ERROR;
589
590 if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR)) ||
590 if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_FREEBUF)) ||
591 (bp->b_bufsize <= 0)) {
592 bp->b_flags |= B_INVAL;
593 if (LIST_FIRST(&bp->b_dep) != NULL && bioops.io_deallocate)
594 (*bioops.io_deallocate)(bp);
595 if (bp->b_flags & B_DELWRI)
596 --numdirtybuffers;
591 (bp->b_bufsize <= 0)) {
592 bp->b_flags |= B_INVAL;
593 if (LIST_FIRST(&bp->b_dep) != NULL && bioops.io_deallocate)
594 (*bioops.io_deallocate)(bp);
595 if (bp->b_flags & B_DELWRI)
596 --numdirtybuffers;
597 bp->b_flags &= ~(B_DELWRI | B_CACHE);
597 bp->b_flags &= ~(B_DELWRI | B_CACHE | B_FREEBUF);
598 if ((bp->b_flags & B_VMIO) == 0) {
599 if (bp->b_bufsize)
600 allocbuf(bp, 0);
601 if (bp->b_vp)
602 brelvp(bp);
603 }
604 }
605

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

1890 splx(s);
1891#if !defined(MAX_PERF)
1892 printf("biodone: buffer already done\n");
1893#endif
1894 return;
1895 }
1896 bp->b_flags |= B_DONE;
1897
598 if ((bp->b_flags & B_VMIO) == 0) {
599 if (bp->b_bufsize)
600 allocbuf(bp, 0);
601 if (bp->b_vp)
602 brelvp(bp);
603 }
604 }
605

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

1890 splx(s);
1891#if !defined(MAX_PERF)
1892 printf("biodone: buffer already done\n");
1893#endif
1894 return;
1895 }
1896 bp->b_flags |= B_DONE;
1897
1898 if (bp->b_flags & B_FREEBUF) {
1899 brelse(bp);
1900 splx(s);
1901 return;
1902 }
1903
1898 if ((bp->b_flags & B_READ) == 0) {
1899 vwakeup(bp);
1900 }
1901
1902#ifdef BOUNCE_BUFFERS
1903 if (bp->b_flags & B_BOUNCE) {
1904 vm_bounce_free(bp);
1905 }

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

2410 struct buf *bp = (struct buf *)addr;
2411
2412 if (!have_addr) {
2413 db_printf("usage: show buffer <addr>\n");
2414 return;
2415 }
2416
2417 db_printf("b_proc = %p,\nb_flags = 0x%b\n", (void *)bp->b_proc,
1904 if ((bp->b_flags & B_READ) == 0) {
1905 vwakeup(bp);
1906 }
1907
1908#ifdef BOUNCE_BUFFERS
1909 if (bp->b_flags & B_BOUNCE) {
1910 vm_bounce_free(bp);
1911 }

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

2416 struct buf *bp = (struct buf *)addr;
2417
2418 if (!have_addr) {
2419 db_printf("usage: show buffer <addr>\n");
2420 return;
2421 }
2422
2423 db_printf("b_proc = %p,\nb_flags = 0x%b\n", (void *)bp->b_proc,
2418 (u_int)bp->b_flags,
2419 "\20\40bounce\37cluster\36vmio\35ram\34ordered"
2420 "\33paging\32xxx\31writeinprog\30wanted\27relbuf\26avail3"
2421 "\25read\24raw\23phys\22clusterok\21malloc\20nocache"
2422 "\17locked\16inval\15avail2\14error\13eintr\12done\11avail1"
2423 "\10delwri\7call\6cache\5busy\4bad\3async\2needcommit\1age");
2424 (u_int)bp->b_flags, PRINT_BUF_FLAGS);
2424 db_printf("b_error = %d, b_bufsize = %ld, b_bcount = %ld, "
2425 "b_resid = %ld\nb_dev = 0x%x, b_data = %p, "
2426 "b_blkno = %d, b_pblkno = %d\n",
2427 bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid,
2428 bp->b_dev, bp->b_data, bp->b_blkno, bp->b_pblkno);
2429 if (bp->b_npages) {
2430 int i;
2431 db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages);

--- 12 unchanged lines hidden ---
2425 db_printf("b_error = %d, b_bufsize = %ld, b_bcount = %ld, "
2426 "b_resid = %ld\nb_dev = 0x%x, b_data = %p, "
2427 "b_blkno = %d, b_pblkno = %d\n",
2428 bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid,
2429 bp->b_dev, bp->b_data, bp->b_blkno, bp->b_pblkno);
2430 if (bp->b_npages) {
2431 int i;
2432 db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages);

--- 12 unchanged lines hidden ---