-/* kafstimod.c: AFS timeout daemon
+/* AFS timeout daemon
*
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
static int kafstimod(void *arg);
-/*****************************************************************************/
/*
* start the timeout daemon
*/
wait_for_completion(&kafstimod_alive);
return ret;
-} /* end afs_kafstimod_start() */
+}
-/*****************************************************************************/
/*
* stop the timeout daemon
*/
kafstimod_die = 1;
wake_up(&kafstimod_sleepq);
wait_for_completion(&kafstimod_dead);
+}
-} /* end afs_kafstimod_stop() */
-
-/*****************************************************************************/
/*
* timeout processing daemon
*/
complete(&kafstimod_alive);
/* loop around looking for things to attend to */
- loop:
+loop:
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&kafstimod_sleepq, &myself);
spin_lock(&kafstimod_lock);
if (list_empty(&kafstimod_list)) {
timeout = MAX_SCHEDULE_TIMEOUT;
- }
- else {
+ } else {
timer = list_entry(kafstimod_list.next,
struct afs_timer, link);
timeout = timer->timo_jif;
if (time_before_eq((unsigned long) timeout, jif))
goto immediate;
-
- else {
- timeout = (long) timeout - (long) jiffies;
- }
+ timeout = (long) timeout - (long) jiffies;
}
spin_unlock(&kafstimod_lock);
* - we come here with the lock held and timer pointing to the expired
* entry
*/
- immediate:
+immediate:
remove_wait_queue(&kafstimod_sleepq, &myself);
set_current_state(TASK_RUNNING);
_debug("@@@ End Timeout");
goto loop;
+}
-} /* end kafstimod() */
-
-/*****************************************************************************/
/*
* (re-)queue a timer
*/
wake_up(&kafstimod_sleepq);
_leave("");
-} /* end afs_kafstimod_add_timer() */
+}
-/*****************************************************************************/
/*
* dequeue a timer
* - returns 0 if the timer was deleted or -ENOENT if it wasn't queued
_leave(" = %d", ret);
return ret;
-} /* end afs_kafstimod_del_timer() */
+}