summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs/denode.h
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2012-04-05 09:26:40 +0000
committermikeb <mikeb@openbsd.org>2012-04-05 09:26:40 +0000
commit51bdbb7d0b5af21e4bb0f1dab674e179d650a461 (patch)
tree3b1de2cba251750302789d39adc34803fca0d441 /sys/msdosfs/denode.h
parenttweak previous; ok ratchov (diff)
downloadwireguard-openbsd-51bdbb7d0b5af21e4bb0f1dab674e179d650a461.tar.xz
wireguard-openbsd-51bdbb7d0b5af21e4bb0f1dab674e179d650a461.zip
As it was made evident by Olaf 'Rhialto' Seibert in the NetBSD PR 34583,
caching the last cluster in the file before extending it considerably speeds up further lookups. As a consequence this keeps write speed from gradually decreasing and provides a measurable (up to 2x) performance increase. Prompted by the diff from Alexander Polakov, ok miod, krw.
Diffstat (limited to 'sys/msdosfs/denode.h')
-rw-r--r--sys/msdosfs/denode.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h
index fde57a08ff2..9f17ac79edb 100644
--- a/sys/msdosfs/denode.h
+++ b/sys/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: denode.h,v 1.23 2010/07/17 19:27:07 guenther Exp $ */
+/* $OpenBSD: denode.h,v 1.24 2012/04/05 09:26:40 mikeb Exp $ */
/* $NetBSD: denode.h,v 1.24 1997/10/17 11:23:39 ws Exp $ */
/*-
@@ -116,10 +116,11 @@ struct fatcache {
* cache is probably pretty worthless if a file is opened by multiple
* processes.
*/
-#define FC_SIZE 2 /* number of entries in the cache */
+#define FC_SIZE 3 /* number of entries in the cache */
#define FC_LASTMAP 0 /* entry the last call to pcbmap() resolved
* to */
#define FC_LASTFC 1 /* entry for the last cluster in the file */
+#define FC_OLASTFC 2 /* entry for the previous last cluster */
#define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */