struct mutex cfs_trace_thread_mutex;
static int thread_running = 0;
-cfs_atomic_t cfs_tage_allocated = CFS_ATOMIC_INIT(0);
+atomic_t cfs_tage_allocated = ATOMIC_INIT(0);
static void put_pages_on_tcd_daemon_list(struct page_collection *pc,
struct cfs_trace_cpu_data *tcd);
}
tage->page = page;
- cfs_atomic_inc(&cfs_tage_allocated);
+ atomic_inc(&cfs_tage_allocated);
return tage;
}
__free_page(tage->page);
kfree(tage);
- cfs_atomic_dec(&cfs_tage_allocated);
+ atomic_dec(&cfs_tage_allocated);
}
static void cfs_tage_to_tail(struct cfs_trace_page *tage,
"%d\n", ++i, tage->cpu);
printk(KERN_ERR "There are %d pages unwritten\n",
i);
- }
- __LASSERT(cfs_list_empty(&pc.pc_pages));
+ }
+ __LASSERT(cfs_list_empty(&pc.pc_pages));
end_loop:
- if (cfs_atomic_read(&tctl->tctl_shutdown)) {
- if (last_loop == 0) {
- last_loop = 1;
- continue;
- } else {
- break;
- }
- }
+ if (atomic_read(&tctl->tctl_shutdown)) {
+ if (last_loop == 0) {
+ last_loop = 1;
+ continue;
+ } else {
+ break;
+ }
+ }
init_waitqueue_entry_current(&__wait);
add_wait_queue(&tctl->tctl_waitq, &__wait);
set_current_state(TASK_INTERRUPTIBLE);
init_completion(&tctl->tctl_start);
init_completion(&tctl->tctl_stop);
init_waitqueue_head(&tctl->tctl_waitq);
- cfs_atomic_set(&tctl->tctl_shutdown, 0);
+ atomic_set(&tctl->tctl_shutdown, 0);
if (IS_ERR(kthread_run(tracefiled, tctl, "ktracefiled"))) {
rc = -ECHILD;
if (thread_running) {
printk(KERN_INFO
"Lustre: shutting down debug daemon thread...\n");
- cfs_atomic_set(&tctl->tctl_shutdown, 1);
+ atomic_set(&tctl->tctl_shutdown, 1);
wait_for_completion(&tctl->tctl_stop);
thread_running = 0;
}