@@ -515,7 +515,7 @@ static int do_timer_create(clockid_t which_clock, struct sigevent *event,
515515 spin_lock_irq (& current -> sighand -> siglock );
516516 /* This makes the timer valid in the hash table */
517517 WRITE_ONCE (new_timer -> it_signal , current -> signal );
518- list_add (& new_timer -> list , & current -> signal -> posix_timers );
518+ hlist_add_head (& new_timer -> list , & current -> signal -> posix_timers );
519519 spin_unlock_irq (& current -> sighand -> siglock );
520520 /*
521521 * After unlocking sighand::siglock @new_timer is subject to
@@ -1025,7 +1025,7 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id)
10251025 }
10261026
10271027 spin_lock (& current -> sighand -> siglock );
1028- list_del (& timer -> list );
1028+ hlist_del (& timer -> list );
10291029 spin_unlock (& current -> sighand -> siglock );
10301030 /*
10311031 * A concurrent lookup could check timer::it_signal lockless. It
@@ -1075,7 +1075,7 @@ static void itimer_delete(struct k_itimer *timer)
10751075
10761076 goto retry_delete ;
10771077 }
1078- list_del (& timer -> list );
1078+ hlist_del (& timer -> list );
10791079
10801080 /*
10811081 * Setting timer::it_signal to NULL is technically not required
@@ -1096,22 +1096,19 @@ static void itimer_delete(struct k_itimer *timer)
10961096 */
10971097void exit_itimers (struct task_struct * tsk )
10981098{
1099- struct list_head timers ;
1100- struct k_itimer * tmr ;
1099+ struct hlist_head timers ;
11011100
1102- if (list_empty (& tsk -> signal -> posix_timers ))
1101+ if (hlist_empty (& tsk -> signal -> posix_timers ))
11031102 return ;
11041103
11051104 /* Protect against concurrent read via /proc/$PID/timers */
11061105 spin_lock_irq (& tsk -> sighand -> siglock );
1107- list_replace_init (& tsk -> signal -> posix_timers , & timers );
1106+ hlist_move_list (& tsk -> signal -> posix_timers , & timers );
11081107 spin_unlock_irq (& tsk -> sighand -> siglock );
11091108
11101109 /* The timers are not longer accessible via tsk::signal */
1111- while (!list_empty (& timers )) {
1112- tmr = list_first_entry (& timers , struct k_itimer , list );
1113- itimer_delete (tmr );
1114- }
1110+ while (!hlist_empty (& timers ))
1111+ itimer_delete (hlist_entry (timers .first , struct k_itimer , list ));
11151112}
11161113
11171114SYSCALL_DEFINE2 (clock_settime , const clockid_t , which_clock ,
0 commit comments