diff options
Diffstat (limited to 'sys/msdosfs/msdosfs_fat.c')
-rw-r--r-- | sys/msdosfs/msdosfs_fat.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/msdosfs/msdosfs_fat.c b/sys/msdosfs/msdosfs_fat.c index 929ac9a4748..a997a7789c9 100644 --- a/sys/msdosfs/msdosfs_fat.c +++ b/sys/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_fat.c,v 1.22 2011/07/04 04:30:41 tedu Exp $ */ +/* $OpenBSD: msdosfs_fat.c,v 1.23 2012/04/05 09:26:40 mikeb Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.26 1997/10/17 11:24:02 ws Exp $ */ /*- @@ -952,6 +952,13 @@ extendfile(struct denode *dep, uint32_t count, struct buf **bpp, uint32_t *ncp, return (error); } + /* + * Preserve value for the last cluster before extending the file + * to speed up further lookups. + */ + fc_setcache(dep, FC_OLASTFC, dep->de_fc[FC_LASTFC].fc_frcn, + dep->de_fc[FC_LASTFC].fc_fsrcn); + while (count > 0) { /* * Allocate a new cluster chain and cat onto the end of the |