On Mon, 2009-06-08 at 20:37 +0000, Dave Anderson wrote:
----- "Bob Montgomery" <bob.montgomery(a)hp.com>
wrote:
> When I tried the dev command and it bombed at the chrdev stuff before
> getting to the blkdev stuff, I was motivated to get it going enough to
> see if it would help answer my question, but it doesn't print anything
> (like hd_struct pointers) that could help me with my problem. But I
> figured someone had once wanted that device info, so it might as well
> work...
Re: your quest to find an hd_struct, perhaps the command could be made a
bit more useful in that respect as well.
For character devices, the cdev_map.probes[255] probe structure's
"data" field points to a cdev structure, where the file_operations
pointer is found.
For block devices, the bdev_map.probes[255] probe structure's
"data" field points to a gendisk structure, where the file_operations
pointer is found. But the gendisk structure also has an embedded
hd_struct, which is presumably what you were looking for?
If that's the case, then maybe the command should display the address
of the cdev or gendisk structures associated with the device?
Dave
That would certainly make the command a lot more useful for digging
around. I ended up using "list -o 0xa0 -H all_bdevs -s block_device"
and pulling the (struct hd_struct *)bd_part field out of all the struct
block_device's in the list. By doing that I eventually found 3
hd_structs for partition 0, 1, and 5 of the disk of interest. The
gendisk struct for the disk would give me the part0 hd_struct and the
part_tbl pointer should get me to all the others. That would be a lot
easier.
Thanks,
Bob Montgomery