]> git.hungrycats.org Git - linux/commitdiff
v2.5.1.4 -> v2.5.1.5
authorLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 07:59:43 +0000 (23:59 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 07:59:43 +0000 (23:59 -0800)
- Dave Jones: more merging, fix up last merge..
- release to sync with Dave

70 files changed:
Makefile
arch/i386/kernel/Makefile
arch/i386/kernel/setup-visws.c [new file with mode: 0644]
arch/i386/kernel/setup.c
arch/i386/kernel/smpboot.c
drivers/acpi/ospm/thermal/tzpolicy.c
drivers/block/ps2esdi.c
drivers/char/ftape/RELEASE-NOTES
drivers/char/ftape/compressor/zftape-compress.c
drivers/char/ftape/lowlevel/ftape-ctl.c
drivers/char/ftape/zftape/zftape-ctl.c
drivers/char/ftape/zftape/zftape-read.c
drivers/char/ftape/zftape/zftape-write.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c
drivers/net/hamradio/soundmodem/sm_sbc.c
drivers/net/hamradio/soundmodem/sm_wss.c
drivers/net/wan/sdla_chdlc.c
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_ppp.c
drivers/net/wan/sdla_x25.c
drivers/net/wan/sdlamain.c
drivers/s390/s390io.c
drivers/scsi/fdomain.c
drivers/scsi/fdomain.h
drivers/scsi/ncr53c8xx.c
drivers/scsi/scsi_scan.c
drivers/scsi/sym53c8xx_comm.h
drivers/sound/ad1848.c
drivers/sound/msnd.c
drivers/sound/os.h
drivers/sound/sb_card.c
drivers/usb/usbnet.c
drivers/video/fbmem.c
fs/devfs/base.c
fs/ext2/super.c
fs/ext3/Makefile
fs/ext3/acl.c [deleted file]
fs/ext3/inode.c
fs/ext3/super.c
fs/inflate_fs/inflate_syms.c
fs/intermezzo/file.c
fs/intermezzo/journal.c
fs/intermezzo/psdev.c
fs/jbd/commit.c
fs/jbd/journal.c
fs/jbd/recovery.c
fs/jbd/revoke.c
fs/jbd/transaction.c
fs/minix/inode.c
fs/msdos/msdosfs_syms.c
fs/namespace.c
fs/sysv/ChangeLog
fs/sysv/inode.c
fs/sysv/super.c
fs/ufs/inode.c
fs/ufs/super.c
fs/vfat/vfatfs_syms.c
include/asm-i386/cpufeature.h
include/asm-i386/msr.h
include/asm-i386/smp.h
include/linux/ext3_fs.h
include/linux/ext3_jbd.h
include/linux/jbd.h
include/linux/sched.h
kernel/sched.c
net/packet/af_packet.c
net/wanrouter/wanmain.c
net/wanrouter/wanproc.c

index 3ab427247b2f06c6f0b881af598fcc6bb556d100..0dd32d3539e99c0e41f17370bc93c5ca2ece0c96 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 2
-EXTRAVERSION =-pre4
+EXTRAVERSION =-pre5
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
index 789604e6fbfdecf56429d49b069163ff2a0fa7dd..d7fd9193ddbc73b2b0ad1c1a98fa79bac5107bb9 100644 (file)
@@ -39,6 +39,9 @@ obj-$(CONFIG_APM)             += apm.o
 obj-$(CONFIG_SMP)              += smp.o smpboot.o trampoline.o
 obj-$(CONFIG_X86_LOCAL_APIC)   += mpparse.o apic.o nmi.o
 obj-$(CONFIG_X86_IO_APIC)      += io_apic.o acpitable.o
+ifdef CONFIG_VISWS
+obj-y += setup-visws.o
 obj-$(CONFIG_X86_VISWS_APIC)   += visws_apic.o
+endif
 
 include $(TOPDIR)/Rules.make
diff --git a/arch/i386/kernel/setup-visws.c b/arch/i386/kernel/setup-visws.c
new file mode 100644 (file)
index 0000000..1c8220b
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ *  Unmaintained SGI Visual Workstation support.
+ *  Split out from setup.c by davej@suse.de
+ */
+
+char visws_board_type = -1;
+char visws_board_rev = -1;
+
+#define        PIIX_PM_START           0x0F80
+
+#define        SIO_GPIO_START          0x0FC0
+
+#define        SIO_PM_START            0x0FC8
+
+#define        PMBASE                  PIIX_PM_START
+#define        GPIREG0                 (PMBASE+0x30)
+#define        GPIREG(x)               (GPIREG0+((x)/8))
+#define        PIIX_GPI_BD_ID1         18
+#define        PIIX_GPI_BD_REG         GPIREG(PIIX_GPI_BD_ID1)
+
+#define        PIIX_GPI_BD_SHIFT       (PIIX_GPI_BD_ID1 % 8)
+
+#define        SIO_INDEX       0x2e
+#define        SIO_DATA        0x2f
+
+#define        SIO_DEV_SEL     0x7
+#define        SIO_DEV_ENB     0x30
+#define        SIO_DEV_MSB     0x60
+#define        SIO_DEV_LSB     0x61
+
+#define        SIO_GP_DEV      0x7
+
+#define        SIO_GP_BASE     SIO_GPIO_START
+#define        SIO_GP_MSB      (SIO_GP_BASE>>8)
+#define        SIO_GP_LSB      (SIO_GP_BASE&0xff)
+
+#define        SIO_GP_DATA1    (SIO_GP_BASE+0)
+
+#define        SIO_PM_DEV      0x8
+
+#define        SIO_PM_BASE     SIO_PM_START
+#define        SIO_PM_MSB      (SIO_PM_BASE>>8)
+#define        SIO_PM_LSB      (SIO_PM_BASE&0xff)
+#define        SIO_PM_INDEX    (SIO_PM_BASE+0)
+#define        SIO_PM_DATA     (SIO_PM_BASE+1)
+
+#define        SIO_PM_FER2     0x1
+
+#define        SIO_PM_GP_EN    0x80
+
+void __init visws_get_board_type_and_rev(void)
+{
+       int raw;
+
+       visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
+                                                        >> PIIX_GPI_BD_SHIFT;
+/*
+ * Get Board rev.
+ * First, we have to initialize the 307 part to allow us access
+ * to the GPIO registers.  Let's map them at 0x0fc0 which is right
+ * after the PIIX4 PM section.
+ */
+       outb_p(SIO_DEV_SEL, SIO_INDEX);
+       outb_p(SIO_GP_DEV, SIO_DATA);   /* Talk to GPIO regs. */
+
+       outb_p(SIO_DEV_MSB, SIO_INDEX);
+       outb_p(SIO_GP_MSB, SIO_DATA);   /* MSB of GPIO base address */
+
+       outb_p(SIO_DEV_LSB, SIO_INDEX);
+       outb_p(SIO_GP_LSB, SIO_DATA);   /* LSB of GPIO base address */
+
+       outb_p(SIO_DEV_ENB, SIO_INDEX);
+       outb_p(1, SIO_DATA);            /* Enable GPIO registers. */
+
+/*
+ * Now, we have to map the power management section to write
+ * a bit which enables access to the GPIO registers.
+ * What lunatic came up with this shit?
+ */
+       outb_p(SIO_DEV_SEL, SIO_INDEX);
+       outb_p(SIO_PM_DEV, SIO_DATA);   /* Talk to GPIO regs. */
+
+       outb_p(SIO_DEV_MSB, SIO_INDEX);
+       outb_p(SIO_PM_MSB, SIO_DATA);   /* MSB of PM base address */
+
+       outb_p(SIO_DEV_LSB, SIO_INDEX);
+       outb_p(SIO_PM_LSB, SIO_DATA);   /* LSB of PM base address */
+
+       outb_p(SIO_DEV_ENB, SIO_INDEX);
+       outb_p(1, SIO_DATA);            /* Enable PM registers. */
+
+/*
+ * Now, write the PM register which enables the GPIO registers.
+ */
+       outb_p(SIO_PM_FER2, SIO_PM_INDEX);
+       outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
+
+/*
+ * Now, initialize the GPIO registers.
+ * We want them all to be inputs which is the
+ * power on default, so let's leave them alone.
+ * So, let's just read the board rev!
+ */
+       raw = inb_p(SIO_GP_DATA1);
+       raw &= 0x7f;    /* 7 bits of valid board revision ID. */
+
+       if (visws_board_type == VISWS_320) {
+               if (raw < 0x6) {
+                       visws_board_rev = 4;
+               } else if (raw < 0xc) {
+                       visws_board_rev = 5;
+               } else {
+                       visws_board_rev = 6;
+               }
+       } else if (visws_board_type == VISWS_540) {
+                       visws_board_rev = 2;
+               } else {
+                       visws_board_rev = raw;
+               }
+
+               printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
+                       visws_board_type == VISWS_320 ? "320" :
+                       (visws_board_type == VISWS_540 ? "540" :
+                                       "unknown"), visws_board_rev);
+       }
+}
index 274fb64fd81e32d16b814aab64a4d4b5f282c067..efd313e13fe9e6ad4bff56683063ad3f5fa7ccc3 100644 (file)
@@ -158,6 +158,7 @@ extern void mcheck_init(struct cpuinfo_x86 *c);
 extern int root_mountflags;
 extern char _text, _etext, _edata, _end;
 extern int blk_nohighio;
+void __init visws_get_board_type_and_rev(void);
 
 static int disable_x86_serial_nr __initdata = 1;
 static int disable_x86_fxsr __initdata = 0;
@@ -191,131 +192,6 @@ int enable_acpi_smp_table;
 #define RAMDISK_PROMPT_FLAG            0x8000
 #define RAMDISK_LOAD_FLAG              0x4000  
 
-#ifdef CONFIG_VISWS
-char visws_board_type = -1;
-char visws_board_rev = -1;
-
-#define        PIIX_PM_START           0x0F80
-
-#define        SIO_GPIO_START          0x0FC0
-
-#define        SIO_PM_START            0x0FC8
-
-#define        PMBASE                  PIIX_PM_START
-#define        GPIREG0                 (PMBASE+0x30)
-#define        GPIREG(x)               (GPIREG0+((x)/8))
-#define        PIIX_GPI_BD_ID1         18
-#define        PIIX_GPI_BD_REG         GPIREG(PIIX_GPI_BD_ID1)
-
-#define        PIIX_GPI_BD_SHIFT       (PIIX_GPI_BD_ID1 % 8)
-
-#define        SIO_INDEX       0x2e
-#define        SIO_DATA        0x2f
-
-#define        SIO_DEV_SEL     0x7
-#define        SIO_DEV_ENB     0x30
-#define        SIO_DEV_MSB     0x60
-#define        SIO_DEV_LSB     0x61
-
-#define        SIO_GP_DEV      0x7
-
-#define        SIO_GP_BASE     SIO_GPIO_START
-#define        SIO_GP_MSB      (SIO_GP_BASE>>8)
-#define        SIO_GP_LSB      (SIO_GP_BASE&0xff)
-
-#define        SIO_GP_DATA1    (SIO_GP_BASE+0)
-
-#define        SIO_PM_DEV      0x8
-
-#define        SIO_PM_BASE     SIO_PM_START
-#define        SIO_PM_MSB      (SIO_PM_BASE>>8)
-#define        SIO_PM_LSB      (SIO_PM_BASE&0xff)
-#define        SIO_PM_INDEX    (SIO_PM_BASE+0)
-#define        SIO_PM_DATA     (SIO_PM_BASE+1)
-
-#define        SIO_PM_FER2     0x1
-
-#define        SIO_PM_GP_EN    0x80
-
-static void __init visws_get_board_type_and_rev(void)
-{
-       int raw;
-
-       visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
-                                                        >> PIIX_GPI_BD_SHIFT;
-/*
- * Get Board rev.
- * First, we have to initialize the 307 part to allow us access
- * to the GPIO registers.  Let's map them at 0x0fc0 which is right
- * after the PIIX4 PM section.
- */
-       outb_p(SIO_DEV_SEL, SIO_INDEX);
-       outb_p(SIO_GP_DEV, SIO_DATA);   /* Talk to GPIO regs. */
-    
-       outb_p(SIO_DEV_MSB, SIO_INDEX);
-       outb_p(SIO_GP_MSB, SIO_DATA);   /* MSB of GPIO base address */
-
-       outb_p(SIO_DEV_LSB, SIO_INDEX);
-       outb_p(SIO_GP_LSB, SIO_DATA);   /* LSB of GPIO base address */
-
-       outb_p(SIO_DEV_ENB, SIO_INDEX);
-       outb_p(1, SIO_DATA);            /* Enable GPIO registers. */
-    
-/*
- * Now, we have to map the power management section to write
- * a bit which enables access to the GPIO registers.
- * What lunatic came up with this shit?
- */
-       outb_p(SIO_DEV_SEL, SIO_INDEX);
-       outb_p(SIO_PM_DEV, SIO_DATA);   /* Talk to GPIO regs. */
-
-       outb_p(SIO_DEV_MSB, SIO_INDEX);
-       outb_p(SIO_PM_MSB, SIO_DATA);   /* MSB of PM base address */
-    
-       outb_p(SIO_DEV_LSB, SIO_INDEX);
-       outb_p(SIO_PM_LSB, SIO_DATA);   /* LSB of PM base address */
-
-       outb_p(SIO_DEV_ENB, SIO_INDEX);
-       outb_p(1, SIO_DATA);            /* Enable PM registers. */
-    
-/*
- * Now, write the PM register which enables the GPIO registers.
- */
-       outb_p(SIO_PM_FER2, SIO_PM_INDEX);
-       outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
-    
-/*
- * Now, initialize the GPIO registers.
- * We want them all to be inputs which is the
- * power on default, so let's leave them alone.
- * So, let's just read the board rev!
- */
-       raw = inb_p(SIO_GP_DATA1);
-       raw &= 0x7f;    /* 7 bits of valid board revision ID. */
-
-       if (visws_board_type == VISWS_320) {
-               if (raw < 0x6) {
-                       visws_board_rev = 4;
-               } else if (raw < 0xc) {
-                       visws_board_rev = 5;
-               } else {
-                       visws_board_rev = 6;
-       
-               }
-       } else if (visws_board_type == VISWS_540) {
-                       visws_board_rev = 2;
-               } else {
-                       visws_board_rev = raw;
-               }
-
-               printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
-                       visws_board_type == VISWS_320 ? "320" :
-                       (visws_board_type == VISWS_540 ? "540" :
-                                       "unknown"),
-                                       visws_board_rev);
-       }
-#endif
-
 
 static char command_line[COMMAND_LINE_SIZE];
        char saved_command_line[COMMAND_LINE_SIZE];
