Re: namei() and opening files in the kernel

Matthias Urlichs (smurf@smurf.noris.de)
Wed, 1 May 1996 09:19:30 +0100


In linux.dev.kernel, article <199604300437.AAA02592@laufey.cs.cornell.e=
du>,
Gerry Toll <gtoll@cs.cornell.edu> writes:
>=20
> I'm trying to implement a pseudo-ethernet card using a character devi=
ce-based=20
> network interface being developed here at Cornell. I am trying to acc=
ess the=20
> character device file from within the kernel. Currently, I am trying =
to use=20
> namei() to get the inode for the device. The namei() call appears to =
fail in a=20
> call to find_vma().

Possibly you forgot to call set_fs(get_ds()), to tell the kernel that y=
our
file name is in kernel space already.

This trick is used several times in the kernel; look for it.

--=20
Stockmayer's Theorem: If it looks easy, it's tough. If it looks tough=
,
it's damn near impossible.
--=20
Matthias Urlichs \ Noris Network GmbH i.Gr/ Xlink-POP N=FCrnberg=
=20
Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@nor=
is.de
90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc'i=
ng
PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE=20
Click <A HREF=3D"http://info.noris.de/~smurf/finger">here</A>. =
42