1/* 2 * Copyright (c) 1994 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 --- 4 unchanged lines hidden (view full) --- 13 * documentation and/or other materials provided with the distribution. 14 * 3. Absolutely no warranty of function or purpose is made by the author 15 * John S. Dyson. 16 * 4. This work was done expressly for inclusion into FreeBSD. Other use 17 * is allowed if this notation is included. 18 * 5. Modifications may be freely made to this file if the above conditions 19 * are met. 20 * |
21 * $Id: vfs_bio.c,v 1.78 1995/12/13 03:47:01 dyson Exp $ |
22 */ 23 24/* 25 * this file contains a new buffer I/O scheme implementing a coherent 26 * VM object and buffer cache scheme. Pains have been taken to make 27 * sure that the performance degradation associated with schemes such 28 * as this is not realized. 29 * --- 23 unchanged lines hidden (view full) --- 53#include <sys/mount.h> 54#include <sys/malloc.h> 55#include <sys/resourcevar.h> 56#include <sys/proc.h> 57 58#include <miscfs/specfs/specdev.h> 59 60static void vfs_update __P((void)); |
61static struct proc *updateproc; |
62static struct kproc_desc up_kp = { 63 "update", 64 vfs_update, 65 &updateproc 66}; 67SYSINIT_KT(update, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp) 68 69struct buf *buf; /* buffer header pool */ 70struct swqueue bswlist; 71 72int count_lock_queue __P((void)); |
73static void vm_hold_free_pages(struct buf * bp, vm_offset_t from, 74 vm_offset_t to); 75static void vm_hold_load_pages(struct buf * bp, vm_offset_t from, 76 vm_offset_t to); 77static void vfs_clean_pages(struct buf * bp); |
78static void vfs_setdirty(struct buf *bp); 79 80int needsbuffer; 81 82/* 83 * Internal update daemon, process 3 84 * The variable vfs_update_wakeup allows for internal syncs. 85 */ --- 8 unchanged lines hidden (view full) --- 94/* 95 * bogus page -- for I/O to/from partially complete buffers 96 * this is a temporary solution to the problem, but it is not 97 * really that bad. it would be better to split the buffer 98 * for input in the case of buffers partially already in memory, 99 * but the code is intricate enough already. 100 */ 101vm_page_t bogus_page; |
102static vm_offset_t bogus_offset; |
103 |
104static int bufspace, maxbufspace; |
105 |
106static struct bufhashhdr bufhashtbl[BUFHSZ], invalhash; 107static struct bqueues bufqueues[BUFFER_QUEUES]; |
108 109#define BUF_MAXUSE 8 110 111/* 112 * Initialize buffer headers and related structures. 113 */ 114void 115bufinit() --- 1529 unchanged lines hidden --- |