Re: upcalls from kernel code to user space daemons

From: Chris Friesen
Date: Mon Jun 14 2004 - 13:33:50 EST


Steve French wrote:
Is there a good terse example of an upcall from a kernel module (such as
filesystem) to an optional user space helper daemon? The NFS RPC
example seems more complicated than what I would like as does the
captive ioctl approach which I see in a few places.

I simply need to poke a userspace daemon (e.g. launched by mount) to do
in userspace these two optional functions which are not available in
kernel and pass a small (under 64K) amount of data back to the kernel
module:
1) getHostByName: when the kernel cifs code detects a server crashes
and fails reconnecting the socket and the kernel code wants to see if
the hostname now has a new ip address.
2) package a kerberos ticket ala RFC2478 (SPNEGO)

One way to do it (or is this what you meant by captive ioctl?)

userspace daemon loops on ioctl()
kernel portion of ioctl call goes to sleep until something to do
when needed, fill in data and return to userspace
userspace does stuff, then passes data back down via ioctl()
ioctl() puts userspace back to sleep and continues on with other work

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