From a64c204e235968fa393bd00a31d2da25c0a1997c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 21 Jul 2009 12:33:15 +0000 Subject: [PATCH] * The module iteration code now ignores entries named "dev", and "bin" - this reduced the boot time in VMware by several seconds, and should also help with booting from CD. * Added TODOs on how to further improve the situation in the future. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31672 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/module.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/module.cpp b/src/system/kernel/module.cpp index 231030f2e6..c0f9223b9a 100644 --- a/src/system/kernel/module.cpp +++ b/src/system/kernel/module.cpp @@ -956,6 +956,9 @@ nextPath: } nextModuleImage: + // TODO: remember which directories were already scanned, and don't search + // through them again, unless they change (use DirectoryWatcher) + if (iterator->current_header == NULL) { // get next entry from the current directory @@ -989,9 +992,13 @@ nextModuleImage: goto nextModuleImage; } - // we're not interested in traversing these again + // we're not interested in traversing these (again) if (!strcmp(dirent->d_name, ".") - || !strcmp(dirent->d_name, "..")) + || !strcmp(dirent->d_name, "..") + // TODO: this is a bit unclean, as we actually only want to prevent + // drivers/bin and drivers/dev to be scanned + || !strcmp(dirent->d_name, "bin") + || !strcmp(dirent->d_name, "dev")) goto nextModuleImage; // build absolute path to current file @@ -1014,7 +1021,7 @@ nextModuleImage: if (S_ISDIR(stat.st_mode)) { status = iterator_push_path_on_stack(iterator, iterator->current_module_path, iterator->path_base_length); - if (status < B_OK) + if (status != B_OK) return status; iterator->current_module_path = NULL;