svn commit: r234661 - stable/8/sys/kern

Peter Holm pho at FreeBSD.org
Tue Apr 24 20:27:31 UTC 2012


Author: pho
Date: Tue Apr 24 20:27:31 2012
New Revision: 234661
URL: http://svn.freebsd.org/changeset/base/234661

Log:
  MFC: r232702
  
  Free up allocated memory used by posix_fadvise(2).

Modified:
  stable/8/sys/kern/kern_descrip.c
  stable/8/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/kern_descrip.c
==============================================================================
--- stable/8/sys/kern/kern_descrip.c	Tue Apr 24 19:08:40 2012	(r234660)
+++ stable/8/sys/kern/kern_descrip.c	Tue Apr 24 20:27:31 2012	(r234661)
@@ -91,6 +91,8 @@ static MALLOC_DEFINE(M_FILEDESC_TO_LEADE
 		     "file desc to leader structures");
 static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures");
 
+MALLOC_DECLARE(M_FADVISE);
+
 static uma_zone_t file_zone;
 
 
@@ -2361,6 +2363,7 @@ _fdrop(struct file *fp, struct thread *t
 		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);

Modified: stable/8/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/8/sys/kern/vfs_syscalls.c	Tue Apr 24 19:08:40 2012	(r234660)
+++ stable/8/sys/kern/vfs_syscalls.c	Tue Apr 24 20:27:31 2012	(r234661)
@@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_page.h>
 #include <vm/uma.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);


More information about the svn-src-all mailing list