changeset 3904:73066af3aa6a

6539420 Grab a mop! vfsinit() is leaking
author rsb
date Tue, 27 Mar 2007 19:07:33 -0700
parents 9871dc0ad022
children 5082fe3bf481
files usr/src/uts/common/fs/vfs.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/vfs.c	Tue Mar 27 11:00:42 2007 -0700
+++ b/usr/src/uts/common/fs/vfs.c	Tue Mar 27 19:07:33 2007 -0700
@@ -338,9 +338,11 @@
 	int error;
 	int unused_ops;
 
-	/* Verify that fstype refers to a loaded fs (and not fsid 0). */
-
-	if ((fstype <= 0) || (fstype >= nfstype))
+	/*
+	 * Verify that fstype refers to a valid fs.  Note that
+	 * 0 is valid since it's used to set "stray" ops.
+	 */
+	if ((fstype < 0) || (fstype >= nfstype))
 		return (EINVAL);
 
 	if (!ALLOCATED_VFSSW(&vfssw[fstype]))
@@ -3822,7 +3824,6 @@
 vfsinit(void)
 {
 	struct vfssw *vswp;
-	vfsops_t *stray_vfsops;
 	int error;
 	extern int vopstats_enabled;
 	extern void vopstats_startup();
@@ -3862,8 +3863,7 @@
 	fem_init();
 
 	/* Initialize the dummy stray file system type. */
-	error = vfs_makefsops(stray_vfsops_template, &stray_vfsops);
-	vfssw[0].vsw_vfsops = *stray_vfsops; /* structure copy */
+	error = vfs_setfsops(0, stray_vfsops_template, NULL);
 
 	/* Initialize the dummy EIO file system. */
 	error = vfs_makefsops(EIO_vfsops_template, &EIO_vfsops);