Author: bonefish Date: 2010-02-27 21:27:52 +0100 (Sat, 27 Feb 2010) New Revision: 35641 Changeset: http://dev.haiku-os.org/changeset/35641/haiku Modified: haiku/trunk/src/system/kernel/fs/rootfs.cpp Log: Make use of the entry cache. Modified: haiku/trunk/src/system/kernel/fs/rootfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/rootfs.cpp 2010-02-27 20:09:19 UTC (rev 35640) +++ haiku/trunk/src/system/kernel/fs/rootfs.cpp 2010-02-27 20:27:52 UTC (rev 35641) @@ -13,20 +13,21 @@ # include "hash.h" # include "list.h" #else +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +# include <sys/stat.h> + +# include <fs_cache.h> # include <KernelExport.h> -# include <vfs.h> +# include <NodeMonitor.h> + # include <debug.h> # include <khash.h> # include <lock.h> # include <util/AutoLock.h> +# include <vfs.h> # include <vm/vm.h> - -# include <NodeMonitor.h> - -# include <sys/stat.h> -# include <malloc.h> -# include <string.h> -# include <stdio.h> #endif @@ -344,6 +345,8 @@ if (status != B_OK) return status; + entry_cache_remove(fs->volume->id, dir->id, name); + return remove_node(fs, dir, vnode); } @@ -467,6 +470,8 @@ if (status != B_OK) return status; + entry_cache_add(fs->volume->id, dir->id, name, vnode->id); + *_id = vnode->id; return B_OK; } @@ -641,6 +646,7 @@ rootfs_insert_in_dir(fs, dir, vnode); hash_insert(fs->vnode_list_hash, vnode); + entry_cache_add(fs->volume->id, dir->id, name, vnode->id); notify_entry_created(fs->id, dir->id, name, vnode->id); return B_OK; @@ -880,6 +886,8 @@ } vnode->stream.symlink.length = strlen(path); + entry_cache_add(fs->volume->id, dir->id, name, vnode->id); + notify_entry_created(fs->id, dir->id, name, vnode->id); return B_OK; @@ -944,6 +952,7 @@ return B_NAME_IN_USE; // so we can cleanly remove it + entry_cache_remove(fs->volume->id, toDirectory->id, toName); remove_node(fs, toDirectory, targetVnode); } @@ -961,6 +970,7 @@ } // remove it from the dir + entry_cache_remove(fs->volume->id, fromDirectory->id, fromName); rootfs_remove_from_dir(fs, fromDirectory, vnode); // Add it back to the dir with the new name. @@ -968,6 +978,8 @@ // so that it keeps sorted correctly. rootfs_insert_in_dir(fs, toDirectory, vnode); + entry_cache_add(fs->volume->id, toDirectory->id, toName, vnode->id); + notify_entry_moved(fs->id, fromDirectory->id, fromName, toDirectory->id, toName, vnode->id); @@ -1092,8 +1104,10 @@ return status; } - if (name != NULL) + if (name != NULL) { + entry_cache_add(fs->volume->id, dir->id, name, vnode->id); notify_entry_created(fs->id, dir->id, name, vnode->id); + } return B_OK; } @@ -1223,4 +1237,3 @@ &rootfs_mount, }; -