Re: Obtaining property of block device.

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

 



You can use get_capacity() to get disk capacity......

<in genhd.h>
  static inline sector_t get_capacity(struct gendisk *disk)
{
         return disk->capacity;
 }

Thanks,
Vinod

On Thu, 07 Oct 2004 Ahmed A wrote :
>Hello,
>
>In kernel 2.4, there were global varibles that could
>be accessed to find out the capacity, sector size etc.
>of block devices.  In 2.6, these global variables does
>not exist.  Can someone tell me how I can get the
>properties (capacity, etc.) of block devices.  Is
>there an API.  I would like to obtain these info from
>within my driver (kernel space).
>
>Can someone point me to some website that explains
>this part in deatails.  I have read the article on LWN
>on Driver porting to 2.6.
>
>Thank you,
>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