@@ -1289,8 +1165,24 @@ static int __init init_amd(struct cpuinfo_x86 *c)
                        }
                        break;
 
-               case 6: /* An Athlon/Duron. We can trust the BIOS probably */
-                       break;          
+               case 6: /* An Athlon/Duron */
+                       /* Bit 15 of Athlon specific MSR 15, needs to be 0
+                        * to enable SSE on Palomino/Morgan CPU's.
+                        * If the BIOS didn't enable it already, enable it
+                        * here.
+                        */
+                       if (c->x86_model == 6 || c->x86_model == 7) {
+                               if (!test_bit(X86_FEATURE_XMM, &c->x86_capability)) {
+                                       printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
+                                       rdmsr(MSR_K7_HWCR, l, h);
+                                       l &= ~0x00008000;
+                                       wrmsr(MSR_K7_HWCR, l, h);
+                                       set_bit(X86_FEATURE_XMM, &c->x86_capability);
+                               }
+                       }
+                       break;
+
        }
 
        display_cacheinfo(c);
@@ -2200,6 +2092,56 @@ static void __init init_intel(struct cpuinfo_x86 *c)
 
        if ( p )
                strcpy(c->x86_model_id, p);
+       
+#ifdef CONFIG_SMP
+       if (test_bit(X86_FEATURE_HT, &c->x86_capability)) {
+               extern  int phys_proc_id[NR_CPUS];
+               
+               u32     eax, ebx, ecx, edx;
+               int     index_lsb, index_msb, tmp;
+               int     initial_apic_id;
+               int     cpu = smp_processor_id();
+
+               cpuid(1, &eax, &ebx, &ecx, &edx);
+               smp_num_siblings = (ebx & 0xff0000) >> 16;
+
+               if (smp_num_siblings == 1) {
+                       printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
+               } else if (smp_num_siblings > 1 ) {
+                       index_lsb = 0;
+                       index_msb = 31;
+                       /*
+                        * At this point we only support two siblings per
+                        * processor package.
+                        */
+#define NR_SIBLINGS    2
+                       if (smp_num_siblings != NR_SIBLINGS) {
+                               printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings);
+                               smp_num_siblings = 1;
+                               goto too_many_siblings;
+                       }
+                       tmp = smp_num_siblings;
+                       while ((tmp & 1) == 0) {
+                               tmp >>=1 ;
+                               index_lsb++;
+                       }
+                       tmp = smp_num_siblings;
+                       while ((tmp & 0x80000000 ) == 0) {
+                               tmp <<=1 ;
+                               index_msb--;
+                       }
+                       if (index_lsb != index_msb )
+                               index_msb++;
+                       initial_apic_id = ebx >> 24 & 0xff;
+                       phys_proc_id[cpu] = initial_apic_id >> index_msb;
+
+                       printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
+                               phys_proc_id[cpu]);
+               }
+
+       }
+too_many_siblings:
+#endif
 }
 
 void __init get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -2706,7 +2648,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
                "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
                "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
-               "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
+               "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
 
                /* AMD-defined */
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
index 64d6c827cd96bcb3071e510607b8ea56152f48f2..73727329ab11faed530ba46a294e45e313a28d63 100644 (file)
@@ -56,6 +56,10 @@ static int max_cpus = -1;
 /* Total count of live CPUs */
 int smp_num_cpus = 1;
 
+/* Number of siblings per CPU package */
+int smp_num_siblings = 1;
+int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
+
 /* Bitmask of currently online CPUs */
 unsigned long cpu_online_map;
 
@@ -971,6 +975,8 @@ static int boot_cpu_logical_apicid;
 /* Where the IO area was mapped on multiquad, always 0 otherwise */
 void *xquad_portio = NULL;
 
+int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+
 void __init smp_boot_cpus(void)
 {
        int apicid, cpu, bit;
@@ -1162,6 +1168,34 @@ void __init smp_boot_cpus(void)
                printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n");
        Dprintk("Boot done.\n");
 
+       /*
+        * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
+        * that we can tell the sibling CPU efficiently.
+        */
+       if (test_bit(X86_FEATURE_HT, boot_cpu_data.x86_capability)
+           && smp_num_siblings > 1) {
+               for (cpu = 0; cpu < NR_CPUS; cpu++)
+                       cpu_sibling_map[cpu] = NO_PROC_ID;
+               
+               for (cpu = 0; cpu < smp_num_cpus; cpu++) {
+                       int     i;
+                       
+                       for (i = 0; i < smp_num_cpus; i++) {
+                               if (i == cpu)
+                                       continue;
+                               if (phys_proc_id[cpu] == phys_proc_id[i]) {
+                                       cpu_sibling_map[cpu] = i;
+                                       printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
+                                       break;
+                               }
+                       }
+                       if (cpu_sibling_map[cpu] == NO_PROC_ID) {
+                               smp_num_siblings = 1;
+                               printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
+                       }
+               }
+       }
+            
 #ifndef CONFIG_VISWS
        /*
         * Here we can be sure that there is an IO-APIC in the system. Let's
index 3c4ebbb2d37417c1418952c24e563b7bb8b3ebf3..83608fab27ce3fe78aaec7a0f167673f2cbd092f 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/proc_fs.h>
 #include <linux/sysctl.h>
 #include <linux/pm.h>
+#include <linux/sched.h>
 
 #include <acpi.h>
 #include <bm.h>
index eedafcaa9f7a9180d1ca516650e84ca96a47d407..9664721ec353bdfa9d3b2bef656a6622de8855e2 100644 (file)
@@ -952,10 +952,10 @@ static void ps2esdi_normal_interrupt_handler(u_int int_ret_code)
                break;
        }
        if(ending != -1) {
-               spin_lock_irqsave(ps2esdi_LOCK, flags);
+               spin_lock_irqsave(&ps2esdi_lock, flags);
                end_request(ending);
                do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
-               spin_unlock_irqrestore(ps2esdi_LOCK, flags);
+               spin_unlock_irqrestore(&ps2esdi_lock, flags);
        }
 }                              /* handle interrupts */
 
index 4cb63e56df338618440abaabd59274ecaed79510..03799dbc05a4f93774aac309ea184b1e7c1f9585 100644 (file)
@@ -838,6 +838,7 @@ received. I hope to find some time to do this soon.
 - Split ftape-io.c into ftape-io.c and ftape-ctl.c files.
 - Corrected too high media error count after writing to
   a bad tape.
+- Added #include <asm/segment.h> again because old kernel versions
   need it.
 - Fixed fdc not being disabled when open failed because no tape
   drive was found.
index 4265bba231f73d380f32eaa7718f95c681be9f7c..5abdde05455b80272d842063937af850ecf24ad4 100644 (file)
@@ -40,6 +40,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
index 3c8f7f522e9a54b6f6c27738414501c9f667456d..6c1ef5235053e5bd2c77cd8dd37ae1db08ddc412 100644 (file)
@@ -36,6 +36,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #endif
 #include <asm/io.h>
 
index 1821480b43bfaccff6bc290543d402aa900d5cd2..6441ca9298f25bd60d73afe37d1919cb41316c4e 100644 (file)
@@ -36,6 +36,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
index 35657926fc9a2c056e91fe7f89ff3557a6f5392f..756ee32391d3ca472a53244a9191d1eb43f730ff 100644 (file)
@@ -32,6 +32,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
index 66b581ad7ea9e967c2cdc0c5d71115e096640a86..8608c4dcc9d89d6f2b60db0c17fdabd812478604 100644 (file)
@@ -32,6 +32,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
index f2a087486ed186210b44a33542020b6cd2e15428..addbe20a4b7f93e0c8cd5a3edf1cd06ed026d160 100644 (file)
@@ -2588,6 +2588,13 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
        if (cap.mechtype == mechtype_caddy || cap.mechtype == mechtype_popup)
                CDROM_CONFIG_FLAGS (drive)->close_tray = 0;
 
+       /* Some drives used by Apple don't advertise audio play
+        * but they do support reading TOC & audio datas
+        */
+       if (strcmp (drive->id->model, "MATSHITADVD-ROM SR-8187") == 0 ||
+           strcmp (drive->id->model, "MATSHITADVD-ROM SR-8186") == 0)
+               CDROM_CONFIG_FLAGS (drive)->audio_play = 1;
+
 #if ! STANDARD_ATAPI
        if (cdi->sanyo_slot > 0) {
                CDROM_CONFIG_FLAGS (drive)->is_changer = 1;
index e50c7b4e7091e750618e97f928de872aa04c3170..9206953f24fa7d4f6b9cbe35847cce73c626034c 100644 (file)
@@ -863,8 +863,10 @@ static void __exit idedisk_exit (void)
                }
                /* We must remove proc entries defined in this module.
                   Otherwise we oops while accessing these entries */
+#ifdef CONFIG_PROC_FS
                if (drive->proc)
                        ide_remove_proc_entries(drive->proc, idedisk_proc);
+#endif
        }
        ide_unregister_module(&idedisk_module);
 }
index c138d365ba98d427c1924a9b1f9e63b89600a652..ca55f3b1845cbc8e9a799c8ff1b4a4863fab975d 100644 (file)
@@ -2029,10 +2029,13 @@ static void __exit idefloppy_exit (void)
                        printk ("%s: cleanup_module() called while still busy\n", drive->name);
                        failed++;
                }
+
+#ifdef CONFIG_PROC_FS
                /* We must remove proc entries defined in this module.
                   Otherwise we oops while accessing these entries */
                if (drive->proc)
                        ide_remove_proc_entries(drive->proc, idefloppy_proc);
+#endif
        }
        ide_unregister_module(&idefloppy_module);
 }
index 54e4e4f1e34a8fe4d498ca15653b68c51ac137e6..85ae47588ef4a2bd1db432e8fe459bb631abbc7b 100644 (file)
@@ -50,6 +50,7 @@
 #if LINUX_VERSION_CODE >= 0x20100
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #include <linux/mm.h>
 
 #undef put_user
