On 5/4/06, UZAIR LAKHANI <uzairr_bs1b@xxxxxxxxx> wrote:
Hello All, I want to find out how the file pointer from inode/dentry can be get. For example we can get inode pointer by using iget. In the struct file we can get inode/dentry (filp->f_dentry->d_inode) but how can we reversely get the struct file pointer from dentry/inode etc.
You can try to get the filp from filp->f_dentry->d_inode using the same way as list_entry macro in include/linux/list.h do and you have to do that list_entry kind of stuff two times to get to the filp from d_inode (as in one pass you can get f_dentry and then from f_dentry you can get to filp). I hope it will help but can't say that its a good way !
Secondly is this logically correct to get the file pointer from inode/dentry etc.
I can't say doing this is logically correct or not, but I can say if this really helps and you won't able to get the better way of accessing filp then you can do so or other people might give you some better idea but they probably need to know why and where you want to do this :) -- Fawad Lateef - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html