parent inode from the current struct inode

Philipp Ittershagen p.ittershagen at googlemail.com
Wed Feb 8 03:39:55 EST 2012


Hi Jack,

On Wed, Feb 8, 2012 at 8:48 AM, Jack David <jd6589 at gmail.com> wrote:
> Hi All,
>
> Is possible to get parent directory's inode structure from the current
> inode? If so, how can I do that?

It should be possible to use the container_of macro to get the parent
dentry struct. Then, you can get the parent dentry d_parent and access
its inode. (Please correct me, if I'm wrong. I didn't test it).



Philipp



More information about the Kernelnewbies mailing list