summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/bcache.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the correct printf specifier.stefanf2004-10-031-1/+3
| | | | PR: 47187
* Use __FBSDID().obrien2003-08-251-2/+3
| | | | Also some minor style cleanups.
* Removed mounds of unused variables.bde2002-02-251-4/+0
|
* Add support for writing blocks to the loader's disk cache.jhb2001-12-111-21/+92
| | | | | | PR: kern/32389 Submitted by: Jonathan Mini <mini@haikugeek.com> Sponsored by: ClickArray, Inc.
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-1/+1
| | | | also don't use ANSI string concatenation.
* Cleanup warnings. Most of these are signed/unsigned warnings, as well asjhb2000-08-031-15/+16
| | | | some added const's.
* bcache_strategy() now receives an unit number, and keep track of whatdcs2000-03-151-8/+24
| | | | | | | | | | was the last unit number received. If it changes, it flushes the cache. Add bcache_flash(). The actual fix is sligthly different from the one in the PR. PR: 17098 Submitted by: John Hood <jhood@sitaranetworks.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Silence a warning.dcs1999-02-041-2/+2
| | | | PR: bin/9754
* This fixes a bug in the bcache code whereby false cache hits occurpaul1998-11-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the first time block 0 is read. This fix initialises the block numbers to -1 which isn't the most correct thing for a daddr_t but it isn't likely to cause a problem in the boot blocks and it could do with a more thought out fix later. The bug is probably benign on the i386 but on the alpha it can cause initial file opens to fail. This is the cause of the "can't open /boot/boot.conf" errors. It appears on the alpha because of a number of combining factors. On the alpha the LABELSECTOR is 0 so block 0 needs to be read in from the media. The first time this happens you get a false hit because the bc_blkno field is zero initially. Also, the timestamp check against this cache hit succeeds because on the alpha a hacked getsecs() function can return 0 when it starts counting so that the zero initial timestamp + BCACHE_TIMEOUT is greater than the current time until getsecs() has counted passed BCACHE_TIMEOUT. The overall effect is that the first open() that occurs gets a false cache hit and returns garbage to the bd_strategy() function which then fails the open() call. This false hit then stays in the cache until BCACHE_TIMEOUT getsecs() ticks have passed; all open() calls during this time fail. This explains why you can generally access the media by the time you get to interp() and start issuing commands but the earlier attempts to run the boot scripts are failing. It's possible that this is causing the problem switching to the mfsroot floppy as well but I haven't confirmed that.
* Add BootForth hooks; if BOOT_FORTH is defined, pass every line readmsmith1998-11-041-2/+26
| | | | | | | to the Forth interpreter. Instantiate all of our inbuilt commands as Forth words, and handle them being called from there. Add my copyright to the bcache module (oops).
* Ok, the entry aging algorithm sucked; 1s time resolution is not enough formsmith1998-11-021-7/+16
| | | | | LRU. Use a 31-bit counter instead. If we decide to do heavy I/O through the bootloader this will have to be revisited.
* Implement a simple LRU block cache. By default this is initialised to 16k,msmith1998-11-021-0/+227
and will bypass transfers for more than 8k. Blocks are invalidated after 2 seconds, so removable media should not confuse the cache. The 8k threshold is a compromise; all UFS transfers performed by libstand are 8k or less, so large file reads thrash the cache. However many filesystem metadata operations are also performed using 8k blocks, so using a lower threshold gives poor performance. Those of you with an eye for cache algorithms are welcome to tell me how badly this one sucks; you can start with the 'bcachestats' command which will print the contents of the cache and access statistics.
OpenPOWER on IntegriCloud