/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/**********************************************************************/
/* flag threads to terminate, wake them and wait for them to die */
kqswnal_data.kqn_shuttingdown = 2;
- cfs_waitq_broadcast (&kqswnal_data.kqn_sched_waitq);
+ wake_up_all (&kqswnal_data.kqn_sched_waitq);
while (cfs_atomic_read (&kqswnal_data.kqn_nthreads) != 0) {
CDEBUG(D_NET, "waiting for %d threads to terminate\n",
CDEBUG (D_MALLOC, "done kmem %d\n", cfs_atomic_read(&libcfs_kmemory));
- PORTAL_MODULE_UNUSE;
+ module_put(THIS_MODULE);
}
int
CFS_INIT_LIST_HEAD (&kqswnal_data.kqn_readyrxds);
spin_lock_init(&kqswnal_data.kqn_sched_lock);
- cfs_waitq_init (&kqswnal_data.kqn_sched_waitq);
+ init_waitqueue_head (&kqswnal_data.kqn_sched_waitq);
/* pointers/lists/locks initialised */
kqswnal_data.kqn_init = KQN_INIT_DATA;
- PORTAL_MODULE_USE;
+ try_module_get(THIS_MODULE);
kqswnal_data.kqn_ep = ep_system();
if (kqswnal_data.kqn_ep == NULL) {
/**********************************************************************/
/* Spawn scheduling threads */
- for (i = 0; i < cfs_num_online_cpus(); i++) {
- rc = kqswnal_thread_start (kqswnal_scheduler, NULL);
+ for (i = 0; i < num_online_cpus(); i++) {
+ rc = kqswnal_thread_start(kqswnal_scheduler, NULL,
+ "kqswnal_sched");
if (rc != 0)
{
CERROR ("failed to spawn scheduling thread: %d\n", rc);