summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/denode.h
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2007-01-16 23:43:14 +0000
committertrhodes <trhodes@FreeBSD.org>2007-01-16 23:43:14 +0000
commit317819a5f62502c2daad8b2f578f62e1cd7f4017 (patch)
tree938e2f8802f8611f8eddb5688d22683c2de30c63 /sys/fs/msdosfs/denode.h
parentd4434aa6e90019d12652d4a92904d14ca5765d53 (diff)
downloadFreeBSD-src-317819a5f62502c2daad8b2f578f62e1cd7f4017.zip
FreeBSD-src-317819a5f62502c2daad8b2f578f62e1cd7f4017.tar.gz
Add a 3rd entry in the cache, which keeps the end position
from just before extending a file. This has the desired effect of keeping the write speed constant. And yes, that helps a lot copying large files always at full speed now, and I have seen improvements using benchmarks/bonnie. Stolen from: NetBSD Reviewed by: bde
Diffstat (limited to 'sys/fs/msdosfs/denode.h')
-rw-r--r--sys/fs/msdosfs/denode.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h
index 4fa51aa..3aac0bc 100644
--- a/sys/fs/msdosfs/denode.h
+++ b/sys/fs/msdosfs/denode.h
@@ -116,10 +116,12 @@ 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_NEXTTOLASTFC 2 /* entry for a close to the last cluster in
+ * the file */
#define FCE_EMPTY 0xffffffff /* doesn't represent an actual cluster # */
@@ -130,6 +132,13 @@ struct fatcache {
(dep)->de_fc[(slot)].fc_frcn = (frcn); \
(dep)->de_fc[(slot)].fc_fsrcn = (fsrcn);
+#define fc_last_to_nexttolast(dep) do { \
+ (dep)->de_fc[FC_NEXTTOLASTFC].fc_frcn = \
+ (dep)->de_fc[FC_LASTFC].fc_frcn; \
+ (dep)->de_fc[FC_NEXTTOLASTFC].fc_fsrcn = \
+ (dep)->de_fc[FC_LASTFC].fc_fsrcn; \
+} while (0)
+
/*
* This is the in memory variant of a dos directory entry. It is usually
* contained within a vnode.
OpenPOWER on IntegriCloud