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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user