--- a/drivers/message/i2o/i2o_proc.c 2004-04-04 05:37:25.000000000 +0200 +++ b/drivers/message/i2o/i2o_proc.c 2004-05-07 03:33:45.136253576 +0200 @@ -406,13 +406,15 @@ return len; } -int i2o_proc_read_lct(char *buf, char **start, off_t offset, int len, +int i2o_proc_read_lct(char *page, char **start, off_t off, int count, int *eof, void *data) { struct i2o_controller *c = (struct i2o_controller*)data; i2o_lct *lct = (i2o_lct *)c->lct; int entries; int i; + int len; + char *buf; #define BUS_TABLE_SIZE 3 static char *bus_ports[] = @@ -422,11 +424,13 @@ "Fibre Channel Bus" }; - spin_lock(&i2o_proc_lock); - len = 0; - entries = (lct->table_size - 3)/9; + buf = kmalloc(entries * 300 + 100, GFP_KERNEL); + if(!buf) + return -ENOMEM; + len = 0; + len += sprintf(buf, "LCT contains %d %s\n", entries, entries == 1 ? "entry" : "entries"); if(lct->boot_tid) @@ -538,7 +542,20 @@ lct->lct_entry[i].device_flags); } - spin_unlock(&i2o_proc_lock); + *start = page; + + if(off > len) { + *eof = 1; + len = 0; + } else { + len -= off; + if(len <= count) + *eof = 1; + else + len = count; + } + strncpy(page, buf + off, len); + kfree(buf); return len; }