index a6a2b782b9b16dba90ac45134449a3cd239872ca..6d94d6da4a463c9971ca06577888dd72c4bf8e96 100644 (file)
@@ -49,6 +49,7 @@
 #if LINUX_VERSION_CODE >= 0x20100
 #include <asm/uaccess.h>
 #else
+#include <asm/segment.h>
 #include <linux/mm.h>
 
 #undef put_user
index e02ed0d65d7ded27db726434851fc0894e9f65e0..f3a574fe356cf5a06da4d196f138be875bb11a0c 100644 (file)
@@ -65,6 +65,7 @@
  #include <linux/inetdevice.h>
  #include <linux/netdevice.h>
 #else                          
+ #include <asm/segment.h>
  #include <net/route.h>          /* Adding new route entries : 2.0.X kernels */
 #endif
 
index 050fca46d7c30bfaae2559d37b643ceae114caa2..c14bc778bd9f4824bc8bb4356c8269cfb819a81c 100644 (file)
  #include <linux/netdevice.h>
 
 #else
+ #include <asm/segment.h>
 #endif
 
 #include <net/route.h>                 /* Dynamic Route Creation */
index 58a5aa5e80b9ece7a403c10446c33deb66ab832d..73a9d033e8c65283064401b39d41d1bad9b353a7 100644 (file)
  #include <linux/inetdevice.h>
  #include <linux/netdevice.h>
 #else
+ #include <asm/segment.h>
  #include <net/route.h>          /* Adding new route entries : 2.0.X kernels */
 #endif
 
index 47a379fc80bb51dcf2d6fa1c4d310cdb5dbce0d9..47bf1b3f8e9cb51663933c3a583e6090604dce79 100644 (file)
@@ -98,6 +98,7 @@
 #if defined(LINUX_2_1) || defined(LINUX_2_4)
  #include <asm/uaccess.h>
 #else
+ #include <asm/segment.h>
  #include <net/route.h>
 #endif
 
index abb81220c60ea933dff6ff268817a93547e92eb7..335d0a5d9c1ce31f774a603d01697d3bb274e908 100644 (file)
@@ -78,6 +78,7 @@
 
 #else
 
+ #include <asm/segment.h>
  #define devinet_ioctl(x,y) dev_ioctl(x,y)
  #define netdevice_t struct device 
  #define test_and_set_bit set_bit
index f06ffdfd2d9bd71c432a83c62d6a44d48d2688b6..c22080d11f5bd9ad01aed1c911fa21e8c2b24123 100644 (file)
@@ -6,6 +6,7 @@
  *    Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
  *                             IBM Corporation
  *    Author(s): Ingo Adlung (adlung@de.ibm.com)
+ *               Cornelia Huck (cohuck@de.ibm.com) 
  *    ChangeLog: 01/07/2001 Blacklist cleanup (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
  *               01/04/2001 Holger Smolinski (smolinsk@de.ibm.com)
  *                          Fixed lost interrupts and do_adapter_IO
@@ -108,7 +109,9 @@ static void init_IRQ_handler( int irq, void *dev_id, struct pt_regs *regs);
 static void s390_process_subchannels( void);
 static void s390_device_recognition_all( void);
 static void s390_device_recognition_irq( int irq);
+#ifdef CONFIG_PROC_FS
 static void s390_redo_validation(void);
+#endif
 static int  s390_validate_subchannel( int irq, int enable);
 static int  s390_SenseID( int irq, senseid_t *sid, __u8 lpm);
 static int  s390_SetPGID( int irq, __u8 lpm, pgid_t *pgid);
@@ -117,7 +120,9 @@ static int  s390_process_IRQ( unsigned int irq );
 static int  enable_subchannel( unsigned int irq);
 static int  disable_subchannel( unsigned int irq);
 
+#ifdef CONFIG_PROC_FS
 static int chan_proc_init( void );
+#endif 
 
 static inline void do_adapter_IO( __u32 intparm );
 
@@ -666,6 +671,7 @@ static int __init cio_notoper_setup(char *parm)
        
 __setup("cio_notoper_msg=", cio_notoper_setup);
 
+#ifdef CONFIG_PROC_FS
 static int __init cio_proc_devinfo_setup(char *parm)
 {
        if (!strcmp(parm, "yes")) {
@@ -673,13 +679,14 @@ static int __init cio_proc_devinfo_setup(char *parm)
        } else if (!strcmp(parm, "no")) {
                cio_proc_devinfo = 0;
        } else {
-               printk("cio_proc_devinfo_setup: invalid parameter '%s'\n",parm);
+               printk( KERN_ERR "cio_proc_devinfo_setup: invalid parameter '%s'\n",parm);
        }
 
        return 1;
 }
 
 __setup("cio_proc_devinfo=", cio_proc_devinfo_setup);
+#endif
 
 /*
  * register for adapter interrupts
@@ -4779,10 +4786,12 @@ void s390_redo_validation(void)
                                                
                                        } 
                                }
+#ifdef CONFIG_PROC_FS
                                if (cio_proc_devinfo) 
                                        if (irq < MAX_CIO_PROCFS_ENTRIES) {
                                                cio_procfs_device_create(ioinfo[irq]->devno);
                                }
+#endif
                        }
                }
                irq++;
@@ -6523,10 +6532,11 @@ void s390_do_crw_pending( crwe_t *pcrwe )
                                if ( ioinfo[irq]->ui.flags.oper == 0 )
                                {
                                         not_oper_handler_func_t nopfunc=ioinfo[irq]->nopfunc;
-                                        
+#ifdef CONFIG_PROC_FS                                   
                                         /* remove procfs entry */
                                         if (cio_proc_devinfo)
                                                 cio_procfs_device_remove(dev_no);
+#endif
                                        /*
                                         * If the device has gone
                                         *  call not oper handler               
@@ -6573,12 +6583,13 @@ void s390_do_crw_pending( crwe_t *pcrwe )
                                                                pdevreg->oper_func( irq, pdevreg );
 
                                                } /* endif */
-
+#ifdef CONFIG_PROC_FS
                                                /* add new procfs entry */
                                                if (cio_proc_devinfo) 
                                                        if (highest_subchannel < MAX_CIO_PROCFS_ENTRIES) {
                                                                cio_procfs_device_create(ioinfo[irq]->devno);
                                                        }
+#endif
                                        }
                                        /*
                                         * ... it is and was operational, but
@@ -6586,23 +6597,26 @@ void s390_do_crw_pending( crwe_t *pcrwe )
                                         */
                                        else if ((ioinfo[irq]->devno != dev_no) && ( ioinfo[irq]->nopfunc != NULL ))                                    
                                        {
+#ifdef CONFIG_PROC_FS
                                                int devno_old = ioinfo[irq]->devno;
+#endif
                                                ioinfo[irq]->nopfunc( irq,
                                                                      DEVSTAT_REVALIDATE );                             
-
+#ifdef CONFIG_PROC_FS
                                                /* remove old entry, add new */
                                                if (cio_proc_devinfo) {
                                                        cio_procfs_device_remove(devno_old);
                                                        cio_procfs_device_create(ioinfo[irq]->devno);
                                                }
+#endif
                                        } /* endif */
 
                                } /* endif */
-
+#ifdef CONFIG_PROC_FS
                                /* get rid of dead procfs entries */
                                if (cio_proc_devinfo) 
                                        cio_procfs_device_purge();
-
+#endif
                        } /* endif */
 
                        break;
@@ -6756,6 +6770,7 @@ int cio_debug_init( void )
 
 __initcall(cio_debug_init);
 
+#ifdef CONFIG_PROC_FS
 /* 
  * Display info on subchannels in /proc/subchannels. 
  * Adapted from procfs stuff in dasd.c by Cornelia Huck, 02/28/01.      
@@ -7163,19 +7178,19 @@ int cio_procfs_device_create(int devno)
                                entry->cio_chpid_entry = create_proc_entry( "chpids", S_IFREG|S_IRUGO, entry->cio_device_entry);
                                entry->cio_chpid_entry->proc_fops = &cio_chpid_entry_file_ops;
                        } else {
-                               printk("Error, could not allocate procfs structure!\n");
+                               printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
                                remove_proc_entry(buf, cio_procfs_deviceinfo_root);
                                kfree(entry);
                                rc = -ENOMEM;
                        }
                } else {
-                       printk("Error, could not allocate procfs structure!\n");
+                       printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
                        kfree(entry);
                        rc = -ENOMEM;
                }
 
        } else {
-               printk("Error, could not allocate procfs structure!\n");
+               printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
                rc = -ENOMEM;
        }
        return rc;
@@ -7370,7 +7385,7 @@ static ssize_t cio_ignore_proc_write (struct file *file, const char *user_buf,
        }
        buffer[user_len]='\0';
 #ifdef CIO_DEBUG_IO
-       printk ("/proc/cio_ignore: '%s'\n", buffer);
+       printk ( KERN_DEBUG "/proc/cio_ignore: '%s'\n", buffer);
 #endif /* CIO_DEBUG_IO */
        if (cio_debug_initialized)
                debug_sprintf_event(cio_debug_msg_id, 2, "/proc/cio_ignore: '%s'\n",buffer);
@@ -7491,6 +7506,7 @@ static int cio_irq_proc_init(void)
 __initcall(cio_irq_proc_init); 
 
 /* end of procfs stuff */
