summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs/denode.h
diff options
context:
space:
mode:
authorsf <sf@openbsd.org>2017-05-29 13:48:12 +0000
committersf <sf@openbsd.org>2017-05-29 13:48:12 +0000
commitf4aaab5fd4219e21322d2fe25905a711d91e97da (patch)
treefe3785fa2ad1440108cf6f8d717157fd9f84a3e5 /sys/msdosfs/denode.h
parentzap scanio.h, found by deraadt (diff)
downloadwireguard-openbsd-f4aaab5fd4219e21322d2fe25905a711d91e97da.tar.xz
wireguard-openbsd-f4aaab5fd4219e21322d2fe25905a711d91e97da.zip
Implement VFS read clustering for MSDOSFS
This is the reverted commit by mpi@ from msdosfs_vnops.c 1.105 plus some additional tweaks to fix some cluster/block number confusion that lead to regressions when seeking past the end of a file. The original commit message was: The logic used in msdosfs_bmap() to loop calling pcbmap() comes from FreeBSD and is not really efficient but it is good enough since it is only called when generating I/O. With this diff I get a 100% improvement when reading big files from a crappy USB stick. With this and bread_cluster(9) modified to not re-fetch B_CACHED buffers, reading large contiguous files with chunk sizes of MAXPHYS is almost as fast as physio(9) on the same device. For a 'real world' example, when copying music files from a USB stick I see a speed jump from 15MB/s on -current to 24Mb/s with this diff. While here rename some 'lbn' variables into 'cn' to better reflect what we're dealing with. Tested by Mathieu, with support from deraadt@ ok mpi@
Diffstat (limited to 'sys/msdosfs/denode.h')
-rw-r--r--sys/msdosfs/denode.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h
index cdca90500ab..efa8192a06d 100644
--- a/sys/msdosfs/denode.h
+++ b/sys/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: denode.h,v 1.30 2016/08/30 19:47:23 sf Exp $ */
+/* $OpenBSD: denode.h,v 1.31 2017/05/29 13:48:12 sf Exp $ */
/* $NetBSD: denode.h,v 1.24 1997/10/17 11:23:39 ws Exp $ */
/*-
@@ -142,7 +142,6 @@ struct denode {
struct vnode *de_devvp; /* vnode of blk dev we live on */
uint32_t de_flag; /* flag bits */
dev_t de_dev; /* device where direntry lives */
- daddr_t de_lastr;
uint32_t de_dirclust; /* cluster of the directory file containing this entry */
uint32_t de_diroffset; /* offset of this entry in the directory cluster */
uint32_t de_fndoffset; /* offset of found dir entry */