]> git.neil.brown.name Git - history.git/commitdiff
Import 2.1.39 2.1.39
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:13:17 +0000 (15:13 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:13:17 +0000 (15:13 -0500)
16 files changed:
CREDITS
Makefile
arch/i386/kernel/irq.h
drivers/char/tty_io.c
drivers/scsi/eata.c
drivers/scsi/eata.h
drivers/scsi/u14-34f.c
drivers/scsi/u14-34f.h
fs/binfmt_elf.c
fs/buffer.c
fs/isofs/dir.c
fs/isofs/namei.c
fs/isofs/rock.c
include/linux/sched.h
include/linux/sunrpc/clnt.h
mm/memory.c

diff --git a/CREDITS b/CREDITS
index e7247ec74c3f9fbb357117d5d59cb8d871c5ce1b..76fed44b118be2038ce39e23e66372bef384d41c 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -733,8 +733,8 @@ S: USA
 N: Alain L. Knaff
 E: Alain.Knaff@poboxes.com
 D: floppy driver
-S: 2a, rue de l'Acier
-S: L-4505 Differdange
+S: 19, rue Jean l'Aveugle
+S: L-1148 Luxembourg-City
 S: Luxembourg
 
 N: Gerd Knorr
index 1ed185bbb1400b7d64a12194cb25b88a099579ff..0f9af1f0f7d29ec2a6ef49b8792c2a24dd34b9b6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 38
+SUBLEVEL = 39
 
 ARCH := $(shell uname -m | sed s/i.86/i386/)
 
index 628d87068f6d73985736d322bbec73033807c4b0..1f9e893999f65ef2948744ec30fb4cfad5b042cc 100644 (file)
@@ -62,32 +62,8 @@ static inline void irq_exit(int cpu, int irq)
        "mov %dx,%ds\n\t" \
        "mov %dx,%es\n\t"
 
-/*
- * These are used just for the "bad" interrupt handlers, 
- * which just clear the mask and return..
- */
-#define SAVE_MOST \
-       "cld\n\t" \
-       "push %es\n\t" \
-       "push %ds\n\t" \
-       "pushl %eax\n\t" \
-       "pushl %edx\n\t" \
-       "pushl %ecx\n\t" \
-       "movl $" STR(KERNEL_DS) ",%edx\n\t" \
-       "mov %dx,%ds\n\t" \
-       "mov %dx,%es\n\t"
-
-#define RESTORE_MOST \
-       "popl %ecx\n\t" \
-       "popl %edx\n\t" \
-       "popl %eax\n\t" \
-       "pop %ds\n\t" \
-       "pop %es\n\t" \
-       "iret"
-
 #define IRQ_NAME2(nr) nr##_interrupt(void)
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
-#define BAD_IRQ_NAME(nr) IRQ_NAME2(bad_IRQ##nr)
 
 #define GET_CURRENT \
        "movl %esp, %ebx\n\t" \
@@ -150,15 +126,14 @@ static inline void x86_do_profile (unsigned long eip)
                extern int _stext;
                eip -= (unsigned long) &_stext;
                eip >>= prof_shift;
-               if (eip < prof_len)
-                       atomic_inc((atomic_t *)&prof_buffer[eip]);
-               else
                /*
                 * Dont ignore out-of-bounds EIP values silently,
                 * put them into the last histogram slot, so if
                 * present, they will show up as a sharp peak.
                 */
-                       atomic_inc((atomic_t *)&prof_buffer[prof_len-1]);
+               if (eip > prof_len-1)
+                       eip = prof_len-1;
+               atomic_inc((atomic_t *)&prof_buffer[eip]);
        }
 }
 
