improve debug command vnode_cache: it now accepts a device arg

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18618 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-08-24 20:54:24 +00:00
parent 17c6d00009
commit 355efe3ec1
+7
View File
@@ -2379,12 +2379,19 @@ dump_vnode_caches(int argc, char **argv)
struct hash_iterator iterator; struct hash_iterator iterator;
struct vnode *vnode; struct vnode *vnode;
// restrict dumped nodes to a certain device if requested
mount_id device = -1;
if (argc > 1)
device = atoi(argv[1]);
kprintf("address dev inode cache size pages\n"); kprintf("address dev inode cache size pages\n");
hash_open(sVnodeTable, &iterator); hash_open(sVnodeTable, &iterator);
while ((vnode = (struct vnode *)hash_next(sVnodeTable, &iterator)) != NULL) { while ((vnode = (struct vnode *)hash_next(sVnodeTable, &iterator)) != NULL) {
if (vnode->cache == NULL) if (vnode->cache == NULL)
continue; continue;
if (device != -1 && vnode->device != device)
continue;
// count pages in cache // count pages in cache
size_t numPages = 0; size_t numPages = 0;