what's relationship between VFS inode and ext3_inode?

Zhang Shukun bitzsk at gmail.com
Tue Jun 2 12:05:48 UTC 2009


thanks for your answer!

my goal is : in kernel space , get the specific disk block numbers(or sector
number) of a file(such as /bin/ls).

because i want to use the block number in DomU, which is a VM in xen. when i
read or write a file in DomU, front end driver will send the block number to
back-end driver Dom0 , and then in dom0 i can check if the block could be
write or not.

2009/6/2 Theodore Tso <tytso at mit.edu>

> On Tue, Jun 02, 2009 at 04:56:33PM +0800, Zhang Shukun wrote:
> > hi,
> >
> > in kernel space ,if i get the i_ino(inode mumber ) of a file, and next
> how
> > could i get the block number of this file? in VFS layer the inode struct
> > haven't i_block[] array to point to the blocks. but in ext3_inode struct,
> it
> > has. what's the relationship between the VFS inode and ext3_inode?
> >
> >
> > how do i get the block number of a file ?  the path is as follow:
> >
> > filp_open("/bin/ls",O_RDONLY,0)---- -->struct file *------->struct dentry
> > *f_dentry----->struct inode *d_inode-------->struct inode{}------------->
> > ???------------>struct ext3_inode{}---------->__le32
> > i_block[EXT2_N_BLOCKS];
> >
> > from VFS inode to ext3_inode , i don't know how to transfer?? Thanks!
>
> What are you trying to do?  For userspace programs, just use the
> FIBMAP (or FIEMAP) ioctl's.
>
>                                                - Ted
>



-- 
Best regards,
张树坤
北京理工大学,计算机科学技术学院
Sucan
Computer Department,Beijing Institute of Technology,China
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20090602/a64e134a/attachment.htm>


More information about the Ext3-users mailing list