mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 墳墓 <brianhsu.hsu@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: How to get dentry from inode number?
Date: Fri, 29 Jul 2005 23:02:53 +0800	[thread overview]
Message-ID: <615cd8d10507290802690dd50f@mail.gmail.com> (raw)

Hello, every body.

How can I get a full pathname from an inode number ? (Our data
structure only keep track inode number instead of pathname in
order to keep thin, so don't have any information but inode
number.)

I used iget_locked() to get a struct inode * from an inode number,
and use d_find_alias() to get a dentry, finally use d_path() to get
a absoulte path to the file.

But it only works when I opened the target file before I run
my program, or the d_find_alias() will return NULL.

I also tried d_alloc_anno() and d_splice_alias(), but it crashed
in the d_splice_alias().

So, which function should I check to find the answer?

             reply	other threads:[~2005-07-29 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-29 15:02 墳墓 [this message]
2005-07-29 15:11 ` Jörn Engel
2005-07-29 15:28 linux

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=615cd8d10507290802690dd50f@mail.gmail.com \
    --to=brianhsu.hsu@gmail.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®