+#endif
 
 schib_t *s390_get_schib( int irq )
 {
index 229bad39f2c4e5cce64149515035d7af046d6740..bdd0ac884ad79893db55348287ac38cbce93fdc9 100644 (file)
@@ -983,7 +983,7 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
       /* Register the IRQ with the kernel */
 
       retcode = request_irq( interrupt_level,
-                            do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", NULL);
+                            do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", shpnt);
 
       if (retcode < 0) {
         if (retcode == -EINVAL) {
@@ -2035,6 +2035,15 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, kdev_t dev, int *info_array )
    return 0;
 }
 
+int fdomain_16x0_release(struct Scsi_Host *shpnt)
+{
+       if (shpnt->irq)
+               free_irq(shpnt->irq, shpnt);
+       if (shpnt->io_port && shpnt->n_io_port)
+               release_region(shpnt->io_port, shpnt->n_io_port);
+
+}
+
 MODULE_LICENSE("GPL");
 
 /* Eventually this will go into an include file, but this will be later */
index 1769d24c70e35ace8b15a54471773b9d8f614701..a85539af125bad2c4b993fbac4e6ea998fc49c2c 100644 (file)
@@ -34,6 +34,7 @@ int        fdomain_16x0_queue( Scsi_Cmnd *, void (*done)(Scsi_Cmnd *) );
 int        fdomain_16x0_biosparam( Disk *, kdev_t, int * );
 int        fdomain_16x0_proc_info( char *buffer, char **start, off_t offset,
                                   int length, int hostno, int inout );
+int        fdomain_16x0_release( struct Scsi_Host *shpnt );
 
 #define FDOMAIN_16X0 { proc_info:      fdomain_16x0_proc_info,           \
                       detect:         fdomain_16x0_detect,              \
@@ -43,6 +44,7 @@ int        fdomain_16x0_proc_info( char *buffer, char **start, off_t offset,
                       abort:          fdomain_16x0_abort,               \
                       reset:          fdomain_16x0_reset,               \
                       bios_param:     fdomain_16x0_biosparam,           \
+                      release:        fdomain_16x0_release,             \
                       can_queue:      1,                                \
                       this_id:        6,                                \
                       sg_tablesize:   64,                               \
index ce2e2e09021252fa013a57071d0688c7498d1af8..df2b302cc492f2c22e49b53ca5cf475432252aff 100644 (file)
@@ -8626,9 +8626,9 @@ static void ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
      if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 
@@ -8649,9 +8649,9 @@ static void ncr53c8xx_timeout(unsigned long npref)
      NCR_UNLOCK_NCB(np, flags);
 
      if (done_list) {
-          NCR_LOCK_SCSI_DONE(np, flags);
+          NCR_LOCK_SCSI_DONE(done_list->host, flags);
           ncr_flush_done_cmds(done_list);
-          NCR_UNLOCK_SCSI_DONE(np, flags);
+          NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
      }
 }
 
index 9cd871b0ceec0c88be4e68c140066d4d08a7e51b..aede1a6a94202f4409940a1b59e1fc8b4374ff89 100644 (file)
@@ -155,11 +155,14 @@ static struct dev_info device_list[] =
        {"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN},
        {"CMD", "CRA-7280", "*", BLIST_SPARSELUN},   // CMD RAID Controller
        {"CNSI", "G7324", "*", BLIST_SPARSELUN},     // Chaparral G7324 RAID
+       {"CNSi", "G8324", "*", BLIST_SPARSELUN},     // Chaparral G8324 RAID
        {"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN},
        {"Zzyzx", "RocketStor 2000", "*", BLIST_SPARSELUN},
        {"SONY", "TSL",       "*", BLIST_FORCELUN},  // DDS3 & DDS4 autoloaders
        {"DELL", "PERCRAID", "*", BLIST_FORCELUN},
        {"HP", "NetRAID-4M", "*", BLIST_FORCELUN},
+       {"ADAPTEC", "AACRAID", "*", BLIST_FORCELUN},
+       {"ADAPTEC", "Adaptec 5400S", "*", BLIST_FORCELUN},
 
        /*
         * Must be at end of list...
index ec4f1cc41c4cf6d292b1b6f7431c84f84d30742e..9fde4ab6b910ef82f4969567a86dab243e794153 100644 (file)
@@ -438,10 +438,10 @@ spinlock_t DRIVER_SMP_LOCK = SPIN_LOCK_UNLOCKED;
 #define        NCR_LOCK_NCB(np, flags)    spin_lock_irqsave(&np->smp_lock, flags)
 #define        NCR_UNLOCK_NCB(np, flags)  spin_unlock_irqrestore(&np->smp_lock, flags)
 
-#define        NCR_LOCK_SCSI_DONE(np, flags) \
-               spin_lock_irqsave(&io_request_lock, flags)
-#define        NCR_UNLOCK_SCSI_DONE(np, flags) \
-               spin_unlock_irqrestore(&io_request_lock, flags)
+#define        NCR_LOCK_SCSI_DONE(host, flags) \
+               spin_lock_irqsave(&(host)->host_lock, flags)
+#define        NCR_UNLOCK_SCSI_DONE(host, flags) \
+               spin_unlock_irqrestore(&((host)->host_lock), flags)
 
 #else
 
@@ -452,8 +452,8 @@ spinlock_t DRIVER_SMP_LOCK = SPIN_LOCK_UNLOCKED;
 #define        NCR_LOCK_NCB(np, flags)    do { save_flags(flags); cli(); } while (0)
 #define        NCR_UNLOCK_NCB(np, flags)  do { restore_flags(flags); } while (0)
 
-#define        NCR_LOCK_SCSI_DONE(np, flags)    do {;} while (0)
-#define        NCR_UNLOCK_SCSI_DONE(np, flags)  do {;} while (0)
+#define        NCR_LOCK_SCSI_DONE(host, flags)    do {;} while (0)
+#define        NCR_UNLOCK_SCSI_DONE(host, flags)  do {;} while (0)
 
 #endif
 
index 32655e4c16621d77fcbac855f9cffc067425c095..c778677958e836873a264ca0a6e60d9ffc539102 100644 (file)
@@ -134,7 +134,7 @@ static int timer_installed = -1;
 
 static int loaded;
 
-static int ad_format_mask[10 /*devc->model */ ] =
+static int ad_format_mask[13 /*devc->model */ ] =
 {
        0,
        AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW,
@@ -145,7 +145,10 @@ static int ad_format_mask[10 /*devc->model */ ] =
        AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
        AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
        AFMT_U8 | AFMT_S16_LE /* CS4235 */,
-       AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW        /* Ensoniq Soundscape*/
+       AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW        /* Ensoniq Soundscape*/,
+       AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
+       AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
+       AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM
 };
 
 static ad1848_info adev_info[MAX_AUDIO_DEV];
@@ -2965,6 +2968,10 @@ static struct {
                ISAPNP_ANY_ID, ISAPNP_ANY_ID,
                ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021),
                 1, 0, 0, 1, 1},
+       {"Advanced Gravis InterWave Audio",
+               ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
+               ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000),
+               0, 0, 0, 1, 0},
        {0}
 };
 
@@ -2977,6 +2984,8 @@ static struct isapnp_device_id id_table[] __devinitdata = {
                ISAPNP_VENDOR('C','S','C'), ISAPNP_FUNCTION(0x0100), 0 },
         {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
                ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021), 0 },
+       {       ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
+               ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000), 0 },
        {0}
 };
 
index f273e3d78109110620924f472d016f1606eb3c5e..b80cdf908130d336eb4660356ab455bb6060d424 100644 (file)
@@ -39,6 +39,7 @@
 #  include <linux/major.h>
 #  include <linux/fs.h>
 #  include <linux/sound.h>
+#  include <asm/segment.h>
 #  include "sound_config.h"
 #else
 #  include <linux/init.h>
index d0c82ded1abb015a7a23da93826359ef537e4bd9..1a66e3a8441d048172a8a9ae04444800b4d68d87 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/page.h>
 #include <asm/system.h>
 #ifdef __alpha__
+#include <asm/segment.h>
 #endif
 #include <linux/vmalloc.h>
 #include <asm/uaccess.h>
index 221214f4ec399c59fcb77fb397c28a4f5731e009..779036ab07123cad228d389b6f5310c20cbbd880 100644 (file)
@@ -377,6 +377,11 @@ static struct {
                ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
                0,0,0,0,
                0,1,1,-1},
+       {"Sound Blaster AWE 32",
+               ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0047),
+               ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
+               0,0,0,0,
+               0,1,1,-1},
        {"Sound Blaster AWE 32",
                ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0048), 
                ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
index 033ad12eb0bc16d36f9bd4adc1f44469ba87f349..9ca8765c792ef263b9192b0ddb61cca8fe3b7917 100644 (file)
@@ -1577,7 +1577,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
        struct nc_trailer       *trailer = 0;
 #endif /* CONFIG_USB_NET1080 */
 
-       flags = in_interrupt () ? GFP_ATOMIC : GFP_KERNEL;
+       flags = in_interrupt () ? GFP_ATOMIC : GFP_NOIO; /* might be used for nfs */
 
        // some devices want funky USB-level framing, for
        // win32 driver (usually) and/or hardware quirks
index 037979f5fc2c9be614f9a296c809ea002fc9bbfb..b04a2879c37c9ef9f4a4dbb7b25ba742e82a0e5f 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/tty.h>
 #include <linux/console.h>
index ed95451a91b27ae8742ee4a3a03441dba2f39632..db6ec7adfd1ad8577963fa333d5738892749cc09 100644 (file)
     20010730   Richard Gooch <rgooch@atnf.csiro.au>
               Added DEVFSD_NOTIFY_DELETE event.
     20010801   Richard Gooch <rgooch@atnf.csiro.au>
+              Removed #include <asm/segment.h>.
   v0.109
     20010807   Richard Gooch <rgooch@atnf.csiro.au>
               Fixed inode table races by removing it and using
index 4b88182354f80cfb19363082626f9f5c91a1a04e..847c9a200ea44a9562b138b27ebecd377aa74a18 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/uaccess.h>
 
 
+static void ext2_sync_super(struct super_block *sb,
+                           struct ext2_super_block *es);
 
 static char error_buf[1024];
 
@@ -36,13 +38,13 @@ void ext2_error (struct super_block * sb, const char * function,
                 const char * fmt, ...)
 {
        va_list args;
+       struct ext2_super_block *es = EXT2_SB(sb)->s_es;
 
        if (!(sb->s_flags & MS_RDONLY)) {
                sb->u.ext2_sb.s_mount_state |= EXT2_ERROR_FS;
-               sb->u.ext2_sb.s_es->s_state =
-                       cpu_to_le16(le16_to_cpu(sb->u.ext2_sb.s_es->s_state) | EXT2_ERROR_FS);
-               mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
-               sb->s_dirt = 1;
+               es->s_state =
+                       cpu_to_le16(le16_to_cpu(es->s_state) | EXT2_ERROR_FS);
+               ext2_sync_super(sb, es);
        }
        va_start (args, fmt);
        vsprintf (error_buf, fmt, args);
@@ -125,8 +127,10 @@ void ext2_put_super (struct super_block * sb)
        int i;
 
        if (!(sb->s_flags & MS_RDONLY)) {
-               sb->u.ext2_sb.s_es->s_state = le16_to_cpu(sb->u.ext2_sb.s_mount_state);
-               mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
+               struct ext2_super_block *es = EXT2_SB(sb)->s_es;
+
+               es->s_state = le16_to_cpu(EXT2_SB(sb)->s_mount_state);
+               ext2_sync_super(sb, es);
        }
        db_count = EXT2_SB(sb)->s_gdb_count;
        for (i = 0; i < db_count; i++)
@@ -306,13 +310,10 @@ static int ext2_setup_super (struct super_block * sb,
                (le32_to_cpu(es->s_lastcheck) + le32_to_cpu(es->s_checkinterval) <= CURRENT_TIME))
                printk ("EXT2-fs warning: checktime reached, "
                        "running e2fsck is recommended\n");
-       es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) & ~EXT2_VALID_FS);
        if (!(__s16) le16_to_cpu(es->s_max_mnt_count))
                es->s_max_mnt_count = (__s16) cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
        es->s_mnt_count=cpu_to_le16(le16_to_cpu(es->s_mnt_count) + 1);
-       es->s_mtime = cpu_to_le32(CURRENT_TIME);
-       mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
-       sb->s_dirt = 1;
+       ext2_write_super(sb);
        if (test_opt (sb, DEBUG))
                printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, "
                        "bpg=%lu, ipg=%lu, mo=%04lx]\n",
@@ -659,6 +660,15 @@ static void ext2_commit_super (struct super_block * sb,
        sb->s_dirt = 0;
 }
 
+static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es)
+{
+       es->s_wtime = cpu_to_le32(CURRENT_TIME);
+       mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
+       ll_rw_block(WRITE, 1, &EXT2_SB(sb)->s_sbh);
+       wait_on_buffer(EXT2_SB(sb)->s_sbh);
+       sb->s_dirt = 0;
+}
+
 /*
  * In the second extended file system, it is not necessary to
  * write the super block since we use a mapping of the
@@ -677,13 +687,14 @@ void ext2_write_super (struct super_block * sb)
        if (!(sb->s_flags & MS_RDONLY)) {
                es = sb->u.ext2_sb.s_es;
 
-               ext2_debug ("setting valid to 0\n");
-
                if (le16_to_cpu(es->s_state) & EXT2_VALID_FS) {
-                       es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) & ~EXT2_VALID_FS);
+                       ext2_debug ("setting valid to 0\n");
+                       es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) &
+                                                 ~EXT2_VALID_FS);
                        es->s_mtime = cpu_to_le32(CURRENT_TIME);
-               }
-               ext2_commit_super (sb, es);
+                       ext2_sync_super(sb, es);
+               } else
+                       ext2_commit_super (sb, es);
        }
        sb->s_dirt = 0;
 }
@@ -720,11 +731,7 @@ int ext2_remount (struct super_block * sb, int * flags, char * data)
                 */
                es->s_state = cpu_to_le16(sb->u.ext2_sb.s_mount_state);
                es->s_mtime = cpu_to_le32(CURRENT_TIME);
-               mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
-               sb->s_dirt = 1;
-               ext2_commit_super (sb, es);
-       }
-       else {
+       } else {
                int ret;
                if ((ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
                                               ~EXT2_FEATURE_RO_COMPAT_SUPP))) {
@@ -742,6 +749,7 @@ int ext2_remount (struct super_block * sb, int * flags, char * data)
                if (!ext2_setup_super (sb, es, 0))
                        sb->s_flags &= ~MS_RDONLY;
        }
+       ext2_sync_super(sb, es);
        return 0;
 }
 
index c64318e79abcb66883dfa1dd369d349afc36580d..68cb4861815cf049fba2d06982bf99495d0501c4 100644 (file)
@@ -9,7 +9,7 @@
 
 O_TARGET := ext3.o
 
-obj-y    := acl.o balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
+obj-y    := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
                ioctl.o namei.o super.o symlink.o
 obj-m    := $(O_TARGET)
 
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
deleted file mode 100644 (file)
index f77d420..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * linux/fs/ext3/acl.c
- *
- * Copyright (C) 1993, 1994, 1995
- * Remy Card (card@masi.ibp.fr)
- * Laboratoire MASI - Institut Blaise Pascal
- * Universite Pierre et Marie Curie (Paris VI)
- */
-
-#include <linux/fs.h>
-#include <linux/sched.h>
-
-
-/*
- * This file will contain the Access Control Lists management for the
- * second extended file system.
- */
index 339ba65333c1072dfa4c7968ad1f792334ed5a49..e0ad97fe37124d179e5bbd6838757e02a2d77f12 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/quotaops.h>
 #include <linux/module.h>
 
