Re: Association between block device and block_device struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ahmed,
  
inode->i_bdev will give you block_device for any opened device file,
since during open file->dentry->inode association has already been made.

Thanks,
Vinod

On Thu, 07 Oct 2004 Ahmed A wrote :
>Hello,
>
>I am trying to find the corresponding block_device
>struct for a certain block device (e.g. /dev/hda) in
>2.6.  Is there a way I can find the association.
>
>If not, can someone suggest some code, by which give a
>block device name (e.g. hda), I can find out it's
>corresponding block_device struct.  I was thinking of
>one approach - "open" the block devive, get a file
>pointer back, and from that obtain the block_device
>pointer.  Any code sample or pointers would be highly
>appreciated.
>
>Regards,
>Ahmed.
>
>
>
>
>_______________________________
>Do you Yahoo!?
>Declare Yourself - Register online to vote today!
>http://vote.yahoo.com
>
>--
>Kernelnewbies: Help each other learn about the Linux kernel.
>Archive:       http://mail.nl.linux.org/kernelnewbies/
>FAQ:           http://kernelnewbies.org/faq/
>

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux