From: Eric W. Biederman <ebiederm@xmission.com>
This patch starts kbenpd using kthread_run replacing
a combination of kernel_thread and daemonize. Making
the code a little simpler and more maintainable.
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
net/bluetooth/bnep/core.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index a9f1e88..de3caed 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -32,6 +32,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/init.h>
@@ -473,7 +474,6 @@ static int bnep_session(void *arg)
BT_DBG("");
- daemonize("kbnepd %s", dev->name);
set_user_nice(current, -15);
init_waitqueue_entry(&wait, current);
@@ -539,6 +539,7 @@ static struct device *bnep_get_device(struct bnep_session *session)
int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
{
+ struct task_struct *task;
struct net_device *dev;
struct bnep_session *s, *ss;
u8 dst[ETH_ALEN], src[ETH_ALEN];
@@ -598,9 +599,10 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
__bnep_link_session(s);
- err = kernel_thread(bnep_session, s, CLONE_KERNEL);
- if (err < 0) {
+ task = kthread_run(bnep_session, s, "kbnepd %s", dev->name);
+ if (IS_ERR(task)) {
/* Session thread start failed, gotta cleanup. */
+ err = PTR_ERR(task);
unregister_netdev(dev);
__bnep_unlink_session(s);
goto failed;
--
1.5.0.g53756
-
| Ryan Hope | reiser4 for 2.6.27-rc1 |
| Michael Kerrisk | Re: Slow DOWN, please!!! |
| Greg KH | [ANNOUNCE] linux-staging tree created |
| Ingo Molnar | Re: Rescheduling interrupts |
git: | |
| Sverre Rabbelier | Git vs Monotone |
| Kyle Moffett | Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Steffen Prohaska | Re: [msysGit] Re: safecrlf not in 1.5.4 |
| Shawn O. Pearce | [PATCH] Correct dir.c to compile on Solaris 9 |
| Richard Stallman | Real men don't attack straw men |
| Jerome Santos | sshd.config and AllowUsers |
| Calomel | Re: Remove escape characters from file |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Sunando Sen | Re: [Q] "Cannot execute /bin/*sh: Permission denied" prevents login |
| C Wayne Huling | Re: Can males come from... |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Craig I. Hagan | Re: Segate ST02 problems |
