diff options
| author | cgd <cgd@NetBSD.org> | 1993-07-19 16:38:35 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1993-07-19 16:38:35 +0000 |
| commit | 9bd082f70ef5c536d2baa0d3352bbbc3f0c770da (patch) | |
| tree | 935fb829b4952b5b44561d6ca1108c2431765a95 /sys | |
| parent | fd98432185bb931932e674d29cad0bf4bb0b3eaf (diff) | |
replace jolitz's vfs__bio with a better one from CMU via mw.
so, replace vfs__bio, and deal with attendant changes.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/i386/i386/machdep.c | 43 | ||||
| -rw-r--r-- | sys/conf/files | 4 | ||||
| -rw-r--r-- | sys/conf/files.oldconf | 4 | ||||
| -rw-r--r-- | sys/kern/vfs_bio.c | 1 |
4 files changed, 27 insertions, 25 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 97eb6a377ec..60bccac9f28 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.40 1993/07/18 08:23:07 andrew Exp $ + * $Id: machdep.c,v 1.41 1993/07/19 16:38:35 cgd Exp $ */ #include "npx.h" @@ -66,9 +66,7 @@ #include "sys/exec.h" #include "sys/vnode.h" -#ifdef barely_notdef /* XXX - cgd */ vm_map_t buffer_map; -#endif extern vm_offset_t avail_end; #include "machine/cpu.h" @@ -96,9 +94,6 @@ int bufpages = BUFPAGES; int bufpages = 0; #endif int msgbufmapped; /* set when safe to use msgbuf */ -#ifndef barely_notdef /* XXX - cgd */ -extern int freebufspace; -#endif /* * Machine-dependent startup code @@ -188,21 +183,21 @@ again: * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ if (bufpages == 0) - if (physmem < btoc(2 * 1024 * 1024)) - bufpages = physmem / 10 / CLSIZE; - else - bufpages = (btoc(2 * 1024 * 1024) + physmem) / 20 / CLSIZE; + if (physmem < btoc(2 * 1024 * 1024)) + bufpages = physmem / 10 / CLSIZE; + else + bufpages = (btoc(2 * 1024 * 1024) + physmem) / 20 / CLSIZE; - bufpages = min(NKMEMCLUSTERS*2/5, bufpages); + bufpages = min(NKMEMCLUSTERS*2/5, bufpages); /* XXX ? - cgd */ if (nbuf == 0) { nbuf = bufpages / 2; - if (nbuf < 16) + if (nbuf < 16) { nbuf = 16; + /* XXX (cgd) -- broken vfs_bio currently demands this */ + bufpages = 32; + } } -#ifndef barely_notdef /* XXX - cgd */ - freebufspace = bufpages * NBPG; -#endif if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) @@ -226,7 +221,7 @@ again: */ if ((vm_size_t)(v - firstaddr) != size) panic("startup: table size inconsistency"); -#ifdef barely_notdef /* XXX - cgd */ +#if 0 /* * Now allocate buffers proper. They are different than the above * in that they usually occupy more virtual memory than physical. @@ -240,6 +235,10 @@ again: panic("startup: cannot allocate buffers"); base = bufpages / nbuf; residual = bufpages % nbuf; + if (base >= MAXBSIZE) { /* don't want to alloc more physical mem than needed */ + base = MAXBSIZE; + residual = 0; + } for (i = 0; i < nbuf; i++) { vm_size_t curbufsize; vm_offset_t curbuf; @@ -256,7 +255,14 @@ again: vm_map_pageable(buffer_map, curbuf, curbuf+curbufsize, FALSE); vm_map_simplify(buffer_map, curbuf); } +#else + /* + * Allocate a submap for buffer space allocations. + */ + buffer_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr, + bufpages * CLBYTES, TRUE); #endif + /* * Allocate a submap for exec arguments. This map effectively * limits the number of processes exec'ing at any time. @@ -288,13 +294,8 @@ again: callout[i-1].c_next = &callout[i]; printf("avail mem = %d\n", ptoa(vm_page_free_count)); -#ifdef barely_notdef /* XXX - cgd */ printf("using %d buffers containing %d bytes of memory\n", nbuf, bufpages * CLBYTES); -#else - printf("using %d buffers backed by %d bytes of memory\n", - nbuf, freebufspace); -#endif /* * Set up CPU-specific registers, cache, etc. diff --git a/sys/conf/files b/sys/conf/files index d6295c08f90..5b0035da6ac 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $Id: files,v 1.17 1993/07/19 15:48:36 cgd Exp $ +# $Id: files,v 1.18 1993/07/19 16:38:52 cgd Exp $ # ddb/db_access.c optional ddb ddb/db_aout.c optional ddb @@ -71,7 +71,7 @@ kern/uipc_socket.c standard kern/uipc_socket2.c standard kern/uipc_syscalls.c standard kern/uipc_usrreq.c standard -kern/vfs__bio.c standard +kern/vfs_bio.c standard kern/vfs_cache.c standard kern/vfs_conf.c standard kern/vfs_lookup.c standard diff --git a/sys/conf/files.oldconf b/sys/conf/files.oldconf index 7e33be8fd35..596c42b6f0b 100644 --- a/sys/conf/files.oldconf +++ b/sys/conf/files.oldconf @@ -1,4 +1,4 @@ -# $Id: files.oldconf,v 1.17 1993/07/19 15:48:36 cgd Exp $ +# $Id: files.oldconf,v 1.18 1993/07/19 16:38:52 cgd Exp $ # ddb/db_access.c optional ddb ddb/db_aout.c optional ddb @@ -71,7 +71,7 @@ kern/uipc_socket.c standard kern/uipc_socket2.c standard kern/uipc_syscalls.c standard kern/uipc_usrreq.c standard -kern/vfs__bio.c standard +kern/vfs_bio.c standard kern/vfs_cache.c standard kern/vfs_conf.c standard kern/vfs_lookup.c standard diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c new file mode 100644 index 00000000000..0ad3599654f --- /dev/null +++ b/sys/kern/vfs_bio.c @@ -0,0 +1 @@ +revision 1.1 intentionally removed |
