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

View File

@ -2378,6 +2378,11 @@ dump_vnode_caches(int argc, char **argv)
{
struct hash_iterator iterator;
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");
@ -2385,6 +2390,8 @@ dump_vnode_caches(int argc, char **argv)
while ((vnode = (struct vnode *)hash_next(sVnodeTable, &iterator)) != NULL) {
if (vnode->cache == NULL)
continue;
if (device != -1 && vnode->device != device)
continue;
// count pages in cache
size_t numPages = 0;