svn commit: r234659 - stable/9/sys/kern

Peter Holm pho at FreeBSD.org
Tue Apr 24 19:00:43 UTC 2012


Author: pho
Date: Tue Apr 24 19:00:42 2012
New Revision: 234659
URL: http://svn.freebsd.org/changeset/base/234659

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

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

Modified: stable/9/sys/kern/kern_descrip.c
==============================================================================
--- stable/9/sys/kern/kern_descrip.c	Tue Apr 24 18:41:17 2012	(r234658)
+++ stable/9/sys/kern/kern_descrip.c	Tue Apr 24 19:00:42 2012	(r234659)
@@ -104,6 +104,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;
 
 
@@ -2577,6 +2579,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/9/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/9/sys/kern/vfs_syscalls.c	Tue Apr 24 18:41:17 2012	(r234658)
+++ stable/9/sys/kern/vfs_syscalls.c	Tue Apr 24 19:00:42 2012	(r234659)
@@ -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);


More information about the svn-src-all mailing list