Skip to contentSkip to conversation

string to inode conversion

DISCUSSION [email protected] 3 participants 4 messages Jan 15, 2006

lore
Share & tools
lore
#0 lore raw

Hi

I was wondering how I can get from a string with a path like "/home" or "/lib/libc-2.3.5.so" a struct inode.

Thanks for your help.

#1 lore raw
Quoted 4 lines · On Sun, 2006-01-15 at 19:57 +0100, [email protected] wrote:

Hi

I was wondering how I can get from a string with a path like "/home" or "/lib/libc-2.3.5.so" a struct inode.

which namespace do you want this in? The init one? or the one from the user? (most traditional linux distributions only have one namespace, but now that COW namespaces are merged I expect distros to start experimenting with per user /tmp, or per-daemon data etc etc)

This is not a trivial thing... you need a "context" into which you can ask that question (basically a process)

#2 lore raw

Hi

This should be in kernel space, in the context of system calls.

Basically I'm trying to learn how sys_open() goes from char *filename to a struct inode. I know (or think) that sys_open() doesn't actually use a struct inode, but I wonder how that would go.

Thanks

Quoted 14 lines · Arjan van de Ven
Quoted 4 lines · On Sun, 2006-01-15 at 19:57 +0100, [email protected] wrote:

Hi

I was wondering how I can get from a string with a path like "/home" or "/lib/libc-2.3.5.so" a struct inode.

which namespace do you want this in? The init one? or the one from the user? (most traditional linux distributions only have one namespace, but now that COW namespaces are merged I expect distros to start experimenting with per user /tmp, or per-daemon data etc etc)

This is not a trivial thing... you need a "context" into which you can ask that question (basically a process)

#3 lore raw
Quoted 3 lines · On 1/15/06, [email protected] <[email protected]> wrote:

Basically I'm trying to learn how sys_open() goes from char *filename to a struct inode. I know (or think) that sys_open() doesn't actually use a struct inode, but I wonder how that would go.

Look at ext2_lookup in fs/ext2/namei.c for example. It depends on the filesystem.

-Bob