namei() and opening files in the kernel

Gerry Toll (gtoll@cs.cornell.edu)
Tue, 30 Apr 1996 00:37:02 -0400


Hi,

I'm trying to implement a pseudo-ethernet card using a character device-based
network interface being developed here at Cornell. I am trying to access the
character device file from within the kernel. Currently, I am trying to use
namei() to get the inode for the device. The namei() call appears to fail in a
call to find_vma(). I've been trying to trace the point of failure, but I
don't understand what the vma_find() code is doing. My general impression is
that it's trying to locate the supplied pathname in virtual memory, and it's
failing because it's already in kernel space.

I'm using the 1.3.71 kernel tree. Both the character and net drivers are implemented as modules.

My question is: am I doing something I shouldn't? If so, how should I be doing this? If not, any ideas about what I might be doing wrong?

I imagine I could make the ioctls public and access them directly, but it seems like I want to let the kernel know that I'm using the device and that I should, therefore, go through the formality of opening it explicitly. (Is it obvious that I really don't know what I'm doing? :)

Any hints, tips, tricks, advice, etc. would be greatly appreciated. (I've already read through the KHG, and it doesn't really seem to address this kind of thing.)

Thanks in advance,
Gerry