vchain revision 1.6 1 # $NetBSD: vchain,v 1.6 2009/11/18 18:04:26 eeh Exp $
2
3 # @(#)vchain 8.1 (Berkeley) 6/10/93
4 #
5
6 define vchain
7 set $num = 0
8
9 set $vp=(struct vnode *)$arg0
10 while ($vp)
11 printf "vp: 0x%lx freelist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
12 $vp, $vp->v_freelist.tqe_next, $vp->v_uobj.uo_refs, \
13 $vp->v_iflag, $vp->v_vflag, $vp->v_uflag
14 set $num++
15 set $vp = $vp->v_mntvnodes.tqe_next
16 end
17 printf "Number of vnodes: %d\n", $num
18 end
19
20 document vchain
21 Given a vnode, follow its mount pointers
22 end
23
24 define vprint
25 set $vp=(struct vnode *)$arg0
26 set $ip=(struct inode *)$vp->v_data
27 end
28
29 define mp_vchain
30 set $mp = (struct mount *)$arg0
31 vchain $mp->mnt_vnodelist.tqh_first
32 end
33 document mp_vchain
34 print the vnode chain for a given mount point
35 end
36
37 define vall
38 set $mp=mountlist.cqh_first
39 while ($mp)
40 printf "\tmount point at 0x%x\n", $mp
41 mp_vchain $mp
42 set $mp=$mp->mnt_list.cqe_next
43
44 # "break"
45 if ((const void *)$mp == (const void *)&mountlist)
46 set $mp = 0
47 end
48 end
49 end
50 document vall
51 print vnode chains for all mount points
52 end
53
54 define mountdump
55 set $mp=mountlist.cqh_first
56 while ($mp)
57 printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \
58 $mp->mnt_stat->f_mntfromname, $mp->mnt_stat->f_mntonname, \
59 $mp->mnt_op->vfs_name, $mp, $mp->mnt_data
60 set $mp=$mp->mnt_list.cqe_next
61 if ((const void *)$mp == (const void *)&mountlist)
62 set $mp = 0
63 end
64 end
65 end