Re: How to get dentry from inode number?

From: linux
Date: Fri Jul 29 2005 - 10:31:23 EST


> 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.)

Except in extreme circumstances (there's some horrible kludgery in the
NFS code), you don't. Just store a dentry pointer to begin with; it's
easy to map from dentry to inode.

In addition to files with multiple names, you can have files with no
names, made by the usual Unix trick of deleting a file after opening it.


The NFS kludgery is required by the short-sighted design of the NFS
protocol. Don't emulate it, or you will be lynched by a mob of angry
kernel developers with torches and pitchforks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/