Re: [PATCH] rxrpc: use kthread_ API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Hellwig <[email protected]> wrote:

> Use the kthread_ API instead of opencoding lots of hairy code for kernel
> thread creation and teardown.

I take it daemonize() does not now need to be called because the new process
derives from keventd.

You've also broken things... The waitqueue is there for a specific reason:
namely so that I can have multiple threads.

Actually, RxRPC and AFS should be made to use rpciod, except that Trond hasn't
got around to documenting it yet.

> +static struct task_struct *krxiod_thread;

That should be rxrpc_krxiod_thread.

> +	krxiod_thread = kthread_run(rxrpc_krxiod, NULL, "krxiod");
> +	if (IS_ERR(krxiod_thread))
> +		return PTR_ERR(krxiod_thread);
> +	return 0;

Don't assign an error to (rxrpc_)krxiod_thread.

> +static struct task_struct *krxsecd_thread;

Ditto on name.

> +	krxsecd_thread = kthread_run(rxrpc_krxsecd, NULL, "krxsecd");
> +	if (IS_ERR(krxsecd_thread))
> +		return PTR_ERR(krxsecd_thread);
> +	return 0;

Ditto on assignment of error.

> +static struct task_struct *krxtimod_thread;

Ditto on name (I'd got this one wrong too).

> +	krxtimod_thread = kthread_run(krxtimod, NULL, "krxtimod");
> +	if (IS_ERR(krxtimod_thread))
> +		return PTR_ERR(krxtimod_thread);
> +	return 0;

Ditto on assignment of error.

David
-
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]
  Powered by Linux