How to get dentry from inode number?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux