Re: namei() query

From: Alexander Viro (viro@math.psu.edu)
Date: Tue Apr 18 2000 - 03:05:26 EST


On Tue, 18 Apr 2000, David S. Miller wrote:

> This would work:
>
> mm_segment_t orig_fs;
>
> orig_fs = get_fs();
> set_fs(KERNEL_DS);
> err = namei("/tmp");
> set_fs(old_fs);
>
> The namei function expects user space pointers, you're sending
> it a kernel pointer, so you have to adjust your mm segment during
> the call.

Ewwww... Yes, it would work, but this is ugly as hell. Mixing user- and
kernelspace pointers is sometimes the only way to do things, but it's
about as lovely as abusing union to transform double into int[2] and
back. In case of namei() it is _not_ needed - lookup_dentry() does the
job just fine.

-
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