# HG changeset patch # User rsb # Date 1175047653 25200 # Node ID 73066af3aa6a6a8565332d1ddb6fda9c66dbcd66 # Parent 9871dc0ad022fc0049240cb34cb67a8b003c142a 6539420 Grab a mop! vfsinit() is leaking diff -r 9871dc0ad022 -r 73066af3aa6a usr/src/uts/common/fs/vfs.c --- 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);