FS: How to get the name of a directory given by an inode

Lars Reuther (lr1@irz301.inf.tu-dresden.de)
Sat, 28 Sep 1996 14:18:33 +0200 (MET DST)


Hi,

how can i get the name of a directory given by an inode (in my case I need
the full name of current->fs.pwd)?
The only idea I have is to read the parent directory, look for an entry
pointing to the given inode, read the parent directory of the parent
directory and so on, until I reach the root directory.
I hope this will work, but I think it will take quite a long time to
read a complex directory structure.
Are there any other (faster) ways to get the name?

Lars

+--------------------------------------+
| Lars Reuther |
| |
| Dresden University of Technology |
| Dept. of Computer Science |
| |
| E-Mail: |
| Lars.Reuther@irz.inf.tu-dresden.de |
| reuther@rcs.urz.tu-dresden.de |
| WWW: |
| http://www.inf.tu-dresden.de/~lr1 |
+--------------------------------------+