thanks for your answer!<br><br>my goal is : in kernel space , get the specific disk block numbers(or sector number) of a file(such as /bin/ls).<br><br>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. <br>

<br><div class="gmail_quote">2009/6/2 Theodore Tso <span dir="ltr"><<a href="mailto:tytso@mit.edu">tytso@mit.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Tue, Jun 02, 2009 at 04:56:33PM +0800, Zhang Shukun wrote:<br>
> hi,<br>
><br>
> in kernel space ,if i get the i_ino(inode mumber ) of a file, and next how<br>
> could i get the block number of this file? in VFS layer the inode struct<br>
> haven't i_block[] array to point to the blocks. but in ext3_inode struct, it<br>
> has. what's the relationship between the VFS inode and ext3_inode?<br>
><br>
><br>
> how do i get the block number of a file ?  the path is as follow:<br>
><br>
> filp_open("/bin/ls",O_RDONLY,0)---- -->struct file *------->struct dentry<br>
> *f_dentry----->struct inode *d_inode-------->struct inode{}-------------><br>
> ???------------>struct ext3_inode{}---------->__le32<br>
> i_block[EXT2_N_BLOCKS];<br>
><br>
> from VFS inode to ext3_inode , i don't know how to transfer?? Thanks!<br>
<br>
</div>What are you trying to do?  For userspace programs, just use the<br>
FIBMAP (or FIEMAP) ioctl's.<br>
<br>
                                                - Ted<br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>张树坤<br>北京理工大学,计算机科学技术学院<br>Sucan<br>Computer Department,Beijing Institute of Technology,China<br>