示例#1
0
文件: vfsops.c 项目: joushou/mac9p
__private_extern__ kern_return_t
kext_stop_9p(kmod_info_t * ki, void * d)
{
#pragma unused(ki)
#pragma unused(d)
	TRACE();
	if (vfs_fsremove(vfstable_9p))
		return KERN_FAILURE;

	vfstable_9p = NULL;
	lck_grp_free(lck_grp_9p);

	return KERN_SUCCESS;
}
示例#2
0
kern_return_t romfs_stop (kmod_info_t * ki, void * d) {
	errno_t error;
	
	printf("Unloading ROMFS.\n");
	
	/* Try to unregister. */
	error = vfs_fsremove(romfs_vfsconf);
	if(error)
		printf("Error unregistering ROMFS with VFS.\n");
	else
		printf("Unregistered ROMFS with VFS.\n");
	
	return error ? KERN_FAILURE : KERN_SUCCESS;
}
示例#3
0
int  
zfs_module_stop(__unused kmod_info_t *ki, __unused void *data)
{
	if (zfs_active_fs_count != 0 ||
	    spa_busy() ||
	    zvol_busy() ||
	    vfs_fsremove(zfs_vfsconf) != 0) {
		return KERN_FAILURE;   /* ZFS Still busy! */
	}
	zfs_fini();

	printf("zfs_module_stop: memory footprint %d (kalloc %d, kernel %d)\n",
		zfs_footprint.current, zfs_kallocmap_size, zfs_kernelmap_size);
	
	return KERN_SUCCESS;
}
/**
 * Stop the kernel module.
 */
static kern_return_t vboxSfDwnModuleUnload(struct kmod_info *pKModInfo, void *pvData)
{
    RT_NOREF(pKModInfo, pvData);
#ifdef DEBUG
    printf("vboxSfDwnModuleUnload\n");
    RTLogBackdoorPrintf("vboxSfDwnModuleUnload\n");
#endif


    /*
     * Are we busy?  If so fail.  Otherwise try deregister the file system.
     */
    if (g_cVBoxSfMounts > 0)
    {
        LogRel(("VBoxSF: Refusing to unload with %u active mounts\n", g_cVBoxSfMounts));
        return KERN_NO_ACCESS;
    }

    if (g_pVBoxSfVfsTableEntry)
    {
        int rc = vfs_fsremove(g_pVBoxSfVfsTableEntry);
        if (rc != 0)
        {
            LogRel(("VBoxSF: vfs_fsremove failed: %d\n", rc));
            return KERN_NO_ACCESS;
        }
    }

    /*
     * Disconnect and terminate libraries we're using.
     */
    if (g_SfClientDarwin.handle != NULL)
    {
        VbglR0SfDisconnect(&g_SfClientDarwin);
        g_SfClientDarwin.handle = NULL;
    }

    if (g_pVBoxGuest)
    {
        g_pVBoxGuest->release();
        g_pVBoxGuest = NULL;
    }

    VbglR0SfTerm();
    RTR0Term();
    return KERN_SUCCESS;
}
/**
 * Unregister VBoxFS filesystem.
 *
 * @returns IPRT status code.
 */
int VBoxVFSUnRegisterFilesystem(void)
{
    int rc;

    if (g_oVBoxVFSHandle == 0)
        return VERR_INVALID_PARAMETER;

    rc = vfs_fsremove(g_oVBoxVFSHandle);
    if (rc)
    {
        PINFO("Unable to unregister VBoxVFS filesystem (%d)", rc);
        return VERR_GENERAL_FAILURE;
    }

    g_oVBoxVFSHandle = 0;

    PINFO("VBoxVFS filesystem successfully unregistered");
    return VINF_SUCCESS;
}