static void lnet_selftest_exit(void) { int i; switch (lst_init_step) { case LST_INIT_CONSOLE: lstcon_console_fini(); case LST_INIT_FW: sfw_shutdown(); case LST_INIT_RPC: srpc_shutdown(); case LST_INIT_WI_TEST: for (i = 0; i < cfs_cpt_number(lnet_cpt_table()); i++) { if (!lst_sched_test[i]) continue; cfs_wi_sched_destroy(lst_sched_test[i]); } LIBCFS_FREE(lst_sched_test, sizeof(lst_sched_test[0]) * cfs_cpt_number(lnet_cpt_table())); lst_sched_test = NULL; case LST_INIT_WI_SERIAL: cfs_wi_sched_destroy(lst_sched_serial); lst_sched_serial = NULL; case LST_INIT_NONE: break; default: LBUG(); } }
static void exit_libcfs_module(void) { int rc; remove_proc(); CDEBUG(D_MALLOC, "before Portals cleanup: kmem %d\n", atomic_read(&libcfs_kmemory)); if (cfs_sched_rehash != NULL) { cfs_wi_sched_destroy(cfs_sched_rehash); cfs_sched_rehash = NULL; } cfs_crypto_unregister(); cfs_wi_shutdown(); rc = misc_deregister(&libcfs_dev); if (rc) CERROR("misc_deregister error %d\n", rc); #if LWT_SUPPORT lwt_fini(); #endif cfs_cpu_fini(); if (atomic_read(&libcfs_kmemory) != 0) CERROR("Portals memory leaked: %d bytes\n", atomic_read(&libcfs_kmemory)); rc = libcfs_debug_cleanup(); if (rc) printk(KERN_ERR "LustreError: libcfs_debug_cleanup: %d\n", rc); fini_rwsem(&ioctl_list_sem); fini_rwsem(&cfs_tracefile_sem); libcfs_arch_cleanup(); }