Re: [PATCH 3/7] SUNRPC: make new svc_create_kthread function

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

 



> +int
> +svc_create_kthread(svc_thread_fn func, struct svc_rqst *rqstp)
> +{
> +	struct svc_serv *serv = rqstp->rq_server;
> +	struct task_struct *task;
> +
> +	task = kthread_create((int (*)(void *)) func, rqstp, serv->sv_name);
> +	if (IS_ERR(task))
> +		return PTR_ERR(task);
> +
> +	if (serv->sv_nrpools > 1)
> +		svc_pool_map_set_cpumask(task, rqstp->rq_pool->sp_id, NULL);
> +
> +	svc_sock_update_bufs(serv);
> +	wake_up_process(task);
> +	return 0;

I don't think we'll need this helper at all.  For the normal case of
not using a pool the caller can just call svc_sock_update_bufs even
before creating the thread, and the just use kthread_run.  That'll also
get rid of all this horrible casting things around for the thread entry
point function pointer.

--
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