Re: namei() query

From: akshata (akshata@giasdla.vsnl.net.in)
Date: Tue Apr 18 2000 - 02:33:58 EST


> > Hi,
> >
> > I'm trying to use namei() in a module, something like:
> >
> > namei("/tmp");
> >
> > but it returns an error (-14). I've seen namei() being used all over the
> > fs code in the kernel in a similar manner. Can somebody help me with this?
>
> Where, exactly, had you seen such code? namei() expects a pointer to
> userspace. Use lookup_dentry(name, LOOKUP_POSITIVE|LOOKUP_FOLLOW) to do
> the same for kernelspace names (assuming that you are talking about 2.3 -
> in 2.2 you don't have LOOKUP_POSITIVE, so it's lookup_dentry() with check
> for ->d_inode afterwards.
>
> Besides, constant (let alone absolute) pathnames in the kernel are Bad
> Thing(tm). What are you actually trying to do?
>
>

Thanks a lot for the tip. lookup_dentry() works fine. I'm trying to
develop a filesystem which will involve mounting a directory tree at a
mount point (don't ask me why, I don't know myself!) so I need to get a
handle on its inode. The constant pathname is just there to simplify
coding at an early stage. Eventually, I'll be taking the pathname as a
parameter.

Akshat

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:12 EST