Routine called when we are waiting for a userspace helper to start, and
receive a netlink message from it, saying it's ready to go. We check the
version for compatability, and if all looks good, call the completion
handler on the waiting code. If not, we complain bitterly and try to
continue without it.
Signed-off-by: Nigel Cunningham <[email protected]>
kernel/power/netlink.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/power/netlink.c b/kernel/power/netlink.c
index 7f06f7c..9094c92 100644
--- a/kernel/power/netlink.c
+++ b/kernel/power/netlink.c
@@ -152,3 +152,22 @@ static int nl_set_nofreeze(struct user_h
return 0;
}
+/*
+ * Called when the userspace process has informed us that it's ready to roll.
+ */
+static int nl_ready(struct user_helper_data *uhd, int version)
+{
+ if (version != uhd->interface_version) {
+ printk("%s userspace process using invalid interface version."
+ " Trying to continue without it.\n",
+ uhd->name);
+ if (uhd->not_ready)
+ uhd->not_ready();
+ return 1;
+ }
+
+ complete(&uhd->wait_for_process);
+
+ return 0;
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]