index adac2831a9b0c6dfb6a3cc78c4016e83ed2972c5..12109e524981ce81a4aa6dcb3fa6302d08d4ea8c 100644 (file)
@@ -838,7 +838,7 @@ static void release_dev(struct file * filp)
 {
        struct tty_struct *tty, *o_tty;
        struct termios *tp, *o_tp, *ltp, *o_ltp;
-       struct task_struct **p;
+       struct task_struct *p;
        int     idx;
        
        tty = (struct tty_struct *)filp->private_data;
@@ -972,14 +972,14 @@ static void release_dev(struct file * filp)
         * Make sure there aren't any processes that still think this
         * tty is their controlling tty.
         */
-       for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) {
-               if (*p == 0)
-                       continue;
-               if ((*p)->tty == tty)
-                       (*p)->tty = NULL;
-               if (o_tty && (*p)->tty == o_tty)
-                       (*p)->tty = NULL;
+       read_lock(&tasklist_lock);
+       for_each_task(p) {
+               if (p->tty == tty)
+                       p->tty = NULL;
+               if (o_tty && p->tty == o_tty)
+                       p->tty = NULL;
        }
+       read_unlock(&tasklist_lock);
 
        /*
         * Shutdown the current line discipline, and reset it to
@@ -1216,40 +1216,6 @@ static int tty_fasync(struct inode * inode, struct file * filp, int on)
        return 0;
 }
 
-#if 0
-/*
- * XXX does anyone use this anymore?!?
- */
-static int do_get_ps_info(unsigned long arg)
-{
-       struct tstruct {
-               int flag;
-               int present[NR_TASKS];
-               struct task_struct tasks[NR_TASKS];
-       };
-       struct tstruct *ts = (struct tstruct *)arg;
-       struct task_struct **p;
-       char *c, *d;
-       int i, n = 0;
-       
-       i = verify_area(VERIFY_WRITE, (void *)arg, sizeof(struct tstruct));
-       if (i)
-               return i;
-       for (p = &FIRST_TASK ; p <= &LAST_TASK ; p++, n++)
-               if (*p)
-               {
-                       c = (char *)(*p);
-                       d = (char *)(ts->tasks+n);
-                       for (i=0 ; i<sizeof(struct task_struct) ; i++)
-                               put_user(*c++, d++);
-                       put_user(1, ts->present+n);
-               }
-               else    
-                       put_user(0, ts->present+n);
-       return(0);                      
-}
-#endif
-
 static int tiocsti(struct tty_struct *tty, char * arg)
 {
        char ch, mbz = 0;
@@ -1495,7 +1461,7 @@ void do_SAK( struct tty_struct *tty)
 #ifdef TTY_SOFT_SAK
        tty_hangup(tty);
 #else
-       struct task_struct **p;
+       struct task_struct *p;
        int session;
        int             i;
        struct file     *filp;
@@ -1507,23 +1473,23 @@ void do_SAK( struct tty_struct *tty)
                tty->ldisc.flush_buffer(tty);
        if (tty->driver.flush_buffer)
                tty->driver.flush_buffer(tty);
-       for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) {
-               if (!(*p))
-                       continue;
-               if (((*p)->tty == tty) ||
-                   ((session > 0) && ((*p)->session == session)))
-                       send_sig(SIGKILL, *p, 1);
-               else if ((*p)->files) {
+       read_lock(&tasklist_lock);
+       for_each_task(p) {
+               if ((p->tty == tty) ||
+                   ((session > 0) && (p->session == session)))
+                       send_sig(SIGKILL, p, 1);
+               else if (p->files) {
                        for (i=0; i < NR_OPEN; i++) {
-                               filp = (*p)->files->fd[i];
+                               filp = p->files->fd[i];
                                if (filp && (filp->f_op == &tty_fops) &&
                                    (filp->private_data == tty)) {
-                                       send_sig(SIGKILL, *p, 1);
+                                       send_sig(SIGKILL, p, 1);
                                        break;
                                }
                        }
                }
        }
+       read_unlock(&tasklist_lock);
 #endif
 }
 
index fb82d349af7bd09466255bc22cc0bc42bd8c9cf2..cfff8bfa3cf936fdddcba076ee7649a6779e8606 100644 (file)
@@ -1,6 +1,13 @@
 /*
  *      eata.c - Low-level driver for EATA/DMA SCSI host adapters.
  *
+ *      17 May 1997 rev. 3.10 for linux 2.0.30 and 2.1.38
+ *          Use of serial_number_at_timeout in abort and reset processing.
+ *          Use of the __initfunc and __initdata macro in setup code.
+ *          Minor cleanups in the list_statistics code.
+ *          Increased controller busy timeout in order to better support 
+ *          slow SCSI devices.
+ *
  *      24 Feb 1997 rev. 3.00 for linux 2.0.29 and 2.1.26
  *          When loading as a module, parameter passing is now supported
  *          both in 2.0 and in 2.1 style.
  *  lc:n  disables linked commands;
  *  tc:y  enables tagged commands;
  *  tc:n  disables tagged commands;
- *  tm:0  use head/simple/ordered queue tag sequences for reads and ordered
- *        queue tags for writes;
+ *  tm:0  use head/simple/ordered queue tag sequences;
  *  tm:1  use only simple queue tags;
  *  tm:2  use only head of queue tags;
  *  tm:3  use only ordered queue tags;
  *  between increasing or decreasing by minimizing the seek distance between
  *  the sector of the commands just completed and the sector of the first 
  *  command in the list to be sorted. 
- *  Trivial math assures that if there are (Q-1) outstanding request for
- *  random seeks over S sectors, the unsorted average seek distance is S/2,
- *  while the sorted average seek distance is S/(Q-1). The seek distance is
- *  hence divided by a factor (Q-1)/2.
+ *  Trivial math assures that the unsorted average seek distance when doing
+ *  random seeks over S sectors is S/3.
+ *  When (Q-1) requests are uniformly distributed over S sectors, the average
+ *  distance between two adjacent requests is S/((Q-1) + 1), so the sorted
+ *  average seek distance for (Q-1) random requests over S sectors is S/Q.
+ *  The elevator sorting hence divides the seek distance by a factor Q/3.
  *  The above pure geometric remarks are valid in all cases and the 
  *  driver effectively reduces the seek distance by the predicted factor
  *  when there are Q concurrent read i/o operations on the device, but this
@@ -286,10 +294,18 @@ MODULE_AUTHOR("Dario Ballabio");
 #include <asm/dma.h>
 #include <asm/irq.h>
 #include "eata.h"
-#include<linux/stat.h>
-#include<linux/config.h>
-#include<linux/bios32.h>
-#include<linux/pci.h>
+#include <linux/stat.h>
+#include <linux/config.h>
+#include <linux/bios32.h>
+#include <linux/pci.h>
+
+#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,36)
+#include <linux/init.h>
+#else
+#define __initfunc(A) A
+#define __initdata
+#define __init
+#endif
 
 struct proc_dir_entry proc_scsi_eata2x = {
     PROC_SCSI_EATA2X, 6, "eata2x",
@@ -517,7 +533,7 @@ static struct Scsi_Host *sh[MAX_BOARDS + 1];
 static const char *driver_name = "EATA";
 static unsigned int irqlist[MAX_IRQ], calls[MAX_IRQ];
 
-static unsigned int io_port[] = { 
+static unsigned int io_port[] __initdata = { 
 
    /* Space for MAX_INT_PARAM ports usable while loading as a module */
    SKIP,    SKIP,   SKIP,   SKIP,   SKIP,   SKIP,   SKIP,   SKIP,
@@ -638,8 +654,7 @@ static void select_queue_depths(struct Scsi_Host *host, Scsi_Device *devlist) {
    return;
 }
 
-static inline int wait_on_busy(unsigned int iobase) {
-   unsigned int loop = MAXLOOP;
+static inline int wait_on_busy(unsigned int iobase, unsigned int loop) {
 
    while (inb(iobase + REG_AUX_STATUS) & ABSY_ASSERTED)
       if (--loop == 0) return TRUE;
@@ -649,7 +664,7 @@ static inline int wait_on_busy(unsigned int iobase) {
 
 static inline int do_dma(unsigned int iobase, unsigned int addr, unchar cmd) {
 
-   if (wait_on_busy(iobase)) return TRUE;
+   if (wait_on_busy(iobase, (addr ? MAXLOOP * 100 : MAXLOOP))) return TRUE;
 
    if ((addr = V2DEV(addr))) {
       outb((char) (addr >> 24), iobase + REG_LOW);
@@ -678,8 +693,8 @@ static inline int read_pio(unsigned int iobase, ushort *start, ushort *end) {
    return FALSE;
 }
 
-static inline int port_detect(unsigned int port_base, unsigned int j, 
-                             Scsi_Host_Template *tpnt) {
+__initfunc (static inline int port_detect \
+      (unsigned int port_base, unsigned int j, Scsi_Host_Template *tpnt)) {
    unsigned char irq, dma_channel, subversion, i;
    unsigned char protocol_rev;
    struct eata_info info;
@@ -882,7 +897,7 @@ static inline int port_detect(unsigned int port_base, unsigned int j,
          sh[j]->max_lun = info.max_lun + 1;
       }
 
-   if (dma_channel == NO_DMA) sprintf(dma_name, "%s", "NO DMA");
+   if (dma_channel == NO_DMA) sprintf(dma_name, "%s", "BMST");
    else                       sprintf(dma_name, "DMA %u", dma_channel);
 
    for (i = 0; i < sh[j]->can_queue; i++)
@@ -941,7 +956,7 @@ static inline int port_detect(unsigned int port_base, unsigned int j,
    return TRUE;
 }
 
-void eata2x_setup(char *str, int *ints) {
+__initfunc (void eata2x_setup(char *str, int *ints)) {
    int i, argc = ints[0];
    char *cur = str, *pc;
 
@@ -974,7 +989,7 @@ void eata2x_setup(char *str, int *ints) {
    return;
 }
 
-static void add_pci_ports(void) {
+__initfunc (static void add_pci_ports(void)) {
 
 #if defined(CONFIG_PCI)
 
@@ -1009,7 +1024,7 @@ static void add_pci_ports(void) {
    return;
 }
 
-int eata2x_detect(Scsi_Host_Template *tpnt) {
+__initfunc (int eata2x_detect(Scsi_Host_Template *tpnt)) {
    unsigned long flags;
    unsigned int j = 0, k;
 
@@ -1166,6 +1181,9 @@ int eata2x_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
 
    cpp->reqsen = TRUE;
    cpp->dispri = TRUE;
+#if 0
+   if (SCpnt->device->type == TYPE_TAPE) cpp->hbaci = TRUE;
+#endif
    cpp->one = TRUE;
    cpp->channel = SCpnt->channel;
    cpp->target = SCpnt->target;
@@ -1182,14 +1200,12 @@ int eata2x_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
       else if (tag_mode == TAG_SIMPLE)  cpp->mess[0] = SIMPLE_QUEUE_TAG;
       else if (tag_mode == TAG_HEAD)    cpp->mess[0] = HEAD_OF_QUEUE_TAG;
       else if (tag_mode == TAG_ORDERED) cpp->mess[0] = ORDERED_QUEUE_TAG;
-      else if ((SCpnt->device->current_tag % SCpnt->device->queue_depth) == 0)
+      else if (SCpnt->device->current_tag == 0)
          cpp->mess[0] = ORDERED_QUEUE_TAG;
-      else if ((SCpnt->device->current_tag % SCpnt->device->queue_depth) == 1)
+      else if (SCpnt->device->current_tag == 1)
          cpp->mess[0] = HEAD_OF_QUEUE_TAG;
-      else if (cpp->din)
-         cpp->mess[0] = SIMPLE_QUEUE_TAG;
       else
-         cpp->mess[0] = ORDERED_QUEUE_TAG;
+         cpp->mess[0] = SIMPLE_QUEUE_TAG;
 
       cpp->mess[1] = SCpnt->device->current_tag++;
       }
@@ -1208,7 +1224,7 @@ int eata2x_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
    if (linked_comm && SCpnt->device->queue_depth > 2
                                      && TLDEV(SCpnt->device->type)) {
       HD(j)->cp_stat[i] = READY;
-      flush_dev(SCpnt->device, 0, j, FALSE);
+      flush_dev(SCpnt->device, SCpnt->request.sector, j, FALSE);
       restore_flags(flags);
       return 0;
       }
@@ -1238,7 +1254,8 @@ int eata2x_abort(Scsi_Cmnd *SCarg) {
    cli();
    j = ((struct hostdata *) SCarg->host->hostdata)->board_number;
 
-   if (SCarg->host_scribble == NULL) {
+   if (SCarg->host_scribble == NULL
+       || SCarg->serial_number != SCarg->serial_number_at_timeout) {
       printk("%s: abort, target %d.%d:%d, pid %ld inactive.\n",
             BN(j), SCarg->channel, SCarg->target, SCarg->lun, SCarg->pid);
       restore_flags(flags);
@@ -1252,7 +1269,7 @@ int eata2x_abort(Scsi_Cmnd *SCarg) {
    if (i >= sh[j]->can_queue)
       panic("%s: abort, invalid SCarg->host_scribble.\n", BN(j));
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: abort, timeout error.\n", BN(j));
       restore_flags(flags);
       return SCSI_ABORT_ERROR;
@@ -1321,13 +1338,19 @@ int eata2x_reset(Scsi_Cmnd *SCarg, unsigned int reset_flags) {
    if (SCarg->host_scribble == NULL)
       printk("%s: reset, pid %ld inactive.\n", BN(j), SCarg->pid);
 
+   if (SCarg->serial_number != SCarg->serial_number_at_timeout) {
+      printk("%s: reset, pid %ld, reset not running.\n", BN(j), SCarg->pid);
+      restore_flags(flags);
+      return SCSI_RESET_NOT_RUNNING;
+      }
+
    if (HD(j)->in_reset) {
       printk("%s: reset, exit, already in reset.\n", BN(j));
       restore_flags(flags);
       return SCSI_RESET_ERROR;
       }
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: reset, exit, timeout error.\n", BN(j));
       restore_flags(flags);
       return SCSI_RESET_ERROR;
@@ -1480,7 +1503,7 @@ static inline void reorder(unsigned int j, unsigned long cursec,
    unsigned int rev = FALSE, s = TRUE, r = TRUE;
    unsigned int input_only = TRUE, overlap = FALSE;
    unsigned long sl[n_ready], pl[n_ready], ll[n_ready];
-   unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0;
+   unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0, iseek = 0;
 
    static unsigned int flushcount = 0, batchcount = 0, sortcount = 0;
    static unsigned int readycount = 0, ovlcount = 0, inputcount = 0;
@@ -1491,8 +1514,8 @@ static inline void reorder(unsigned int j, unsigned long cursec,
       printk("fc %d bc %d ic %d oc %d rc %d rs %d sc %d re %d"\
              " av %ldK as %ldK.\n", flushcount, batchcount, inputcount,
              ovlcount, readycount, readysorted, sortcount, revcount,
-             seeknosort / (readycount - batchcount + 1), 
-             seeksorted / (readycount - batchcount + 1));
+             seeknosort / (readycount + 1), 
+             seeksorted / (readycount + 1));
 
    if (n_ready <= 1) return;
 
@@ -1520,6 +1543,10 @@ static inline void reorder(unsigned int j, unsigned long cursec,
 
       }
 
+   if (link_statistics) {
+      if (cursec > sl[0]) seek += cursec - sl[0]; else seek += sl[0] - cursec;
+      }
+
    if (cursec > ((maxsec + minsec) / 2)) rev = TRUE;
 
    if (!((rev && r) || (!rev && s))) sort(sl, il, n_ready, rev);
@@ -1537,10 +1564,11 @@ static inline void reorder(unsigned int j, unsigned long cursec,
    if (overlap) sort(pl, il, n_ready, FALSE);
 
    if (link_statistics) {
+      if (cursec > sl[0]) iseek = cursec - sl[0]; else iseek = sl[0] - cursec;
       batchcount++; readycount += n_ready, seeknosort += seek / 1024; 
       if (input_only) inputcount++;
       if (overlap) { ovlcount++; seeksorted += seek / 1024; }
-      else seeksorted += (maxsec - minsec) / 1024;
+      else seeksorted += (iseek + maxsec - minsec) / 1024;
       if (rev && !r)     {  revcount++; readysorted += n_ready; }
       if (!rev && !s)    { sortcount++; readysorted += n_ready; }
       }
index 82791396abdadd5099f0499af3ce8d11e8a2332a..cba3914145590a73baed192419f19583cce427dc 100644 (file)
@@ -12,7 +12,7 @@ int eata2x_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
 int eata2x_abort(Scsi_Cmnd *);
 int eata2x_reset(Scsi_Cmnd *, unsigned int);
 
-#define EATA_VERSION "3.00.09"
+#define EATA_VERSION "3.10.00"
 
 
 #define EATA {                                                 \
index d89a90a7b533ac1c6e2474f7e682afb62c8281ec..6a0076ddeb93a9d204ffd72b57719e9892015f7e 100644 (file)
@@ -1,6 +1,11 @@
 /*
  *      u14-34f.c - Low-level driver for UltraStor 14F/34F SCSI host adapters.
  *
+ *      17 May 1997 rev. 3.10 for linux 2.0.30 and 2.1.38
+ *          Use of serial_number_at_timeout in abort and reset processing.
+ *          Use of the __initfunc and __initdata macro in setup code.
+ *          Minor cleanups in the list_statistics code.
+ *
  *      24 Feb 1997 rev. 3.00 for linux 2.0.29 and 2.1.26
  *          When loading as a module, parameter passing is now supported
  *          both in 2.0 and in 2.1 style.
  *  between increasing or decreasing by minimizing the seek distance between
  *  the sector of the commands just completed and the sector of the first 
  *  command in the list to be sorted. 
- *  Trivial math assures that if there are (Q-1) outstanding request for
- *  random seeks over S sectors, the unsorted average seek distance is S/2,
- *  while the sorted average seek distance is S/(Q-1). The seek distance is
- *  hence divided by a factor (Q-1)/2.
+ *  Trivial math assures that the unsorted average seek distance when doing
+ *  random seeks over S sectors is S/3.
+ *  When (Q-1) requests are uniformly distributed over S sectors, the average
+ *  distance between two adjacent requests is S/((Q-1) + 1), so the sorted
+ *  average seek distance for (Q-1) random requests over S sectors is S/Q.
+ *  The elevator sorting hence divides the seek distance by a factor Q/3.
  *  The above pure geometric remarks are valid in all cases and the 
  *  driver effectively reduces the seek distance by the predicted factor
  *  when there are Q concurrent read i/o operations on the device, but this
@@ -273,8 +280,16 @@ MODULE_AUTHOR("Dario Ballabio");
 #include <asm/dma.h>
 #include <asm/irq.h>
 #include "u14-34f.h"
-#include<linux/stat.h>
-#include<linux/config.h>
+#include <linux/stat.h>
+#include <linux/config.h>
+
+#if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,36)
+#include <linux/init.h>
+#else
+#define __initfunc(A) A
+#define __initdata
+#define __init
+#endif
 
 struct proc_dir_entry proc_scsi_u14_34f = {
     PROC_SCSI_U14_34F, 6, "u14_34f",
@@ -419,7 +434,7 @@ static struct Scsi_Host *sh[MAX_BOARDS + 1];
 static const char *driver_name = "Ux4F";
 static unsigned int irqlist[MAX_IRQ], calls[MAX_IRQ];
 
-static unsigned int io_port[] = { 
+static unsigned int io_port[] __initdata = { 
 
    /* Space for MAX_INT_PARAM ports usable while loading as a module */
    SKIP,    SKIP,   SKIP,   SKIP,   SKIP,   SKIP,   SKIP,   SKIP,
@@ -534,8 +549,7 @@ static void select_queue_depths(struct Scsi_Host *host, Scsi_Device *devlist) {
    return;
 }
 
-static inline int wait_on_busy(unsigned int iobase) {
-   unsigned int loop = MAXLOOP;
+static inline int wait_on_busy(unsigned int iobase, unsigned int loop) {
 
    while (inb(iobase + REG_LCL_INTR) & BSY_ASSERTED)
       if (--loop == 0) return TRUE;
@@ -556,7 +570,7 @@ static int board_inquiry(unsigned int j) {
    cpp->scsi_cdbs_len = 6;
    cpp->scsi_cdbs[0] = HA_CMD_INQUIRY;
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: board_inquiry, adapter busy.\n", BN(j));
       return TRUE;
       }
@@ -586,8 +600,8 @@ static int board_inquiry(unsigned int j) {
    return FALSE;
 }
 
-static inline int port_detect(unsigned int port_base, unsigned int j, 
-                              Scsi_Host_Template *tpnt) {
+__initfunc (static inline int port_detect \
+      (unsigned int port_base, unsigned int j, Scsi_Host_Template *tpnt)) {
    unsigned char irq, dma_channel, subversion, i;
    unsigned char in_byte;
    char *bus_type, dma_name[16];
@@ -748,7 +762,7 @@ static inline int port_detect(unsigned int port_base, unsigned int j,
         }
       }
 
-   if (dma_channel == NO_DMA) sprintf(dma_name, "%s", "NO DMA");
+   if (dma_channel == NO_DMA) sprintf(dma_name, "%s", "BMST");
    else                       sprintf(dma_name, "DMA %u", dma_channel);
 
    for (i = 0; i < sh[j]->can_queue; i++)
@@ -781,7 +795,7 @@ static inline int port_detect(unsigned int port_base, unsigned int j,
    return TRUE;
 }
 
-void u14_34f_setup(char *str, int *ints) {
+__initfunc (void u14_34f_setup(char *str, int *ints)) {
    int i, argc = ints[0];
    char *cur = str, *pc;
 
@@ -813,7 +827,7 @@ void u14_34f_setup(char *str, int *ints) {
    return;
 }
 
-int u14_34f_detect(Scsi_Host_Template *tpnt) {
+__initfunc (int u14_34f_detect(Scsi_Host_Template *tpnt)) {
    unsigned long flags;
    unsigned int j = 0, k;
 
@@ -983,12 +997,12 @@ int u14_34f_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
    if (linked_comm && SCpnt->device->queue_depth > 2
                                      && TLDEV(SCpnt->device->type)) {
       HD(j)->cp_stat[i] = READY;
-      flush_dev(SCpnt->device, 0, j, FALSE);
+      flush_dev(SCpnt->device, SCpnt->request.sector, j, FALSE);
       restore_flags(flags);
       return 0;
       }
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       SCpnt->result = DID_ERROR << 16;
       SCpnt->host_scribble = NULL;
       printk("%s: qcomm, target %d.%d:%d, pid %ld, adapter busy, DID_ERROR,"\
@@ -1018,7 +1032,8 @@ int u14_34f_abort(Scsi_Cmnd *SCarg) {
    cli();
    j = ((struct hostdata *) SCarg->host->hostdata)->board_number;
 
-   if (SCarg->host_scribble == NULL) {
+   if (SCarg->host_scribble == NULL
+       || SCarg->serial_number != SCarg->serial_number_at_timeout) {
       printk("%s: abort, target %d.%d:%d, pid %ld inactive.\n",
             BN(j), SCarg->channel, SCarg->target, SCarg->lun, SCarg->pid);
       restore_flags(flags);
@@ -1032,7 +1047,7 @@ int u14_34f_abort(Scsi_Cmnd *SCarg) {
    if (i >= sh[j]->can_queue)
       panic("%s: abort, invalid SCarg->host_scribble.\n", BN(j));
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: abort, timeout error.\n", BN(j));
       restore_flags(flags);
       return SCSI_ABORT_ERROR;
@@ -1101,13 +1116,19 @@ int u14_34f_reset(Scsi_Cmnd *SCarg, unsigned int reset_flags) {
    if (SCarg->host_scribble == NULL)
       printk("%s: reset, pid %ld inactive.\n", BN(j), SCarg->pid);
 
+   if (SCarg->serial_number != SCarg->serial_number_at_timeout) {
+      printk("%s: reset, pid %ld, reset not running.\n", BN(j), SCarg->pid);
+      restore_flags(flags);
+      return SCSI_RESET_NOT_RUNNING;
+      }
+
    if (HD(j)->in_reset) {
       printk("%s: reset, exit, already in reset.\n", BN(j));
       restore_flags(flags);
       return SCSI_RESET_ERROR;
       }
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: reset, exit, timeout error.\n", BN(j));
       restore_flags(flags);
       return SCSI_RESET_ERROR;
@@ -1158,7 +1179,7 @@ int u14_34f_reset(Scsi_Cmnd *SCarg, unsigned int reset_flags) {
       if (SCpnt == SCarg) arg_done = TRUE;
       }
 
-   if (wait_on_busy(sh[j]->io_port)) {
+   if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
       printk("%s: reset, cannot reset, timeout error.\n", BN(j));
       restore_flags(flags);
       return SCSI_RESET_ERROR;
@@ -1271,7 +1292,7 @@ static inline void reorder(unsigned int j, unsigned long cursec,
    unsigned int rev = FALSE, s = TRUE, r = TRUE;
    unsigned int input_only = TRUE, overlap = FALSE;
    unsigned long sl[n_ready], pl[n_ready], ll[n_ready];
-   unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0;
+   unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0, iseek = 0;
 
    static unsigned int flushcount = 0, batchcount = 0, sortcount = 0;
    static unsigned int readycount = 0, ovlcount = 0, inputcount = 0;
@@ -1282,8 +1303,8 @@ static inline void reorder(unsigned int j, unsigned long cursec,
       printk("fc %d bc %d ic %d oc %d rc %d rs %d sc %d re %d"\
              " av %ldK as %ldK.\n", flushcount, batchcount, inputcount,
              ovlcount, readycount, readysorted, sortcount, revcount,
-             seeknosort / (readycount - batchcount + 1), 
-             seeksorted / (readycount - batchcount + 1));
+             seeknosort / (readycount + 1), 
+             seeksorted / (readycount + 1));
 
    if (n_ready <= 1) return;
 
@@ -1311,6 +1332,10 @@ static inline void reorder(unsigned int j, unsigned long cursec,
 
       }
 
+   if (link_statistics) {
+      if (cursec > sl[0]) seek += cursec - sl[0]; else seek += sl[0] - cursec;
+      }
+
    if (cursec > ((maxsec + minsec) / 2)) rev = TRUE;
 
    if (!((rev && r) || (!rev && s))) sort(sl, il, n_ready, rev);
@@ -1328,10 +1353,11 @@ static inline void reorder(unsigned int j, unsigned long cursec,
    if (overlap) sort(pl, il, n_ready, FALSE);
 
    if (link_statistics) {
+      if (cursec > sl[0]) iseek = cursec - sl[0]; else iseek = sl[0] - cursec;
       batchcount++; readycount += n_ready, seeknosort += seek / 1024; 
       if (input_only) inputcount++;
       if (overlap) { ovlcount++; seeksorted += seek / 1024; }
-      else seeksorted += (maxsec - minsec) / 1024;
+      else seeksorted += (iseek + maxsec - minsec) / 1024;
       if (rev && !r)     {  revcount++; readysorted += n_ready; }
       if (!rev && !s)    { sortcount++; readysorted += n_ready; }
       }
@@ -1375,7 +1401,7 @@ static void flush_dev(Scsi_Device *dev, unsigned long cursec, unsigned int j,
    for (n = 0; n < n_ready; n++) {
       k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
 
-      if (wait_on_busy(sh[j]->io_port)) {
+      if (wait_on_busy(sh[j]->io_port, MAXLOOP)) {
          printk("%s: %s, target %d.%d:%d, pid %ld, Mbox %d, adapter"\
                 " busy, will abort.\n", BN(j), (ihdlr ? "ihdlr" : "qcomm"),
                 SCpnt->channel, SCpnt->target, SCpnt->lun, SCpnt->pid, k);
index 588259e101462c6848a740618a49c2e1146c2073..9381f7729421ddae5466e1daf1c31acdde9e0b65 100644 (file)
@@ -11,7 +11,7 @@ int u14_34f_abort(Scsi_Cmnd *);
 int u14_34f_reset(Scsi_Cmnd *, unsigned int);
 int u14_34f_biosparam(Disk *, kdev_t, int *);
 
-#define U14_34F_VERSION "3.00.09"
+#define U14_34F_VERSION "3.10.00"
 
 #define ULTRASTOR_14_34F {                                            \
                NULL, /* Ptr for modules */                           \
index 2c8916132d9c2e87cd1af0542f69bc39c029eab1..e80fe81b71ce1c24bb88a066d9d39d032b643ca4 100644 (file)
@@ -280,7 +280,6 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
              /* Real error */
              sys_close(elf_exec_fileno);
              kfree(elf_phdata);
-printk("%d", error);
              return ~0UL;
            }
 
index e26f2ede600041d3014578468c6031131fee7535..0b35d6e00529b3f5bf355d6b94d633de5598a995 100644 (file)
@@ -591,8 +591,9 @@ void set_blocksize(kdev_t dev, int size)
                                 continue;
                        if (bh->b_size == size)
                                 continue;
-                       
+                       bhnext->b_count++;
                        wait_on_buffer(bh);
+                       bhnext->b_count--;
                        if (bh->b_dev == dev && bh->b_size != size) {
                                clear_bit(BH_Dirty, &bh->b_state);
                                clear_bit(BH_Uptodate, &bh->b_state);
@@ -1606,6 +1607,7 @@ asmlinkage int sync_old_buffers(void)
                                 ndirty++;
                                 if(bh->b_flushtime > jiffies) continue;
                                 nwritten++;
+                                next->b_count++;
                                 bh->b_count++;
                                 bh->b_flushtime = 0;
 #ifdef DEBUG
@@ -1613,6 +1615,7 @@ asmlinkage int sync_old_buffers(void)
 #endif
                                 ll_rw_block(WRITE, 1, &bh);
                                 bh->b_count--;
+                                next->b_count--;
                         }
        }
 #ifdef DEBUG
@@ -1751,6 +1754,7 @@ int bdflush(void * unused)
                                             currently dirty buffers are not shared, so it does not matter */
                                          if (refilled && major == LOOP_MAJOR)
                                                   continue;
+                                         next->b_count++;
                                          bh->b_count++;
                                          ndirty++;
                                          bh->b_flushtime = 0;
@@ -1766,6 +1770,7 @@ int bdflush(void * unused)
                                          if(nlist != BUF_DIRTY) ncount++;
 #endif
                                          bh->b_count--;
+                                         next->b_count--;
                                  }
                 }
 #ifdef DEBUG
index 7a4943edec73200f4078c1dca9d7415a99b7fcae..30d0bf4c486eef34a16e24a8a8958123ae6db19d 100644 (file)
@@ -121,6 +121,11 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
        char *name;
        struct iso_directory_record *de;
 
+       if( filp->f_pos >= inode->i_size ) {
+         return 0;
+       }
        offset = filp->f_pos & (bufsize - 1);
        block = isofs_bmap(inode, filp->f_pos >> bufbits);
 
index 71f816b47b1d927642166b63c7d360ee2585ec66..06ccfde5c1f2bcf29e3a84e812dda22e395773cf 100644 (file)
@@ -65,7 +65,6 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
        unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
        unsigned int block, i, f_pos, offset, inode_number;
        struct buffer_head * bh;
-       void * cpnt = NULL;
        unsigned int old_offset;
        unsigned int backlink;
        int dlen, rrflag, match;
@@ -117,21 +116,8 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                /* Handle case where the directory entry spans two blocks.
                   Usually 1024 byte boundaries */
                if (offset >= bufsize) {
-                       unsigned int frag1;
-                       frag1 = bufsize - old_offset;
-                       cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
-                       if (!cpnt) return 0;
-                       memcpy(cpnt, bh->b_data + old_offset, frag1);
-
-                       de = (struct iso_directory_record *) cpnt;
-                       brelse(bh);
-                       offset = f_pos & (bufsize - 1);
-                       block = isofs_bmap(dir,f_pos>>bufbits);
-                       if (!block || !(bh = bread(dir->i_dev,block,bufsize))) {
-                               kfree(cpnt);
-                               return 0;
-                       };
-                       memcpy((char *)cpnt+frag1, bh->b_data, offset);
+                       printk("Directory entry extends past end of iso9660 block\n");
+                       return 0;
                }
                
                /* Handle the '.' case */
@@ -190,12 +176,6 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        match = isofs_match(namelen,name,dpnt,dlen);
                }
 
-               if (cpnt)
-               {
-                       kfree(cpnt);
-                       cpnt = NULL;
-               }
-
                if(rrflag) kfree(dpnt);
                if (match) {
                        if(inode_number == -1) {
@@ -217,8 +197,6 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                }
        }
  out:
-       if (cpnt)
-               kfree(cpnt);
        brelse(bh);
        return NULL;
 }
index 6f453904575dc8eb10c9dfafe653b5f35e6982f0..a9bb95f52159d45e629552a09822a5d7fa3883d4 100644 (file)
     block = cont_extent; \
     offset = cont_offset; \
     offset1 = 0; \
-    if(ISOFS_BUFFER_SIZE(DEV) == 1024) {     \
-      block <<= 1;    \
-      if (offset >= 1024) block++; \
-      offset &= 1023; \
-      if(offset + cont_size >= 1024) { \
-         bh = bread(DEV->i_dev, block++, ISOFS_BUFFER_SIZE(DEV)); \
-         if(!bh) {printk("Unable to read continuation Rock Ridge record\n"); \
-                    kfree(buffer); \
-                    buffer = NULL; } else { \
-           memcpy(buffer, bh->b_data + offset, 1024 - offset); \
-            brelse(bh); \
-           offset1 = 1024 - offset; \
-           offset = 0;} \
-      }  \
-    };     \
     if(buffer) { \
       bh = bread(DEV->i_dev, block, ISOFS_BUFFER_SIZE(DEV)); \
       if(bh){       \
@@ -429,7 +414,6 @@ char * get_rock_ridge_symlink(struct inode * inode)
   unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
   struct buffer_head * bh;
   unsigned char * pnt;
-  void * cpnt = NULL;
   char * rpnt;
   struct iso_directory_record * raw_inode;
   CONTINUE_DECLS;
@@ -455,24 +439,12 @@ char * get_rock_ridge_symlink(struct inode * inode)
   
   raw_inode = ((struct iso_directory_record *) pnt);
   
+  /*
+   * If we go past the end of the buffer, there is some sort of error.
+   */
   if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize){
-    int frag1, offset;
-    
-    offset = (inode->i_ino & (bufsize - 1));
-    frag1 = bufsize - offset;
-    cpnt = kmalloc(*pnt,GFP_KERNEL);
-    if(!cpnt) return NULL;
-    memcpy(cpnt, bh->b_data + offset, frag1);
-    brelse(bh);
-    if (!(bh = bread(inode->i_dev,++block, bufsize))) {
-      kfree(cpnt);
-      printk("unable to read i-node block");
-      return NULL;
-    };
-    offset += *pnt - bufsize;
-    memcpy((char *)cpnt+frag1, bh->b_data, offset);
-    pnt = ((unsigned char *) cpnt);
-    raw_inode = ((struct iso_directory_record *) pnt);
+       printk("symlink spans iso9660 blocks\n");
+       return NULL;
   };
   
   /* Now test for possible Rock Ridge extensions which will override some of
@@ -558,11 +530,6 @@ char * get_rock_ridge_symlink(struct inode * inode)
   MAYBE_CONTINUE(repeat,inode);
   brelse(bh);
   
-  if (cpnt) {
-    kfree(cpnt);
-    cpnt = NULL;
-  };
-
   return rpnt;
  out:
   if(buffer) kfree(buffer);
index b57d6525fa01c3bf4961f78dadec95756910bbab..dc10e0cf19b9cd668f3c68784847917f10e2980f 100644 (file)
@@ -58,9 +58,6 @@ extern unsigned long avenrun[];               /* Load averages */
 extern int nr_running, nr_tasks;
 extern int last_pid;
 
-#define FIRST_TASK task[0]
-#define LAST_TASK task[NR_TASKS-1]
-
 #include <linux/head.h>
 #include <linux/fs.h>
 #include <linux/signal.h>
index 17e80e975e070ba40c46f7325610b0014ace2c4e..60fb2d74f1ee3007ab9db0acadf08bde54360c83 100644 (file)
@@ -23,7 +23,7 @@ struct rpc_portmap {
        __u32                   pm_prog;
        __u32                   pm_vers;
        __u32                   pm_prot;
-       __u32                   pm_port;
+       __u16                   pm_port;
 };
 
 /*
index c360ba84af5f7cd275831d33ebb06cba98f378d6..d7a61dbb1e41e79e391166b9cb2dac76b2050b1d 100644 (file)
@@ -725,7 +725,7 @@ void vmtruncate(struct inode * inode, unsigned long offset)
                flush_cache_range(mm, start, end);
                zap_page_range(mm, start, len);
                flush_tlb_range(mm, start, end);
-       } while ((mpnt = mpnt->vm_next_share) != inode->i_mmap);
+       } while ((mpnt = mpnt->vm_next_share) != NULL);
 }