From: Guang Z. <ze...@ho...> - 2006-06-16 19:13:08
|
Hi all,I am totoally newbie to filesystem development in Linux, so please k= indly provide more details/advices in replying my question, thanks!I am rea= ding the 3.0 code, and find in function squashfs_iget_2, there are quit a f= ew use of macro SQUASHFS_I on the inode structure named i. As far as I can = understand, SQUASHFS_I is a wrapper macro to get the squashfs_inode_info st= ructure which the inode structure is embedded in. What I cannot understand = is that the variable i, which is of type struct inode, is created from scra= tch by calling squashfs_new_inode, not embedded within some squashfs_inode_= info structure (see implementation of squashfs_new_inode in inode.c). So it= seems that we have no knowledge of the memory space preceeding or succeedi= ng of the inode structure, but why it seems to be legitimate to reversely l= ookup the enclosing squashfs_inode_info structure (because the code just wo= rked!). Can anyone shed some light on this? Thanks.Regards,Guang Zhu= |