[comp.unix.internals] Swap Data for SUN OS - Refining the question

songer@orchestra.ecn.purdue.edu (Christopher M Songer) (10/02/90)

OK,
     I found the right symbol. _swapinfo seems to be the one, it
is the head of a linked list of all the swap devices and all the
info about their current state. I can get the vnode associated 
with it. I can get the vfs the vnode is a part of. I cannot find
an inode. I need the disk name. Any pointers on how to get from
a vnode or a vfs to the disk name would be more than appreciated.

Thanks,
Chris Songer
songer@ecn.purdue.edu

dan@kfw.COM (Dan Mick) (10/04/90)

In article <1990Oct2.150555.19405@ecn.purdue.edu> songer@orchestra.ecn.purdue.edu (Christopher M Songer) writes:
>Any pointers on how to get from
>a vnode or a vfs to the disk name would be more than appreciated.

The vnode has field v_type which enumerates to VBLK if it's a disk; in
that case, v_rdev is the major/minor dev num.  From there, it's a matter
of looking in bdevsw or searching /dev, whichever.