summaryrefslogtreecommitdiff
path: root/sys/ntfs
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-01-14 09:44:58 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-01-14 09:44:58 +0000
commitd7e09610d269066ae45fb408440c8ed8b4b606a9 (patch)
treef8707d77108f9241ddc44fd780f27357ea9ae871 /sys/ntfs
parente3e8f2ccec9101fab90afe608e7bc9d94cc1beae (diff)
Free the directory block buffer at the completion of a readdir,
significantly reducing NTFS kernel memory usage. Without this the buffer is not usually freed until the vnode is reclaimed. Tested by Sebastian Neuper. ok beck@ krw@
Diffstat (limited to 'sys/ntfs')
-rw-r--r--sys/ntfs/ntfs_vnops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c
index a1d5458a282..2e169c1bb27 100644
--- a/sys/ntfs/ntfs_vnops.c
+++ b/sys/ntfs/ntfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vnops.c,v 1.28 2013/01/13 04:07:49 jsing Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.29 2013/01/14 09:44:57 jsing Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
@@ -597,7 +597,11 @@ ntfs_readdir(void *v)
if (ap->a_eofflag)
*ap->a_eofflag = VTONT(ap->a_vp)->i_size <= uio->uio_offset;
*/
- out:
+out:
+ if (fp->f_dirblbuf != NULL) {
+ free(fp->f_dirblbuf, M_NTFSDIR);
+ fp->f_dirblbuf = NULL;
+ }
free(cde, M_TEMP);
return (error);
}