diff options
author | pho <pho@FreeBSD.org> | 2012-03-08 20:34:13 +0000 |
---|---|---|
committer | pho <pho@FreeBSD.org> | 2012-03-08 20:34:13 +0000 |
commit | 81cae127b038c1d057cde65bd0457d72894c7d86 (patch) | |
tree | aad6066be892321b414e941a20ce1ea75db47956 /sys/kern | |
parent | 19feaba08bc6b84c117bd21cc71e139c6d086ed7 (diff) | |
download | FreeBSD-src-81cae127b038c1d057cde65bd0457d72894c7d86.zip FreeBSD-src-81cae127b038c1d057cde65bd0457d72894c7d86.tar.gz |
Free up allocated memory used by posix_fadvise(2).
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 3 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2ef36d1..18fd937 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -104,6 +104,8 @@ static MALLOC_DEFINE(M_FILEDESC_TO_LEADER, "filedesc_to_leader", "file desc to leader structures"); static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures"); +MALLOC_DECLARE(M_FADVISE); + static uma_zone_t file_zone; @@ -2577,6 +2579,7 @@ _fdrop(struct file *fp, struct thread *td) error = fo_close(fp, td); atomic_subtract_int(&openfiles, 1); crfree(fp->f_cred); + free(fp->f_advice, M_FADVISE); uma_zfree(file_zone, fp); return (error); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a8bb661..1939899 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); #include <ufs/ufs/quota.h> -static MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); +MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); SDT_PROVIDER_DEFINE(vfs); SDT_PROBE_DEFINE(vfs, , stat, mode, mode); |