Deleted Added
full compact
vfs_bio.c (112569) vfs_bio.c (112694)
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 * $FreeBSD: head/sys/kern/vfs_bio.c 112569 2003-03-25 00:07:06Z jake $
14 * $FreeBSD: head/sys/kern/vfs_bio.c 112694 2003-03-26 23:40:42Z tegge $
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 *

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

47#include <vm/vm.h>
48#include <vm/vm_param.h>
49#include <vm/vm_kern.h>
50#include <vm/vm_pageout.h>
51#include <vm/vm_page.h>
52#include <vm/vm_object.h>
53#include <vm/vm_extern.h>
54#include <vm/vm_map.h>
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 *

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

47#include <vm/vm.h>
48#include <vm/vm_param.h>
49#include <vm/vm_kern.h>
50#include <vm/vm_pageout.h>
51#include <vm/vm_page.h>
52#include <vm/vm_object.h>
53#include <vm/vm_extern.h>
54#include <vm/vm_map.h>
55#include "opt_directio.h"
56#include "opt_swap.h"
55
56static MALLOC_DEFINE(M_BIOBUF, "BIO buffer", "BIO buffer");
57
58struct bio_ops bioops; /* I/O operation notification */
59
60struct buf_ops buf_ops_bio = {
61 "buf_ops_bio",
62 bwrite

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

241 */
242const char *buf_wmesg = BUF_WMESG;
243
244#define VFS_BIO_NEED_ANY 0x01 /* any freeable buffer */
245#define VFS_BIO_NEED_DIRTYFLUSH 0x02 /* waiting for dirty buffer flush */
246#define VFS_BIO_NEED_FREE 0x04 /* wait for free bufs, hi hysteresis */
247#define VFS_BIO_NEED_BUFSPACE 0x08 /* wait for buf space, lo hysteresis */
248
57
58static MALLOC_DEFINE(M_BIOBUF, "BIO buffer", "BIO buffer");
59
60struct bio_ops bioops; /* I/O operation notification */
61
62struct buf_ops buf_ops_bio = {
63 "buf_ops_bio",
64 bwrite

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

243 */
244const char *buf_wmesg = BUF_WMESG;
245
246#define VFS_BIO_NEED_ANY 0x01 /* any freeable buffer */
247#define VFS_BIO_NEED_DIRTYFLUSH 0x02 /* waiting for dirty buffer flush */
248#define VFS_BIO_NEED_FREE 0x04 /* wait for free bufs, hi hysteresis */
249#define VFS_BIO_NEED_BUFSPACE 0x08 /* wait for buf space, lo hysteresis */
250
251#ifdef DIRECTIO
252extern void ffs_rawread_setup(void);
253#endif /* DIRECTIO */
249/*
250 * numdirtywakeup:
251 *
252 * If someone is blocked due to there being too many dirty buffers,
253 * and numdirtybuffers is now reasonable, wake them up.
254 */
255
256static __inline void

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

458 }
459#endif
460
461 /*
462 * swbufs are used as temporary holders for I/O, such as paging I/O.
463 * We have no less then 16 and no more then 256.
464 */
465 nswbuf = max(min(nbuf/4, 256), 16);
254/*
255 * numdirtywakeup:
256 *
257 * If someone is blocked due to there being too many dirty buffers,
258 * and numdirtybuffers is now reasonable, wake them up.
259 */
260
261static __inline void

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

463 }
464#endif
465
466 /*
467 * swbufs are used as temporary holders for I/O, such as paging I/O.
468 * We have no less then 16 and no more then 256.
469 */
470 nswbuf = max(min(nbuf/4, 256), 16);
471#ifdef NSWBUF_MIN
472 if (nswbuf < NSWBUF_MIN)
473 nswbuf = NSWBUF_MIN;
474#endif
475#ifdef DIRECTIO
476 ffs_rawread_setup();
477#endif
466
467 /*
468 * Reserve space for the buffer cache buffers
469 */
470 swbuf = (void *)v;
471 v = (caddr_t)(swbuf + nswbuf);
472 buf = (void *)v;
473 v = (caddr_t)(buf + nbuf);

--- 3289 unchanged lines hidden ---
478
479 /*
480 * Reserve space for the buffer cache buffers
481 */
482 swbuf = (void *)v;
483 v = (caddr_t)(swbuf + nswbuf);
484 buf = (void *)v;
485 v = (caddr_t)(buf + nbuf);

--- 3289 unchanged lines hidden ---