Skip to contentSkip to conversation

Mapping Inode to File

DISCUSSION Bodo Eggert 3 participants 3 messages Oct 22, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Artur Baruchi

Hi Guys.

Is there a way to map an Inode number to a File (file path and name) in a kernel module ?

Imagine this:

ln /foo/bar/baz /bar/baz/foo
sleep 2147483647 < /foo/bar/baz &
pivot_root /mnt /mnt/asd
chroot /mnt/asd/foo

What is the name you'd assign to that inode?

#2 lore raw

Sorry, didnt understand your point.

Could you please clarify?

Note that I need to retrieve the file name in Kernel Space, Im able to get the inode, but now I need to convert this inode to a name (something that I could use).

Thanks in advance.

Att.
Artur Baruchi

Quoted 17 lines · Bodo Eggert
Quoted 4 lines · Artur Baruchi

Hi Guys.

Is there a way to map an Inode number to a File (file path and name) in a kernel module ?

Imagine this:

ln /foo/bar/baz /bar/baz/foo
sleep 2147483647 < /foo/bar/baz &
pivot_root /mnt /mnt/asd
chroot /mnt/asd/foo

What is the name you'd assign to that inode?

#3 lore raw

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

Quoted 3 lines · Artur Baruchi

Sorry, didnt understand your point.

Could you please clarify?

The point is that, no, it's not simple to do this at all.

Quoted 3 lines

Note that I need to retrieve the file name in Kernel Space, Im able to get the inode, but now I need to convert this inode to a name (something that I could use).

How about explaining why you need to get the file name from within the kernel? Perhaps there's a better way to do what you are trying to accomplish.

thanks,

greg k-h