return 0;
}
-static void kdbus_conn_work(struct work_struct *work)
-{
- struct kdbus_conn *conn =
- container_of(work, struct kdbus_conn, work.work);
-
- kdbus_reply_list_scan(conn);
-}
-
/**
* kdbus_cmd_msg_recv() - receive a message from the queue
* @conn: Connection to work on
atomic_set(&conn->name_count, 0);
atomic_set(&conn->request_count, 0);
atomic_set(&conn->lost_count, 0);
- INIT_DELAYED_WORK(&conn->work, kdbus_conn_work);
+ INIT_DELAYED_WORK(&conn->work, kdbus_reply_list_scan_work);
conn->cred = get_current_cred();
init_waitqueue_head(&conn->wait);
kdbus_queue_init(&conn->queue);
}
/**
- * kdbus_reply_list_scan() - Scan the replies of a connection
- * @conn: Connection to scan
+ * kdbus_reply_list_scan_work() - Worker callback to scan the replies of a
+ * connection for exceeded timeouts
+ * @work: Work struct of the connection to scan
*
* Walk the list of replies stored with a connection and look for entries
* that have exceeded their timeout. If such an entry is found, a timeout
* notification is sent to the waiting peer, and the reply is removed from
* the list.
+ *
+ * The work is rescheduled to the nearest timeout found during the list
+ * iteration.
*/
-void kdbus_reply_list_scan(struct kdbus_conn *conn)
+void kdbus_reply_list_scan_work(struct work_struct *work)
{
+ struct kdbus_conn *conn =
+ container_of(work, struct kdbus_conn, work.work);
struct kdbus_reply *reply, *reply_tmp;
u64 deadline = ~0ULL;
struct timespec64 ts;
u64 cookie);
void kdbus_sync_reply_wakeup(struct kdbus_reply *reply, int err);
-void kdbus_reply_list_scan(struct kdbus_conn *conn);
+void kdbus_reply_list_scan_work(struct work_struct *work);
#endif /* __KDBUS_REPLY_H */