kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: p.ittershagen@googlemail.com (Philipp Ittershagen)
To: kernelnewbies@lists.kernelnewbies.org
Subject: parent inode from the current struct inode
Date: Wed, 8 Feb 2012 09:39:55 +0100	[thread overview]
Message-ID: <CAC157GAd98bARO5EqGjwEYsF-3z9JO0QebJTaZq8x5-R70fMBA@mail.gmail.com> (raw)
In-Reply-To: <CAJbRZyXcRzTO6Bti+QJ-CjvPSt+82q=p+PXbHGpny5jNMY6U4A@mail.gmail.com>

Hi Jack,

On Wed, Feb 8, 2012 at 8:48 AM, Jack David <jd6589@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

  reply	other threads:[~2012-02-08  8:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  7:48 parent inode from the current struct inode Jack David
2012-02-08  8:39 ` Philipp Ittershagen [this message]
     [not found]   ` <9F2B2656C8747B498D56A7B30FF5EB9F01C0964B@CNMAIL13.cn.utstarcom.com>
2012-02-08 13:00     ` 答复: " Jack David
2012-02-08 13:55       ` Philipp Ittershagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC157GAd98bARO5EqGjwEYsF-3z9JO0QebJTaZq8x5-R70fMBA@mail.gmail.com \
    --to=p.ittershagen@googlemail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).