-
 /*
  * SEARCH_FROM_ZERO forces each block allocation to search from the start
  * of the filesystem.  This is to force rapid reallocation of recently-freed
@@ -715,6 +714,8 @@ err_out:
  * reachable from inode.
  *
  * akpm: `handle' can be NULL if create == 0.
+ *
+ * The BKL may not be held on entry here.  Be sure to take it early.
  */
 
 static int ext3_get_block_handle(handle_t *handle, struct inode *inode, 
@@ -1018,13 +1019,26 @@ static int ext3_prepare_write(struct file *file, struct page *page,
                ret = PTR_ERR(handle);
                goto out;
        }
+       unlock_kernel();
        ret = block_prepare_write(page, from, to, ext3_get_block);
+       lock_kernel();
        if (ret != 0)
                goto prepare_write_failed;
 
-       if (ext3_should_journal_data(inode))
+       if (ext3_should_journal_data(inode)) {
                ret = walk_page_buffers(handle, page->buffers,
                                from, to, NULL, do_journal_get_write_access);
+               if (ret) {
+                       /*
+                        * We're going to fail this prepare_write(),
+                        * so commit_write() will not be called.
+                        * We need to undo block_prepare_write()'s kmap().
+                        * AKPM: Do we need to clear PageUptodate?  I don't
+                        * think so.
+                        */
+                       kunmap(page);
+               }
+       }
 prepare_write_failed:
        if (ret)
                ext3_journal_stop(handle, inode);
@@ -1092,7 +1106,7 @@ static int ext3_commit_write(struct file *file, struct page *page,
                kunmap(page);
                if (pos > inode->i_size)
                        inode->i_size = pos;
-               set_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state);
+               EXT3_I(inode)->i_state |= EXT3_STATE_JDATA;
        } else {
                if (ext3_should_order_data(inode)) {
                        ret = walk_page_buffers(handle, page->buffers,
@@ -1100,8 +1114,17 @@ static int ext3_commit_write(struct file *file, struct page *page,
                }
                /* Be careful here if generic_commit_write becomes a
                 * required invocation after block_prepare_write. */
-               if (ret == 0)
+               if (ret == 0) {
                        ret = generic_commit_write(file, page, from, to);
+               } else {
+                       /*
+                        * block_prepare_write() was called, but we're not
+                        * going to call generic_commit_write().  So we
+                        * need to perform generic_commit_write()'s kunmap
+                        * by hand.
+                        */
+                       kunmap(page);
+               }
        }
        if (inode->i_size > inode->u.ext3_i.i_disksize) {
                inode->u.ext3_i.i_disksize = inode->i_size;
@@ -1136,7 +1159,7 @@ static int ext3_bmap(struct address_space *mapping, long block)
        journal_t *journal;
        int err;
        
-       if (test_and_clear_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state)) {
+       if (EXT3_I(inode)->i_state & EXT3_STATE_JDATA) {
                /* 
                 * This is a REALLY heavyweight approach, but the use of
                 * bmap on dirty files is expected to be extremely rare:
@@ -1155,6 +1178,7 @@ static int ext3_bmap(struct address_space *mapping, long block)
                 * everything they get.
                 */
                
+               EXT3_I(inode)->i_state &= ~EXT3_STATE_JDATA;
                journal = EXT3_JOURNAL(inode);
                journal_lock_updates(journal);
                err = journal_flush(journal);
@@ -2195,7 +2219,7 @@ static int ext3_do_update_inode(handle_t *handle,
        /* If we are not tracking these fields in the in-memory inode,
         * then preserve them on disk, but still initialise them to zero
         * for new inodes. */
-       if (inode->u.ext3_i.i_state & EXT3_STATE_NEW) {
+       if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) {
                raw_inode->i_faddr = 0;
                raw_inode->i_frag = 0;
                raw_inode->i_fsize = 0;
@@ -2241,7 +2265,7 @@ static int ext3_do_update_inode(handle_t *handle,
        rc = ext3_journal_dirty_metadata(handle, bh);
        if (!err)
                err = rc;
-       inode->u.ext3_i.i_state &= ~EXT3_STATE_NEW;
+       EXT3_I(inode)->i_state &= ~EXT3_STATE_NEW;
 
 out_brelse:
        brelse (bh);
@@ -2325,12 +2349,20 @@ void ext3_write_inode(struct inode *inode, int wait)
 int ext3_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
-       int error, rc;
+       int error, rc = 0;
+       const unsigned int ia_valid = attr->ia_valid;
 
        error = inode_change_ok(inode, attr);
        if (error)
                return error;
-       
+
+       if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+               (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
+               error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
+               if (error)
+                       return error;
+       }
+
        if (attr->ia_valid & ATTR_SIZE && attr->ia_size < inode->i_size) {
                handle_t *handle;
 
@@ -2348,7 +2380,7 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
                ext3_journal_stop(handle, inode);
        }
        
-       inode_setattr(inode, attr);
+       rc = inode_setattr(inode, attr);
 
        /* If inode_setattr's call to ext3_truncate failed to get a
         * transaction handle at all, we need to clean up the in-core
@@ -2358,7 +2390,9 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
 
 err_out:
        ext3_std_error(inode->i_sb, error);
-       return 0;
+       if (!error)
+               error = rc;
+       return error;
 }
 
 
@@ -2659,6 +2693,3 @@ int ext3_change_inode_journal_flag(struct inode *inode, int val)
  * here, in ext3_aops_journal_start() to ensure that the forthcoming "see if we
  * need to extend" test in ext3_prepare_write() succeeds.  
  */
-
-
-MODULE_LICENSE("GPL");
index fd82ddc4f473729dc92d3b02165e617f34fac880..5a0282393f779215ff35600d3ed9f77b0cf4677d 100644 (file)
@@ -1250,8 +1250,11 @@ static journal_t *ext3_get_journal(struct super_block *sb, int journal_inum)
        }
 
        journal = journal_init_inode(journal_inode);
-       if (!journal)
+       if (!journal) {
+               printk(KERN_ERR "EXT3-fs: Could not load journal inode\n");
                iput(journal_inode);
+       }
+       
        return journal;
 }
 
@@ -1343,7 +1346,7 @@ static int ext3_load_journal(struct super_block * sb,
        journal_t *journal;
        int journal_inum = le32_to_cpu(es->s_journal_inum);
        int journal_dev = le32_to_cpu(es->s_journal_dev);
-       int err;
+       int err = 0;
        int really_read_only;
 
        really_read_only = is_read_only(sb->s_dev);
@@ -1393,9 +1396,10 @@ static int ext3_load_journal(struct super_block * sb,
        }
 
        if (!EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER))
-               journal_wipe(journal, !really_read_only);
+               err = journal_wipe(journal, !really_read_only);
+       if (!err)
+               err = journal_load(journal);
 
-       err = journal_load(journal);
        if (err) {
                printk(KERN_ERR "EXT3-fs: error loading journal.\n");
                journal_destroy(journal);
@@ -1733,6 +1737,8 @@ static void __exit exit_ext3_fs(void)
 
 EXPORT_NO_SYMBOLS;
 
+MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
 MODULE_LICENSE("GPL");
 module_init(init_ext3_fs)
 module_exit(exit_ext3_fs)
index 67182fa45aa9486af0eb518dc93819757643d8ba..891b3bbf2582552b995596214c099110f08778b4 100644 (file)
@@ -19,3 +19,4 @@ EXPORT_SYMBOL(zlib_fs_inflateSync);
 EXPORT_SYMBOL(zlib_fs_inflateReset);
 EXPORT_SYMBOL(zlib_fs_adler32);
 EXPORT_SYMBOL(zlib_fs_inflateSyncPoint);
+MODULE_LICENSE("GPL");
index 1a9eae8db57207d1b7c1636eb6b6c9acae8ef7dd..8464b2618cd4da1624a02d3106519ba0b4f1b509 100644 (file)
@@ -344,7 +344,7 @@ static ssize_t presto_file_write(struct file *file, const char *buf, size_t size
                 << file->f_dentry->d_inode->i_sb->s_blocksize_bits);
 
         error = presto_reserve_space(fset->fset_cache, res_size); 
-        CDEBUG(D_INODE, "Reserved %Ld for %d\n", res_size, size); 
+        CDEBUG(D_INODE, "Reserved %Ld for %Zd\n", res_size, size); 
         if ( error ) { 
                 EXIT;
                 return -ENOSPC;
@@ -397,7 +397,7 @@ static ssize_t presto_file_write(struct file *file, const char *buf, size_t size
         fops = filter_c2cffops(cache->cache_filter);
         res = fops->write(file, buf, size, off);
         if ( res != size ) {
-                CDEBUG(D_FILE, "file write returns short write: size %d, res %d\n", size, res); 
+                CDEBUG(D_FILE, "file write returns short write: size %Zd, res %Zd\n", size, res); 
         }
 
         if ( (res > 0) && fdata ) 
index 11013f39672e5af212ee8019e0e2bd87b808cb9c..df8f31533479365e54d1f4df3ab52ffa6be08528 100644 (file)
@@ -1076,7 +1076,7 @@ int presto_clear_lml_close(struct presto_file_set *fset,
                 return 0;
         }
 
-        CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %d\n", 
+        CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %Zd\n", 
                (long)lml_offset, sizeof(record));
         rc = presto_fread(fset->fset_lml.fd_file, (char *)&record,
                           sizeof(record), &offset);
index 7c08b39340faaec0b45d7b20c0d2b4b19378f47f..9fdfedc226bb48bc31bcfb849e18f54d8014881e 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/poll.h>
 #include <linux/init.h>
 #include <linux/list.h>
+#include <linux/termios.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/poll.h>
@@ -176,7 +177,7 @@ static ssize_t presto_psdev_write(struct file *file, const char *buf,
 
         /* move data into response buffer. */
         if (req->rq_bufsize < count) {
-                printk("psdev_write: too much cnt: %d, cnt: %d, "
+                printk("psdev_write: too much cnt: %d, cnt: %Zd, "
                        "opc: %d, uniq: %d.\n",
                        req->rq_bufsize, count, hdr.opcode, hdr.unique);
                 count = req->rq_bufsize; /* don't have more space! */
@@ -209,7 +210,7 @@ static ssize_t presto_psdev_read(struct file * file, char * buf,
                        __FUNCTION__, kdevname(dev));
         }
 
-        CDEBUG(D_PSDEV, "count %d\n", count);
+        CDEBUG(D_PSDEV, "count %Zd\n", count);
         if (list_empty(&(upccom->uc_pending))) {
                 CDEBUG(D_UPCALL, "Empty pending list in read, not good\n");
                 return -EINVAL;
@@ -228,7 +229,7 @@ static ssize_t presto_psdev_read(struct file * file, char * buf,
         }
 
         if (count < req->rq_bufsize) {
-                printk ("psdev_read: buffer too small, read %d of %d bytes\n",
+                printk ("psdev_read: buffer too small, read %Zd of %d bytes\n",
                         count, req->rq_bufsize);
         }
 
@@ -281,7 +282,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file,
                 error = copy_from_user(&readmount, (void *)arg,
                                        sizeof(readmount));
                 if ( error )  {
-                        printk("psdev: can't copy %d bytes from %p to %p\n",
+                        printk("psdev: can't copy %Zd bytes from %p to %p\n",
                                 sizeof(readmount), (struct readmount *) arg,
                                 &readmount);
                         EXIT;
@@ -469,7 +470,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file,
                 input.size = size;
                 upccom->uc_pid = saved_pid;
 
-                CDEBUG(D_PSDEV, "get_kmlsize: size = %d\n", size);
+                CDEBUG(D_PSDEV, "get_kmlsize: size = %Zd\n", size);
 
                 EXIT;
                 return copy_to_user((char *)arg, &input, sizeof(input));
@@ -621,7 +622,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file,
 
                 error = copy_from_user(&kopt, (void *)arg, sizeof(kopt));
                 if ( error )  {
-                        printk("psdev: can't copyin %d bytes from %p to %p\n",
+                        printk("psdev: can't copyin %Zd bytes from %p to %p\n",
                                sizeof(kopt), (struct kopt *) arg, &kopt);
                         EXIT;
                         return error;
@@ -1244,7 +1245,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file,
         
         default:
                 CDEBUG(D_PSDEV, "bad ioctl 0x%x, \n", cmd);
-                CDEBUG(D_PSDEV, "valid are 0x%x - 0x%x, 0x%x - 0x%x \n",
+                CDEBUG(D_PSDEV, "valid are 0x%Zx - 0x%Zx, 0x%Zx - 0x%Zx \n",
                         PRESTO_GETMOUNT, PRESTO_GET_KMLSIZE,
                         PRESTO_VFS_SETATTR, PRESTO_VFS_IOPEN);
                 EXIT;
@@ -1571,8 +1572,8 @@ int lento_upcall(int minor, int bufsize, int *rep_size, union up_args *buffer,
                req->rq_opcode, jiffies - req->rq_posttime,
                req->rq_unique, req->rq_rep_size);
         CDEBUG(D_UPCALL,
-               "..process %d woken up by Lento for req at 0x%x, data at %x\n",
-               current->pid, (int)req, (int)req->rq_data);
+               "..process %d woken up by Lento for req at 0x%p, data at %p\n",
+               current->pid, req, req->rq_data);
 
         if (upc_commp->uc_pid) {      /* i.e. Lento is still alive */
           /* Op went through, interrupt or not we go on */
index 045b74ce9a8e0d1211b00c1d5b3ff306e37ded17..29e96b885f62f82780054c5b6b6aba58794ec516 100644 (file)
@@ -47,7 +47,8 @@ void journal_commit_transaction(journal_t *journal)
        struct buffer_head *wbuf[64];
        int bufs;
        int flags;
-       int blocknr;
+       int err;
+       unsigned long blocknr;
        char *tagp = NULL;
        journal_header_t *header;
        journal_block_tag_t *tag = NULL;
@@ -352,6 +353,11 @@ sync_datalist_empty:
                        jbd_debug(4, "JBD: get descriptor\n");
 
                        descriptor = journal_get_descriptor_buffer(journal);
+                       if (!descriptor) {
+                               __journal_abort_hard(journal);
+                               continue;
+                       }
+                       
                        bh = jh2bh(descriptor);
                        jbd_debug(4, "JBD: got buffer %ld (%p)\n",
                                bh->b_blocknr, bh->b_data);
@@ -375,7 +381,14 @@ sync_datalist_empty:
 
                /* Where is the buffer to be written? */
 
-               blocknr = journal_next_log_block(journal);
+               err = journal_next_log_block(journal, &blocknr);
+               /* If the block mapping failed, just abandon the buffer
+                  and repeat this loop: we'll fall into the
+                  refile-on-abort condition above. */
+               if (err) {
+                       __journal_abort_hard(journal);
+                       continue;
+               }
 
                /* Bump b_count to prevent truncate from stumbling over
                    the shadowed buffer!  @@@ This can go if we ever get
@@ -554,16 +567,20 @@ start_journal_io:
 
        jbd_debug(3, "JBD: commit phase 6\n");
 
+       if (is_journal_aborted(journal))
+               goto skip_commit;
+
        /* Done it all: now write the commit record.  We should have
         * cleaned up our previous buffers by now, so if we are in abort
         * mode we can now just skip the rest of the journal write
         * entirely. */
 
-       if (is_journal_aborted(journal))
-               goto skip_commit;
-
        descriptor = journal_get_descriptor_buffer(journal);
-
+       if (!descriptor) {
+               __journal_abort_hard(journal);
+               goto skip_commit;
+       }
+       
        /* AKPM: buglet - add `i' to tmp! */
        for (i = 0; i < jh2bh(descriptor)->b_size; i += 512) {
                journal_header_t *tmp =
index 2b86b94c7d9aab7a14a5ff07b78e800c7d6cee08..cf381d4fad0f4fde8e9de7a88791bffe69ee25fd 100644 (file)
@@ -70,7 +70,6 @@ EXPORT_SYMBOL(journal_load);
 EXPORT_SYMBOL(journal_destroy);
 EXPORT_SYMBOL(journal_recover);
 EXPORT_SYMBOL(journal_update_superblock);
-EXPORT_SYMBOL(__journal_abort);
 EXPORT_SYMBOL(journal_abort);
 EXPORT_SYMBOL(journal_errno);
 EXPORT_SYMBOL(journal_ack_err);
@@ -606,7 +605,7 @@ void log_wait_commit (journal_t *journal, tid_t tid)
  * Log buffer allocation routines:
  */
 
-unsigned long journal_next_log_block(journal_t *journal)
+int journal_next_log_block(journal_t *journal, unsigned long *retp)
 {
        unsigned long blocknr;
 
@@ -617,7 +616,7 @@ unsigned long journal_next_log_block(journal_t *journal)
        journal->j_free--;
        if (journal->j_head == journal->j_last)
                journal->j_head = journal->j_first;
-       return journal_bmap(journal, blocknr);
+       return journal_bmap(journal, blocknr, retp);
 }
 
 /*
@@ -627,17 +626,28 @@ unsigned long journal_next_log_block(journal_t *journal)
  * this is a no-op.  If needed, we can use j_blk_offset - everything is
  * ready.
  */
-unsigned long journal_bmap(journal_t *journal, unsigned long blocknr)
+int journal_bmap(journal_t *journal, unsigned long blocknr, 
+                unsigned long *retp)
 {
+       int err = 0;
        unsigned long ret;
 
        if (journal->j_inode) {
                ret = bmap(journal->j_inode, blocknr);
-               J_ASSERT(ret != 0);
+               if (ret)
+                       *retp = ret;
+               else {
+                       printk (KERN_ALERT __FUNCTION__ 
+                               ": journal block not found "
+                               "at offset %lu on %s\n",
+                               blocknr, bdevname(journal->j_dev));
+                       err = -EIO;
+                       __journal_abort_soft(journal, err);
+               }
        } else {
-               ret = blocknr;   /* +journal->j_blk_offset */
+               *retp = blocknr; /* +journal->j_blk_offset */
        }
-       return ret;
+       return err;
 }
 
 /*
@@ -649,7 +659,13 @@ unsigned long journal_bmap(journal_t *journal, unsigned long blocknr)
 struct journal_head * journal_get_descriptor_buffer(journal_t *journal)
 {
        struct buffer_head *bh;
-       unsigned long blocknr = journal_next_log_block(journal);
+       unsigned long blocknr;
+       int err;
+
+       err = journal_next_log_block(journal, &blocknr);
+
+       if (err)
+               return NULL;
 
        bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
        bh->b_state |= (1 << BH_Dirty);
@@ -747,7 +763,8 @@ journal_t * journal_init_inode (struct inode *inode)
 {
        struct buffer_head *bh;
        journal_t *journal = journal_init_common();
-       int blocknr;
+       int err;
+       unsigned long blocknr;
 
        if (!journal)
                return NULL;
@@ -757,13 +774,22 @@ journal_t * journal_init_inode (struct inode *inode)
        journal->j_inode = inode;
        jbd_debug(1,
                  "journal %p: inode %s/%ld, size %Ld, bits %d, blksize %ld\n",
-                 journal, bdevname(inode->i_dev), inode->i_ino, inode->i_size,
+                 journal, bdevname(inode->i_dev), inode->i_ino, 
+                 (long long) inode->i_size,
                  inode->i_sb->s_blocksize_bits, inode->i_sb->s_blocksize);
 
        journal->j_maxlen = inode->i_size >> inode->i_sb->s_blocksize_bits;
        journal->j_blocksize = inode->i_sb->s_blocksize;
 
-       blocknr = journal_bmap(journal, 0);
+       err = journal_bmap(journal, 0, &blocknr);
+       /* If that failed, give up */
+       if (err) {
+               printk(KERN_ERR __FUNCTION__ ": Cannnot locate journal "
+                      "superblock\n");
+               kfree(journal);
+               return NULL;
+       }
+       
        bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
        J_ASSERT(bh != NULL);
        journal->j_sb_buffer = bh;
@@ -772,6 +798,18 @@ journal_t * journal_init_inode (struct inode *inode)
        return journal;
 }
 
+/* 
+ * If the journal init or create aborts, we need to mark the journal
+ * superblock as being NULL to prevent the journal destroy from writing
+ * back a bogus superblock. 
+ */
+static void journal_fail_superblock (journal_t *journal)
+{
+       struct buffer_head *bh = journal->j_sb_buffer;
+       brelse(bh);
+       journal->j_sb_buffer = NULL;
+}
+
 /*
  * Given a journal_t structure, initialise the various fields for
  * startup of a new journaling session.  We use this both when creating
@@ -817,14 +855,15 @@ static int journal_reset (journal_t *journal)
 
 int journal_create (journal_t *journal)
 {
-       int blocknr;
+       unsigned long blocknr;
        struct buffer_head *bh;
        journal_superblock_t *sb;
-       int i;
+       int i, err;
 
        if (journal->j_maxlen < JFS_MIN_JOURNAL_BLOCKS) {
                printk (KERN_ERR "Journal length (%d blocks) too short.\n",
                        journal->j_maxlen);
+               journal_fail_superblock(journal);
                return -EINVAL;
        }
 
@@ -841,7 +880,9 @@ int journal_create (journal_t *journal)
           have any blocks on disk beginning with JFS_MAGIC_NUMBER. */
        jbd_debug(1, "JBD: Zeroing out journal blocks...\n");
        for (i = 0; i < journal->j_maxlen; i++) {
-               blocknr = journal_bmap(journal, i);
+               err = journal_bmap(journal, i, &blocknr);
+               if (err)
+                       return err;
                bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
                wait_on_buffer(bh);
                memset (bh->b_data, 0, journal->j_blocksize);
@@ -851,6 +892,7 @@ int journal_create (journal_t *journal)
                mark_buffer_uptodate(bh, 1);
                __brelse(bh);
        }
+
        sync_dev(journal->j_dev);
        jbd_debug(1, "JBD: journal cleared.\n");
 
@@ -915,7 +957,8 @@ static int journal_get_superblock(journal_t *journal)
 {
        struct buffer_head *bh;
        journal_superblock_t *sb;
-
+       int err = -EIO;
+       
        bh = journal->j_sb_buffer;
 
        J_ASSERT(bh != NULL);
@@ -925,16 +968,18 @@ static int journal_get_superblock(journal_t *journal)
                if (!buffer_uptodate(bh)) {
                        printk (KERN_ERR
                                "JBD: IO error reading journal superblock\n");
-                       return -EIO;
+                       goto out;
                }
        }
 
        sb = journal->j_superblock;
 
+       err = -EINVAL;
+       
        if (sb->s_header.h_magic != htonl(JFS_MAGIC_NUMBER) ||
            sb->s_blocksize != htonl(journal->j_blocksize)) {
                printk(KERN_WARNING "JBD: no valid journal superblock found\n");
-               return -EINVAL;
+               goto out;
        }
 
        switch(ntohl(sb->s_header.h_blocktype)) {
@@ -946,17 +991,21 @@ static int journal_get_superblock(journal_t *journal)
                break;
        default:
                printk(KERN_WARNING "JBD: unrecognised superblock format ID\n");
-               return -EINVAL;
+               goto out;
        }
 
        if (ntohl(sb->s_maxlen) < journal->j_maxlen)
                journal->j_maxlen = ntohl(sb->s_maxlen);
        else if (ntohl(sb->s_maxlen) > journal->j_maxlen) {
                printk (KERN_WARNING "JBD: journal file too short\n");
-               return -EINVAL;
+               goto out;
        }
 
        return 0;
+
+out:
+       journal_fail_superblock(journal);
+       return err;
 }
 
 /*
@@ -1061,7 +1110,10 @@ void journal_destroy (journal_t *journal)
        /* We can now mark the journal as empty. */
        journal->j_tail = 0;
        journal->j_tail_sequence = ++journal->j_transaction_sequence;
-       journal_update_superblock(journal, 1);
+       if (journal->j_sb_buffer) {
+               journal_update_superblock(journal, 1);
+               brelse(journal->j_sb_buffer);
+       }
 
        if (journal->j_inode)
                iput(journal->j_inode);
@@ -1069,7 +1121,6 @@ void journal_destroy (journal_t *journal)
                journal_destroy_revoke(journal);
 
        unlock_journal(journal);
-       brelse(journal->j_sb_buffer);
        kfree(journal);
        MOD_DEC_USE_COUNT;
 }
@@ -1356,11 +1407,16 @@ const char * journal_dev_name(journal_t *journal)
  * progress).
  */
 
-/* Quick version for internal journal use (doesn't lock the journal) */
-void __journal_abort (journal_t *journal)
+/* Quick version for internal journal use (doesn't lock the journal).
+ * Aborts hard --- we mark the abort as occurred, but do _nothing_ else,
+ * and don't attempt to make any other journal updates. */
+void __journal_abort_hard (journal_t *journal)
 {
        transaction_t *transaction;
 
+       if (journal->j_flags & JFS_ABORT)
+               return;
+
        printk (KERN_ERR "Aborting journal on device %s.\n",
                journal_dev_name(journal));
 
@@ -1370,23 +1426,27 @@ void __journal_abort (journal_t *journal)
                log_start_commit(journal, transaction);
 }
 
-/* Full version for external use */
-void journal_abort (journal_t *journal, int errno)
+/* Soft abort: record the abort error status in the journal superblock,
+ * but don't do any other IO. */
+void __journal_abort_soft (journal_t *journal, int errno)
 {
-       lock_journal(journal);
-
        if (journal->j_flags & JFS_ABORT)
-               goto out;
+               return;
 
        if (!journal->j_errno)
                journal->j_errno = errno;
 
-       __journal_abort(journal);
+       __journal_abort_hard(journal);
 
        if (errno)
                journal_update_superblock(journal, 1);
+}
 
- out:
+/* Full version for external use */
+void journal_abort (journal_t *journal, int errno)
+{
+       lock_journal(journal);
+       __journal_abort_soft(journal, errno);
        unlock_journal(journal);
 }
 
index 491dc6cb6dc8338c5e20d970e2239dba7c74003b..e8e416306aed8fdb62109757c5aab5c3e7f35877 100644 (file)
@@ -70,7 +70,8 @@ void journal_brelse_array(struct buffer_head *b[], int n)
 static int do_readahead(journal_t *journal, unsigned int start)
 {
        int err;
-       unsigned int max, nbufs, next, blocknr;
+       unsigned int max, nbufs, next;
+       unsigned long blocknr;
        struct buffer_head *bh;
        
        struct buffer_head * bufs[MAXBUF];
@@ -86,12 +87,11 @@ static int do_readahead(journal_t *journal, unsigned int start)
        nbufs = 0;
        
        for (next = start; next < max; next++) {
-               blocknr = journal_bmap(journal, next);
+               err = journal_bmap(journal, next, &blocknr);
 
-               if (!blocknr) {
+               if (err) {
                        printk (KERN_ERR "JBD: bad block at offset %u\n",
                                next);
-                       err = -EIO;
                        goto failed;
                }
 
@@ -132,19 +132,20 @@ failed:
 static int jread(struct buffer_head **bhp, journal_t *journal, 
                 unsigned int offset)
 {
-       unsigned int blocknr;
+       int err;
+       unsigned long blocknr;
        struct buffer_head *bh;
 
        *bhp = NULL;
 
        J_ASSERT (offset < journal->j_maxlen);
        
-       blocknr = journal_bmap(journal, offset);
+       err = journal_bmap(journal, offset, &blocknr);
 
-       if (!blocknr) {
+       if (err) {
                printk (KERN_ERR "JBD: bad block at offset %u\n",
                        offset);
-               return -EIO;
+               return err;
        }
 
        bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
index 8feb8aae82a12757dcb59fdc4365195babd02d3e..01b7684e94724a5a5d4efe4816190008f827df53 100644 (file)
@@ -495,6 +495,8 @@ static void write_one_revoke_record(journal_t *journal,
        
        if (!descriptor) {
                descriptor = journal_get_descriptor_buffer(journal);
+               if (!descriptor)
+                       return;
                header = (journal_header_t *) &jh2bh(descriptor)->b_data[0];
                header->h_magic     = htonl(JFS_MAGIC_NUMBER);
                header->h_blocktype = htonl(JFS_REVOKE_BLOCK);
index a254c2ce353638584c12fce94ea67aab07d4abb3..10b54892de6ac21510d26c81ea7c24e1699faada 100644 (file)
@@ -1058,21 +1058,6 @@ int journal_dirty_data (handle_t *handle, struct buffer_head *bh, int async)
                JBUFFER_TRACE(jh, "not on a transaction");
                __journal_file_buffer(jh, handle->h_transaction, wanted_jlist);
        }
-       /*
-        * We need to mark the buffer dirty and refile it inside the lock to
-        * protect it from release by journal_try_to_free_buffer()
-        *
-        * We set ->b_flushtime to something small enough to typically keep
-        * kupdate away from the buffer.
-        *
-        * We don't need to do a balance_dirty() - __block_commit_write()
-        * does that.
-        */
-       if (!async && !atomic_set_buffer_dirty(jh2bh(jh))) {
-               jh2bh(jh)->b_flushtime =
-                       jiffies + journal->j_commit_interval + 1 * HZ;
-               refile_buffer(jh2bh(jh));
-       }
 no_journal:
        spin_unlock(&journal_datalist_lock);
        if (need_brelse) {
@@ -1604,8 +1589,6 @@ static int __journal_try_to_free_buffer(struct buffer_head *bh,
 
        assert_spin_locked(&journal_datalist_lock);
 
-       if (!buffer_jbd(bh))
-               return 1;
        jh = bh2jh(bh);
 
        if (buffer_locked(bh) || buffer_dirty(bh)) {
index b55585988875839cd15722f8b8e72e92a4207c8f..42fd4f97ceb26dbfa1168070df79aee8fb9b88e2 100644 (file)
@@ -208,7 +208,7 @@ static struct super_block *minix_read_super(struct super_block *s, void *data,
        /* set up enough so that it can read an inode */
        s->s_op = &minix_sops;
        root_inode = iget(s, MINIX_ROOT_INO);
-       if (!root_inode)
+       if (!root_inode || is_bad_inode(root_inode))
                goto out_no_root;
 
        s->s_root = d_alloc_root(root_inode);
@@ -347,8 +347,10 @@ static void V1_minix_read_inode(struct inode * inode)
        int i;
 
        raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh);
-       if (!raw_inode)
+       if (!raw_inode) {
+               make_bad_inode(inode);
                return;
+       }
        inode->i_mode = raw_inode->i_mode;
        inode->i_uid = (uid_t)raw_inode->i_uid;
        inode->i_gid = (gid_t)raw_inode->i_gid;
@@ -372,8 +374,10 @@ static void V2_minix_read_inode(struct inode * inode)
        int i;
 
        raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh);
-       if (!raw_inode)
+       if (!raw_inode) {
+               make_bad_inode(inode);
                return;
+       }
        inode->i_mode = raw_inode->i_mode;
        inode->i_uid = (uid_t)raw_inode->i_uid;
        inode->i_gid = (gid_t)raw_inode->i_gid;
index 7b578f00fe748905b0a265a55e1c89d2c0785a6d..38b2e0d6c70a01f9f8d056e21343fcee8e3c9723 100644 (file)
@@ -40,3 +40,4 @@ static void __exit exit_msdos_fs(void)
 
 module_init(init_msdos_fs)
 module_exit(exit_msdos_fs)
+MODULE_LICENSE("GPL");
index b9e0236548828e8f4c8fb2a4038aa51df41b2f00..093ed8ef6dcfd9086255775fd4266fb1637a2774 100644 (file)
@@ -24,6 +24,7 @@
 struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
 int do_remount_sb(struct super_block *sb, int flags, void * data);
 void kill_super(struct super_block *sb);
+int __init init_rootfs(void);
 
 static struct list_head *mount_hashtable;
 static int hash_mask, hash_bits;
index 399e917d9d2a895efc4e082ee3194cb686982dc5..5066d29b51014174ee968e391484a6bb99aef2cb 100644 (file)
@@ -1,3 +1,12 @@
+Sat Dec 15 2001  Christoph Hellwig  <hch@caldera.de>
+
+       * inode.c (sysv_read_inode): Mark inode as bad in case of failure.
+       * super.c (complete_read_super): Check for bad root inode.
+
+Wed Nov 21 2001  Andrew Morton  <andrewm@uow.edu.au>
+
+       * file.c (sysv_sync_file): Call fsync_inode_data_buffers.
+
 Fri Oct 26 2001  Christoph Hellwig  <hch@caldera.de>
 
        * dir.c, ialloc.c, namei.c, include/linux/sysv_fs_i.h:
index 6233aecba88a76b2650f67eee5f8ec4a2a8ed817..d1ee3e89567d699982e6b662543bc37f4214c998 100644 (file)
@@ -152,13 +152,13 @@ static void sysv_read_inode(struct inode *inode)
                printk("Bad inode number on dev %s"
                       ": %d is out of range\n",
                       kdevname(inode->i_dev), ino);
-               return;
+               goto bad_inode;
        }
        raw_inode = sysv_raw_inode(sb, ino, &bh);
        if (!raw_inode) {
                printk("Major problem: unable to read inode from dev %s\n",
                       bdevname(inode->i_dev));
-               return;
+               goto bad_inode;
        }
        /* SystemV FS: kludge permissions if ino==SYSV_ROOT_INO ?? */
        inode->i_mode = fs16_to_cpu(sb, raw_inode->i_mode);
@@ -178,6 +178,11 @@ static void sysv_read_inode(struct inode *inode)
                rdev = (u16)fs32_to_cpu(sb, inode->u.sysv_i.i_data[0]);
        inode->u.sysv_i.i_dir_start_lookup = 0;
        sysv_set_inode(inode, rdev);
+       return;
+
+bad_inode:
+       make_bad_inode(inode);
+       return;
 }
 
 static struct buffer_head * sysv_update_inode(struct inode * inode)
index 55ef24a7740a15f4ab6af9af0ceea958afd2ec94..3f856ead1dfc9fd060c6e1fc2ec8f5640d36267b 100644 (file)
@@ -323,7 +323,7 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
        /* set up enough so that it can read an inode */
        sb->s_op = &sysv_sops;
        root_inode = iget(sb,SYSV_ROOT_INO);
-       if (!root_inode) {
+       if (!root_inode || is_bad_inode(root_inode)) {
                printk("SysV FS: get root inode failed\n");
                return 0;
        }
index 5d77d4c86fefe5181187ee1037f32b0caec935a0..d2d009aeeb6c949f4364f3b1583259b9b9932816 100644 (file)
@@ -486,13 +486,13 @@ void ufs_read_inode (struct inode * inode)
        if (inode->i_ino < UFS_ROOTINO || 
            inode->i_ino > (uspi->s_ncg * uspi->s_ipg)) {
                ufs_warning (sb, "ufs_read_inode", "bad inode number (%lu)\n", inode->i_ino);
-               return;
+               goto bad_inode;
        }
        
        bh = sb_bread(sb, uspi->s_sbbase + ufs_inotofsba(inode->i_ino));
        if (!bh) {
                ufs_warning (sb, "ufs_read_inode", "unable to read inode %lu\n", inode->i_ino);
-               return;
+               goto bad_inode;
        }
        ufs_inode = (struct ufs_inode *) (bh->b_data + sizeof(struct ufs_inode) * ufs_inotofsbo(inode->i_ino));
 
@@ -557,6 +557,11 @@ void ufs_read_inode (struct inode * inode)
        brelse (bh);
 
        UFSD(("EXIT\n"))
+       return;
+
+bad_inode:
+       make_bad_inode(inode);
+       return;
 }
 
 static int ufs_update_inode(struct inode * inode, int do_sync)
index 203b51af50b50d5f80c0b75c9abf15a9be59b4e1..309f4b656eff0203729ddd2f8d072534433f5973 100644 (file)
@@ -442,6 +442,7 @@ struct super_block * ufs_read_super (struct super_block * sb, void * data,
        struct ufs_super_block_second * usb2;
        struct ufs_super_block_third * usb3;
        struct ufs_buffer_head * ubh;   
+       struct inode *inode;
        unsigned block_size, super_block_size;
        unsigned flags;
 
@@ -787,7 +788,13 @@ magic_found:
                    fs32_to_cpu(sb, usb3->fs_u2.fs_44.fs_maxsymlinklen);
        
        sb->u.ufs_sb.s_flags = flags;
-       sb->s_root = d_alloc_root(iget(sb, UFS_ROOTINO));
+
+       inode = iget(sb, UFS_ROOTINO);
+       if (!inode || is_bad_inode(inode))
+               goto failed;
+       sb->s_root = d_alloc_root(inode);
+       if (!sb->s_root)
+               goto dalloc_failed;
 
 
        /*
@@ -800,6 +807,8 @@ magic_found:
        UFSD(("EXIT\n"))
        return(sb);
 
+dalloc_failed:
+       iput(inode);
 failed:
        if (ubh) ubh_brelse_uspi (uspi);
        if (uspi) kfree (uspi);
index 378c2edfdc93817264dfff77fdc36b601909ed95..2feb1222db346589ff12e871cea4cb7dc3e3b22d 100644 (file)
@@ -33,3 +33,4 @@ static void __exit exit_vfat_fs(void)
 
 module_init(init_vfat_fs)
 module_exit(exit_vfat_fs)
+MODULE_LICENSE("GPL");
index 598edbdafebe5314d9e8d6ea3912ccec8994f3e7..0cf51b706133f0b884f86019001ee7904191f115 100644 (file)
@@ -40,6 +40,7 @@
 #define X86_FEATURE_XMM                (0*32+25) /* Streaming SIMD Extensions */
 #define X86_FEATURE_XMM2       (0*32+26) /* Streaming SIMD Extensions-2 */
 #define X86_FEATURE_SELFSNOOP  (0*32+27) /* CPU self snoop */
+#define X86_FEATURE_HT         (0*32+28) /* Hyper-Threading */
 #define X86_FEATURE_ACC                (0*32+29) /* Automatic clock control */
 #define X86_FEATURE_IA64       (0*32+30) /* IA-64 processor */
 
index 11bcb7f29e4216189bd0cd889ee797182ae51985..d3f23faa638a0bb702e6e38e3ff3ad76a97a3826 100644 (file)
@@ -81,6 +81,7 @@
 
 #define MSR_K7_EVNTSEL0                        0xC0010000
 #define MSR_K7_PERFCTR0                        0xC0010004
+#define MSR_K7_HWCR                    0xC0010015
 
 /* Centaur-Hauls/IDT defined MSRs. */
 #define MSR_IDT_FCR1                   0x107
index bc76210eabc0eb8b890bdc3209c28ae601841d1c..ce81f42c9b08d72b57dbe899c0594cbd69094612 100644 (file)
@@ -57,6 +57,9 @@ extern unsigned long phys_cpu_present_map;
 extern unsigned long cpu_online_map;
 extern volatile unsigned long smp_invalidate_needed;
 extern int pic_mode;
+extern int smp_num_siblings;
+extern int cpu_sibling_map[];
+
 extern void smp_flush_tlb(void);
 extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
 extern void smp_send_reschedule(int cpu);
index f227747b2c5877462f9b429ca9a553643d2dba5a..db5de1462107b261fa11234e1ef5d9a632ea81eb 100644 (file)
@@ -36,8 +36,8 @@
 /*
  * The second extended file system version
  */
-#define EXT3FS_DATE            "06 Nov 2001"
-#define EXT3FS_VERSION         "2.4-0.9.15"
+#define EXT3FS_DATE            "02 Dec 2001"
+#define EXT3FS_VERSION         "2.4-0.9.16"
 
 /*
  * Debug code
@@ -577,10 +577,6 @@ struct ext3_dir_entry_2 {
                                         ~EXT3_DIR_ROUND)
 
 #ifdef __KERNEL__
-
-/* Filesize hard limits for 64-bit file offsets */
-extern long long ext3_max_sizes[];
-
 /*
  * Describe an inode's exact location on disk and in memory
  */
@@ -603,9 +599,6 @@ struct ext3_iloc
 # define ATTRIB_NORET  __attribute__((noreturn))
 # define NORET_AND     noreturn,
 
-/* acl.c */
-extern int ext3_permission (struct inode *, int);
-
 /* balloc.c */
 extern int ext3_bg_has_super(struct super_block *sb, int group);
 extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
@@ -619,16 +612,10 @@ extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
                                                    unsigned int block_group,
                                                    struct buffer_head ** bh);
 
-/* bitmap.c */
-extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
-
 /* dir.c */
 extern int ext3_check_dir_entry(const char *, struct inode *,
                                struct ext3_dir_entry_2 *, struct buffer_head *,
                                unsigned long);
-
-/* file.c */
-
 /* fsync.c */
 extern int ext3_sync_file (struct file *, struct dentry *, int);
 
@@ -638,9 +625,9 @@ extern void ext3_free_inode (handle_t *, struct inode *);
 extern struct inode * ext3_orphan_get (struct super_block *, ino_t);
 extern unsigned long ext3_count_free_inodes (struct super_block *);
 extern void ext3_check_inodes_bitmap (struct super_block *);
+extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
 
 /* inode.c */
-
 extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
 extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
 
@@ -654,13 +641,13 @@ extern int  ext3_sync_inode (handle_t *, struct inode *);
 extern void ext3_discard_prealloc (struct inode *);
 extern void ext3_dirty_inode(struct inode *);
 extern int ext3_change_inode_journal_flag(struct inode *, int);
+extern void ext3_truncate (struct inode *);
 
 /* ioctl.c */
 extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
                       unsigned long);
 
 /* namei.c */
-extern struct inode_operations ext3_dir_inode_operations;
 extern int ext3_orphan_add(handle_t *, struct inode *);
 extern int ext3_orphan_del(handle_t *, struct inode *);
 
@@ -684,9 +671,6 @@ extern int ext3_remount (struct super_block *, int *, char *);
 extern struct super_block * ext3_read_super (struct super_block *,void *,int);
 extern int ext3_statfs (struct super_block *, struct statfs *);
 
-/* truncate.c */
-extern void ext3_truncate (struct inode *);
-
 #define ext3_std_error(sb, errno)                              \
 do {                                                           \
        if ((errno))                                            \
@@ -705,10 +689,15 @@ extern struct file_operations ext3_dir_operations;
 extern struct inode_operations ext3_file_inode_operations;
 extern struct file_operations ext3_file_operations;
 
+/* inode.c */
+extern struct address_space_operations ext3_aops;
+
+/* namei.c */
+extern struct inode_operations ext3_dir_inode_operations;
+
 /* symlink.c */
 extern struct inode_operations ext3_fast_symlink_inode_operations;
 
-extern struct address_space_operations ext3_aops;
 
 #endif /* __KERNEL__ */
 
index 9e4002b52b51ef45a8bcfafcdd36c410d449772d..88bb8a516bf62725d41720377c63f1e1f4ee63fb 100644 (file)
@@ -196,9 +196,22 @@ __ext3_journal_dirty_metadata(const char *where,
  */
 static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks)
 {
+       journal_t *journal;
+       
        if (inode->i_sb->s_flags & MS_RDONLY)
                return ERR_PTR(-EROFS);
-       return journal_start(EXT3_JOURNAL(inode), nblocks);
+
+       /* Special case here: if the journal has aborted behind our
+        * backs (eg. EIO in the commit thread), then we still need to
+        * take the FS itself readonly cleanly. */
+       journal = EXT3_JOURNAL(inode);
+       if (is_journal_aborted(journal)) {
+               ext3_abort(inode->i_sb, __FUNCTION__,
+                          "Detected aborted journal");
+               return ERR_PTR(-EROFS);
+       }
+       
+       return journal_start(journal, nblocks);
 }
 
 static inline handle_t *
index 5de8528ef1960ee4c3fd0dba609b52eefadd9f73..2cb980fbb6d5d47687365d0f944f3defe0ae3d9d 100644 (file)
@@ -221,7 +221,7 @@ void buffer_assertion_failure(struct buffer_head *bh);
 #endif
 
 #else
-#define J_ASSERT(assert)
+#define J_ASSERT(assert)       do { } while (0)
 #endif         /* JBD_ASSERTIONS */
 
 enum jbd_state_bits {
@@ -564,7 +564,7 @@ extern void __journal_clean_data_list(transaction_t *transaction);
 
 /* Log buffer allocation */
 extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
-extern unsigned long journal_next_log_block(journal_t *);
+int journal_next_log_block(journal_t *, unsigned long *);
 
 /* Commit management */
 extern void journal_commit_transaction(journal_t *);
@@ -664,15 +664,16 @@ extern int           journal_load       (journal_t *journal);
 extern void       journal_destroy    (journal_t *);
 extern int        journal_recover    (journal_t *journal);
 extern int        journal_wipe       (journal_t *, int);
-extern int        journal_skip_recovery (journal_t *);
-extern void       journal_update_superblock (journal_t *, int);
-extern void       __journal_abort      (journal_t *);
+extern int        journal_skip_recovery        (journal_t *);
+extern void       journal_update_superblock    (journal_t *, int);
+extern void       __journal_abort_hard (journal_t *);
+extern void       __journal_abort_soft (journal_t *, int);
 extern void       journal_abort      (journal_t *, int);
 extern int        journal_errno      (journal_t *);
 extern void       journal_ack_err    (journal_t *);
 extern int        journal_clear_err  (journal_t *);
-extern unsigned long journal_bmap(journal_t *journal, unsigned long blocknr);
-extern int         journal_force_commit(journal_t *journal);
+extern int        journal_bmap(journal_t *, unsigned long, unsigned long *);
+extern int        journal_force_commit(journal_t *);
 
 /*
  * journal_head management
index 1c4c54498d60aaebfb88b4b867a45384677863c0..e40bddbba7cdfe5d525d1ec42ba50f426231b89e 100644 (file)
@@ -433,6 +433,7 @@ struct task_struct {
 #define PF_MEMALLOC    0x00000800      /* Allocating memory */
 #define PF_MEMDIE      0x00001000      /* Killed for out-of-memory */
 #define PF_FREE_PAGES  0x00002000      /* per process page freeing */
+#define PF_NOIO                0x00004000      /* avoid generating further I/O */
 
 #define PF_USEDFPU     0x00100000      /* task used FPU this quantum (SMP) */
 
index 757edd23d6b3bdffa8ce3b0fbeeeaa696a115122..1de65396fee7c985a6b54efc401a615934adc606 100644 (file)
@@ -265,6 +265,21 @@ send_now_idle:
                 * a problem.
                 */
                if (tsk == idle_task(cpu)) {
+#if defined(__i386__) && defined(CONFIG_SMP)
+                        /*
+                        * Check if two siblings are idle in the same
+                        * physical package. Use them if found.
+                        */
+                       if (smp_num_siblings == 2) {
+                               if (cpu_curr(cpu_sibling_map[cpu]) == 
+                                   idle_task(cpu_sibling_map[cpu])) {
+                                       oldest_idle = last_schedule(cpu);
+                                       target_tsk = tsk;
+                                       break;
+                               }
+                               
+                        }
+#endif         
                        if (last_schedule(cpu) < oldest_idle) {
                                oldest_idle = last_schedule(cpu);
                                target_tsk = tsk;
index 5aef0ff33926ccf196aab7ba9e393aa82af40654..281dfaec5f1e366d22219260eb85c7778bdfa02c 100644 (file)
@@ -5,7 +5,7 @@
  *
  *             PACKET - implements raw packet sockets.
  *
- * Version:    $Id: af_packet.c,v 1.57 2001/10/30 03:38:37 davem Exp $
+ * Version:    $Id: af_packet.c,v 1.58 2001/11/28 21:02:10 davem Exp $
  *
  * Authors:    Ross Biro, <bir7@leland.Stanford.Edu>
  *             Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -1902,3 +1902,4 @@ static int __init packet_init(void)
 
 module_init(packet_init);
 module_exit(packet_exit);
+MODULE_LICENSE("GPL");
index 1139ca7bbb2e504c9a6b7525715f4c1b1f901d8c..b58338f52f06fb8c53bf8f2c8bf3f3d1e03bf688 100644 (file)
@@ -75,6 +75,7 @@
  #include <../drivers/net/syncppp.h>
 
 #else
+ #include <asm/segment.h>      /* kernel <-> user copy */
 #endif
 
 #define KMEM_SAFETYZONE 8
index d90a2d0f4cc2bc1b6f1427f764ea97b6db149744..14cf0257f28c727cceb4ccc058dc81fd6004743d 100644 (file)
@@ -40,6 +40,7 @@
  #define PROC_STATS_FORMAT "%30s: %12lu\n"
 #else
  #define PROC_STATS_FORMAT "%30s: %12u\n"
+ #include <asm/segment.h>      /* kernel <-> user copy */
 #endif