summaryrefslogtreecommitdiff
path: root/sys/msdosfs/denode.h
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-04-05 09:26:41 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-04-05 09:26:41 +0000
commitbff1f2dca7be72c82459d905bdbfdaa51e626e2d (patch)
tree7b3253cc4a4a0da9926f99ac0ea18a294fff203a /sys/msdosfs/denode.h
parentc57d49a44f485a5e0ffda5a16c469ef5b034d2ca (diff)
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 # */