Re: Different dev name in inode structure

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

 



On Tue, May 27, 2003 at 12:23:04PM -0400, Michael Zhu wrote:
> kdev_t i_dev;
> kdev_t i_rdev;
> struct block_device * i_bdev;
> struct char_device * i_cdev;
> 
> My question is what is the exact difference of i_dev
> and i_rdev? Which one I should use?

man 2 stat
...
                  dev_t         st_dev;      /* device */
...
                  dev_t         st_rdev;     /* device type (if inode device) */

The difference is "device the file is located on" versus "device the
file represents".

> Another question is what that i_bdev and i_cdev are
> used for? They stand for what? 

Looking at the definitions of struct block_device and struct char_device,
it appears to me that these structs are used to serialize access to the
devices and provide reference counting. This is just a guess though ..
grep through the kernel source code for uses of i_bdev and i_cdev, and
try to figure out how these variables are used...

-- 
The DMCA is anti-consumer. The RIAA and MPAA have no right to rewrite
copyright laws to suit themselves.

Attachment: pgp00411.pgp
Description: PGP signature


[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