summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-09-20 23:27:58 +0000
committerdillon <dillon@FreeBSD.org>1999-09-20 23:27:58 +0000
commit3bddba795147da5c018578644f1757f6e636baf5 (patch)
treedb5c683fc7317e476f83f4d362edb5db22f5cbe4 /sys/msdosfs
parent163338fbe7a66e7733f929fb8a033966c8e69b0d (diff)
downloadFreeBSD-src-3bddba795147da5c018578644f1757f6e636baf5.zip
FreeBSD-src-3bddba795147da5c018578644f1757f6e636baf5.tar.gz
More removals of vnode->v_lastr, replaced by preexisting seqcount
heuristic to detect sequential operation. VM-related forced clustering code removed from ufs in preparation for a commit to vm/vm_fault.c that does it more generally. Reviewed by: David Greenman <dg@root.com>, Alan Cox <alc@cs.rice.edu>
Diffstat (limited to 'sys/msdosfs')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c4
-rw-r--r--sys/msdosfs/msdosfs_vnops.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 625690d..8e3d0b3 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -769,8 +769,8 @@ msdosfs_unmount(mp, mntflags, p)
printf("msdosfs_umount(): just before calling VOP_CLOSE()\n");
printf("flag %08lx, usecount %d, writecount %d, holdcnt %ld\n",
vp->v_flag, vp->v_usecount, vp->v_writecount, vp->v_holdcnt);
- printf("lastr %d, id %lu, mount %p, op %p\n",
- vp->v_lastr, vp->v_id, vp->v_mount, vp->v_op);
+ printf("id %lu, mount %p, op %p\n",
+ vp->v_id, vp->v_mount, vp->v_op);
printf("freef %p, freeb %p, mount %p\n",
vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev,
vp->v_mount);
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 2407e2e..05139a7 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -559,6 +559,7 @@ msdosfs_read(ap)
daddr_t lbn;
daddr_t rablock;
int rasize;
+ int seqcount;
struct buf *bp;
struct vnode *vp = ap->a_vp;
struct denode *dep = VTODE(vp);
@@ -575,6 +576,8 @@ msdosfs_read(ap)
if (orig_resid <= 0)
return (0);
+ seqcount = ap->a_ioflag >> 16;
+
isadir = dep->de_Attributes & ATTR_DIRECTORY;
do {
lbn = de_cluster(pmp, uio->uio_offset);
@@ -600,15 +603,15 @@ msdosfs_read(ap)
error = bread(pmp->pm_devvp, lbn, blsize, NOCRED, &bp);
} else {
rablock = lbn + 1;
- if (vp->v_lastr + 1 == lbn &&
+ if (seqcount > 1 &&
de_cn2off(pmp, rablock) < dep->de_FileSize) {
rasize = pmp->pm_bpcluster;
error = breadn(vp, lbn, pmp->pm_bpcluster,
&rablock, &rasize, 1, NOCRED, &bp);
- } else
+ } else {
error = bread(vp, lbn, pmp->pm_bpcluster,
NOCRED, &bp);
- vp->v_lastr = lbn;
+ }
}
n = min(n, pmp->pm_bpcluster - bp->b_resid);
if (error) {
OpenPOWER on IntegriCloud