Re: namei() query

From: Alexander Viro (viro@math.psu.edu)
Date: Tue Apr 18 2000 - 01:41:28 EST


On Tue, 18 Apr 2000, akshata wrote:

> 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?

-
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