Re: [patch] Workqueue Abstraction, 2.5.40-H7

Oleg Drokin
2002-10-02T08:17:18Z

Hello!

On Tue, Oct 01, 2002 at 06:24:50PM +0200, Ingo Molnar wrote:

> The pach converts roughly 80% of all tqueue-using code to workqueues - and
> all the places that are not converted to workqueues yet are places that do
> not compile in vanilla 2.5.40 anyway, due to unrelated changes. I've
> converted a fair number of drivers that do not compile in 2.5.40, and i
> think i've managed to convert every driver that compiles under 2.5.40.

Here are corresponding changes to UML code (that were not done by Ingo just
because this code cannot be compiled due to Makefile bug).

This patch is required to make UML compilable again in bk-current (after you
fix the Makefile, of course).
I tested the patch and UML works fine for me.

Bye,
Oleg

===== arch/um/drivers/chan_kern.c 1.2 vs edited =====
--- 1.2/arch/um/drivers/chan_kern.c Mon Sep 30 11:59:19 2002
+++ edited/arch/um/drivers/chan_kern.c Wed Oct 2 12:08:57 2002
@@ -395,7 +395,7 @@
return(-1);
}

-void chan_interrupt(struct list_head *chans, struct tq_struct *task,
+void chan_interrupt(struct list_head *chans, struct work_struct *task,
struct tty_struct *tty, int irq, void *dev)
{
struct list_head *ele, *next;
@@ -409,7 +409,7 @@
do {
if((tty != NULL) &&
(tty->flip.count >= TTY_FLIPBUF_SIZE)){
- schedule_task(task);
+ schedule_work(task);
goto out;
}
err = chan->ops->read(chan->fd, &c, chan->data);
===== arch/um/drivers/line.c 1.1 vs edited =====
--- 1.1/arch/um/drivers/line.c Fri Sep 6 21:29:28 2002
+++ edited/arch/um/drivers/line.c Wed Oct 2 12:02:14 2002
@@ -215,7 +215,7 @@
if(err) goto out;
}
enable_chan(&line->chan_list, line);
- INIT_TQUEUE(&line->task, line_timer_cb, line);
+ INIT_WORK(&line->task, line_timer_cb, line);
}

if(!line->sigio){
===== arch/um/drivers/mconsole_kern.c 1.1 vs edited =====
--- 1.1/arch/um/drivers/mconsole_kern.c Fri Sep 6 21:29:28 2002
+++ edited/arch/um/drivers/mconsole_kern.c Wed Oct 2 12:06:54 2002
@@ -13,7 +13,7 @@
#include "linux/ctype.h"
#include "linux/interrupt.h"
#include "linux/sysrq.h"
-#include "linux/tqueue.h"
+#include "linux/workqueue.h"
#include "linux/module.h"
#include "linux/proc_fs.h"
#include "asm/irq.h"
@@ -42,7 +42,7 @@

LIST_HEAD(mc_requests);

-void mc_task_proc(void *unused)
+void mc_work_proc(void *unused)
{
struct mconsole_entry *req;
unsigned long flags;
@@ -60,10 +60,7 @@
} while(!done);
}

-struct tq_struct mconsole_task = {
- routine: mc_task_proc,
- data: NULL
-};
+DECLARE_WORK(mconsole_work, mc_work_proc, NULL);

void mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
@@ -84,7 +81,7 @@
}
}
}
- if(!list_empty(&mc_requests)) schedule_task(&mconsole_task);
+ if(!list_empty(&mc_requests)) schedule_work(&mconsole_work);
reactivate_fd(fd, MCONSOLE_IRQ);
}

===== arch/um/include/chan_kern.h 1.1 vs edited =====
--- 1.1/arch/um/include/chan_kern.h Fri Sep 6 21:29:28 2002
+++ edited/arch/um/include/chan_kern.h Wed Oct 2 12:07:57 2002
@@ -22,7 +22,7 @@
void *data;
};

-extern void chan_interrupt(struct list_head *chans, struct tq_struct *task,
+extern void chan_interrupt(struct list_head *chans, struct work_struct *task,
struct tty_struct *tty, int irq, void *dev);
extern int parse_chan_pair(char *str, struct list_head *chans, int pri,
int device, struct chan_opts *opts);
===== arch/um/include/line.h 1.1 vs edited =====
--- 1.1/arch/um/include/line.h Fri Sep 6 21:29:28 2002
+++ edited/arch/um/include/line.h Wed Oct 2 12:01:27 2002
@@ -7,7 +7,7 @@
#define __LINE_H__

#include "linux/list.h"
-#include "linux/tqueue.h"
+#include "linux/workqueue.h"
#include "linux/tty.h"
#include "asm/semaphore.h"
#include "chan_user.h"
@@ -39,7 +39,7 @@
char *head;
char *tail;
int sigio;
- struct tq_struct task;
+ struct work_struct task;
struct line_driver *driver;
int have_irq;
};