Deleted Added
full compact
vfs_bio.c (40764) vfs_bio.c (40790)
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.182 1998/10/29 11:04:22 dg Exp $
14 * $Id: vfs_bio.c,v 1.183 1998/10/30 14:53:54 dg 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 *

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

174 for (i = 0; i < nbuf; i++) {
175 bp = &buf[i];
176 bzero(bp, sizeof *bp);
177 bp->b_flags = B_INVAL; /* we're just an empty header */
178 bp->b_dev = NODEV;
179 bp->b_rcred = NOCRED;
180 bp->b_wcred = NOCRED;
181 bp->b_qindex = QUEUE_EMPTY;
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 *

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

174 for (i = 0; i < nbuf; i++) {
175 bp = &buf[i];
176 bzero(bp, sizeof *bp);
177 bp->b_flags = B_INVAL; /* we're just an empty header */
178 bp->b_dev = NODEV;
179 bp->b_rcred = NOCRED;
180 bp->b_wcred = NOCRED;
181 bp->b_qindex = QUEUE_EMPTY;
182 bp->b_vnbufs.le_next = NOLIST;
182 bp->b_xflags = 0;
183 LIST_INIT(&bp->b_dep);
184 TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist);
185 LIST_INSERT_HEAD(&invalhash, bp, b_hash);
186 }
187/*
188 * maxbufspace is currently calculated to support all filesystem blocks
189 * to be 8K. If you happen to use a 16K filesystem, the size of the buffer
190 * cache is still the same as it would be for 8K filesystems. This

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

416 if ((oldflags & B_ASYNC) == 0) {
417 int rtval = biowait(bp);
418 brelse(bp);
419 return (rtval);
420 }
421 return (0);
422}
423
183 LIST_INIT(&bp->b_dep);
184 TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist);
185 LIST_INSERT_HEAD(&invalhash, bp, b_hash);
186 }
187/*
188 * maxbufspace is currently calculated to support all filesystem blocks
189 * to be 8K. If you happen to use a 16K filesystem, the size of the buffer
190 * cache is still the same as it would be for 8K filesystems. This

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

416 if ((oldflags & B_ASYNC) == 0) {
417 int rtval = biowait(bp);
418 brelse(bp);
419 return (rtval);
420 }
421 return (0);
422}
423
424__inline void
424void
425vfs_bio_need_satisfy(void) {
426 ++numfreebuffers;
427 if (!needsbuffer)
428 return;
429 if (numdirtybuffers < lodirtybuffers) {
430 needsbuffer &= ~(VFS_BIO_NEED_ANY | VFS_BIO_NEED_LOWLIMIT);
431 } else {
432 needsbuffer &= ~VFS_BIO_NEED_ANY;

--- 1962 unchanged lines hidden ---
425vfs_bio_need_satisfy(void) {
426 ++numfreebuffers;
427 if (!needsbuffer)
428 return;
429 if (numdirtybuffers < lodirtybuffers) {
430 needsbuffer &= ~(VFS_BIO_NEED_ANY | VFS_BIO_NEED_LOWLIMIT);
431 } else {
432 needsbuffer &= ~VFS_BIO_NEED_ANY;

--- 1962 unchanged lines hidden ---