## Automatically generated incremental diff
## From:   linux-2.5.2-pre3
## To:     linux-2.5.2-pre4
## Robot:  $Id: make-incremental-diff,v 1.9 2001/12/10 00:06:56 hpa Exp $

diff -urN linux-2.5.2-pre3/Makefile linux/Makefile
--- linux-2.5.2-pre3/Makefile	Sun Dec 30 11:38:08 2001
+++ linux/Makefile	Sun Dec 30 11:38:10 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 2
-EXTRAVERSION =-pre3
+EXTRAVERSION =-pre4
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.5.2-pre3/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- linux-2.5.2-pre3/arch/alpha/kernel/alpha_ksyms.c	Sun Nov 25 09:45:10 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c	Sun Dec 30 11:38:10 2001
@@ -259,3 +259,8 @@
 EXPORT_SYMBOL_NOVERS(memchr);
 
 EXPORT_SYMBOL(get_wchan);
+
+#ifdef CONFIG_ALPHA_IRONGATE
+EXPORT_SYMBOL(irongate_ioremap);
+EXPORT_SYMBOL(irongate_iounmap);
+#endif
diff -urN linux-2.5.2-pre3/arch/alpha/kernel/pci-noop.c linux/arch/alpha/kernel/pci-noop.c
--- linux-2.5.2-pre3/arch/alpha/kernel/pci-noop.c	Thu Sep 13 15:21:32 2001
+++ linux/arch/alpha/kernel/pci-noop.c	Sun Dec 30 11:38:10 2001
@@ -104,21 +104,21 @@
 }
 /* stubs for the routines in pci_iommu.c */
 void *
-pci_alloc_consistent(struct pci_dev *pdev, long size, dma_addr_t *dma_addrp)
+pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
 {
 }
 void
-pci_free_consistent(struct pci_dev *pdev, long size, void *cpu_addr,
+pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
 		    dma_addr_t dma_addr)
 {
 }
 dma_addr_t
-pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size,
+pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size,
 	       int direction)
 {
 }
 void
-pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size,
+pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
 		 int direction)
 {
 }
diff -urN linux-2.5.2-pre3/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
--- linux-2.5.2-pre3/arch/alpha/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/alpha/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/irq.h>
+#include <linux/cache.h>
 
 #include <asm/hwrpb.h>
 #include <asm/ptrace.h>
@@ -65,7 +66,7 @@
 	IPI_CPU_STOP,
 };
 
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 /* Set to a secondary's cpuid when it comes online.  */
 static unsigned long smp_secondary_alive;
diff -urN linux-2.5.2-pre3/arch/i386/config.in linux/arch/i386/config.in
--- linux-2.5.2-pre3/arch/i386/config.in	Mon Nov 12 11:58:08 2001
+++ linux/arch/i386/config.in	Sun Dec 30 11:38:10 2001
@@ -52,6 +52,7 @@
    define_int  CONFIG_X86_L1_CACHE_SHIFT 4
    define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
    define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
+   define_bool CONFIG_X86_PPRO_FENCE y
 else
    define_bool CONFIG_X86_WP_WORKS_OK y
    define_bool CONFIG_X86_INVLPG y
@@ -66,17 +67,20 @@
    define_int  CONFIG_X86_L1_CACHE_SHIFT 4
    define_bool CONFIG_X86_USE_STRING_486 y
    define_bool CONFIG_X86_ALIGNMENT_16 y
+   define_bool CONFIG_X86_PPRO_FENCE y
 fi
 if [ "$CONFIG_M586" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_USE_STRING_486 y
    define_bool CONFIG_X86_ALIGNMENT_16 y
+   define_bool CONFIG_X86_PPRO_FENCE y
 fi
 if [ "$CONFIG_M586TSC" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_USE_STRING_486 y
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_PPRO_FENCE y
 fi
 if [ "$CONFIG_M586MMX" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
@@ -84,6 +88,7 @@
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_GOOD_APIC y
+   define_bool CONFIG_X86_PPRO_FENCE y
 fi
 if [ "$CONFIG_M686" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
@@ -91,6 +96,7 @@
    define_bool CONFIG_X86_GOOD_APIC y
    define_bool CONFIG_X86_PGE y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_PPRO_FENCE y
 fi
 if [ "$CONFIG_MPENTIUMIII" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
@@ -135,21 +141,24 @@
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_OOSTORE y
 fi
 if [ "$CONFIG_MWINCHIP2" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_OOSTORE y
 fi
 if [ "$CONFIG_MWINCHIP3D" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+   define_bool CONFIG_X86_OOSTORE y
 fi
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
-tristate 'Dell Inspiron 8000 support' CONFIG_I8K
+tristate 'Dell laptop support' CONFIG_I8K
 
 tristate '/dev/cpu/microcode - Intel IA32 CPU microcode support' CONFIG_MICROCODE
 tristate '/dev/cpu/*/msr - Model-specific register support' CONFIG_X86_MSR
diff -urN linux-2.5.2-pre3/arch/i386/kernel/dmi_scan.c linux/arch/i386/kernel/dmi_scan.c
--- linux-2.5.2-pre3/arch/i386/kernel/dmi_scan.c	Thu Dec  6 14:01:17 2001
+++ linux/arch/i386/kernel/dmi_scan.c	Sun Dec 30 11:38:10 2001
@@ -572,6 +572,11 @@
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0094.P10"),
 			NO_MATCH, NO_MATCH
                         } },
+	{ broken_pirq, "l44GX Bios", {        		/* Bad $PIR */
+			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0120.P12"),
+			NO_MATCH, NO_MATCH
+                        } },
 	{ broken_pirq, "l44GX Bios", {		/* Bad $PIR */
 			MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
 			MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0125.P13"),
diff -urN linux-2.5.2-pre3/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- linux-2.5.2-pre3/arch/i386/kernel/pci-pc.c	Fri Dec  7 16:26:13 2001
+++ linux/arch/i386/kernel/pci-pc.c	Sun Dec 30 11:38:10 2001
@@ -30,7 +30,7 @@
  * This interrupt-safe spinlock protects all accesses to PCI
  * configuration space.
  */
-spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
 
 
 /*
@@ -1109,17 +1109,15 @@
 }
 
 /*
- * Nobody seems to know what this does. Damn.
- *
- * But it does seem to fix some unspecified problem
- * with 'movntq' copies on Athlons.
+ * Addresses issues with problems in the memory write queue timer in
+ * certain VIA Northbridges.  This bugfix is per VIA's specifications.
  *
  * VIA 8363,8622,8361 Northbridges:
  *  - bits  5, 6, 7 at offset 0x55 need to be turned off
  * VIA 8367 (KT266x) Northbridges:
  *  - bits  5, 6, 7 at offset 0x95 need to be turned off
  */
-static void __init pci_fixup_via_athlon_bug(struct pci_dev *d)
+static void __init pci_fixup_via_northbridge_bug(struct pci_dev *d)
 {
 	u8 v;
 	int where = 0x55;
@@ -1131,7 +1129,7 @@
 
         pci_read_config_byte(d, where, &v);
 	if (v & 0xe0) {
-		printk("Trying to stomp on Athlon bug...\n");
+		printk("Disabling broken memory write queue.\n");
 		v &= 0x1f; /* clear bits 5, 6, 7 */
 		pci_write_config_byte(d, where, v);
 	}
@@ -1146,10 +1144,10 @@
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5597,		pci_fixup_latency },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5598,		pci_fixup_latency },
  	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82371AB_3,	pci_fixup_piix4_acpi },
-	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	pci_fixup_via_athlon_bug },
-	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8622,	        pci_fixup_via_athlon_bug },
-	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,	        pci_fixup_via_athlon_bug },
-	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8367_0,	pci_fixup_via_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	pci_fixup_via_northbridge_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8622,	        pci_fixup_via_northbridge_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,	        pci_fixup_via_northbridge_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8367_0,	pci_fixup_via_northbridge_bug },
 	{ 0 }
 };
 
diff -urN linux-2.5.2-pre3/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-2.5.2-pre3/arch/i386/kernel/setup.c	Tue Nov 27 09:23:27 2001
+++ linux/arch/i386/kernel/setup.c	Sun Dec 30 11:38:10 2001
@@ -1290,7 +1290,6 @@
 			break;
 
 		case 6:	/* An Athlon/Duron. We can trust the BIOS probably */
-			mcheck_init(c);
 			break;		
 	}
 
@@ -1918,7 +1917,6 @@
 				c->x86_cache_size = (cc>>24)+(dd>>24);
 			}
 			sprintf( c->x86_model_id, "WinChip %s", name );
-			mcheck_init(c);
 			break;
 
 		case 6:
@@ -2202,9 +2200,6 @@
 
 	if ( p )
 		strcpy(c->x86_model_id, p);
-
-	/* Enable MCA if available */
-	mcheck_init(c);
 }
 
 void __init get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -2584,7 +2579,7 @@
 		init_rise(c);
 		break;
 	}
-	
+
 	printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n",
 	       c->x86_capability[0],
 	       c->x86_capability[1],
@@ -2610,6 +2605,9 @@
 
 	/* Disable the PN if appropriate */
 	squash_the_stupid_serial_number(c);
+
+	/* Init Machine Check Exception if available. */
+	mcheck_init(c);
 
 	/* If the model name is still unset, do table lookup. */
 	if ( !c->x86_model_id[0] ) {
diff -urN linux-2.5.2-pre3/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
--- linux-2.5.2-pre3/arch/i386/kernel/smp.c	Tue Oct 23 14:17:10 2001
+++ linux/arch/i386/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -17,6 +17,7 @@
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
 #include <linux/mc146818rtc.h>
+#include <linux/cache.h>
 
 #include <asm/mtrr.h>
 #include <asm/pgalloc.h>
@@ -102,7 +103,7 @@
  */
 
 /* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 struct tlb_state cpu_tlbstate[NR_CPUS] = {[0 ... NR_CPUS-1] = { &init_mm, 0 }};
 
diff -urN linux-2.5.2-pre3/arch/ia64/kernel/smp.c linux/arch/ia64/kernel/smp.c
--- linux-2.5.2-pre3/arch/ia64/kernel/smp.c	Fri Nov  9 14:26:17 2001
+++ linux/arch/ia64/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -30,6 +30,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/mm.h>
 #include <linux/delay.h>
+#include <linux/cache.h>
 
 #include <asm/atomic.h>
 #include <asm/bitops.h>
@@ -51,7 +52,7 @@
 #include <asm/mca.h>
 
 /* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 /*
  * Structure and data for smp_call_function(). This is designed to minimise static memory
diff -urN linux-2.5.2-pre3/arch/mips/kernel/smp.c linux/arch/mips/kernel/smp.c
--- linux-2.5.2-pre3/arch/mips/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/mips/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -31,6 +31,7 @@
 #include <linux/timex.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
+#include <linux/cache.h>
 
 #include <asm/atomic.h>
 #include <asm/processor.h>
@@ -52,7 +53,7 @@
 
 
 /* Ze Big Kernel Lock! */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 int smp_threads_ready;  /* Not used */
 int smp_num_cpus;    
 int global_irq_holder = NO_PROC_ID;
diff -urN linux-2.5.2-pre3/arch/mips64/kernel/smp.c linux/arch/mips64/kernel/smp.c
--- linux-2.5.2-pre3/arch/mips64/kernel/smp.c	Wed Jul  4 11:50:39 2001
+++ linux/arch/mips64/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -5,6 +5,7 @@
 #include <linux/time.h>
 #include <linux/timex.h>
 #include <linux/sched.h>
+#include <linux/cache.h>
 
 #include <asm/atomic.h>
 #include <asm/processor.h>
@@ -52,7 +53,7 @@
 #endif /* CONFIG_SGI_IP27 */
 
 /* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 int smp_threads_ready;	/* Not used */
 atomic_t smp_commenced = ATOMIC_INIT(0);
 struct cpuinfo_mips cpu_data[NR_CPUS];
diff -urN linux-2.5.2-pre3/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- linux-2.5.2-pre3/arch/ppc/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/ppc/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -23,6 +23,7 @@
 #include <linux/unistd.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
+#include <linux/cache.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
@@ -47,7 +48,7 @@
 struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
 atomic_t ipi_recv;
 atomic_t ipi_sent;
-spinlock_t kernel_flag __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 unsigned int prof_multiplier[NR_CPUS];
 unsigned int prof_counter[NR_CPUS];
 cycles_t cacheflush_time;
diff -urN linux-2.5.2-pre3/arch/s390/kernel/smp.c linux/arch/s390/kernel/smp.c
--- linux-2.5.2-pre3/arch/s390/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/s390/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -29,6 +29,7 @@
 #include <linux/smp_lock.h>
 
 #include <linux/delay.h>
+#include <linux/cache.h>
 
 #include <asm/sigp.h>
 #include <asm/pgalloc.h>
@@ -55,7 +56,7 @@
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
 static atomic_t  smp_commenced = ATOMIC_INIT(0);
 
-spinlock_t       kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t       kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 unsigned long	 cpu_online_map;
 
diff -urN linux-2.5.2-pre3/arch/s390x/kernel/smp.c linux/arch/s390x/kernel/smp.c
--- linux-2.5.2-pre3/arch/s390x/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/s390x/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -29,6 +29,7 @@
 #include <linux/smp_lock.h>
 
 #include <linux/delay.h>
+#include <linux/cache.h>
 
 #include <asm/sigp.h>
 #include <asm/pgalloc.h>
@@ -55,7 +56,7 @@
 int              smp_threads_ready=0;      /* Set when the idlers are all forked. */
 static atomic_t  smp_commenced = ATOMIC_INIT(0);
 
-spinlock_t       kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t       kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 unsigned long	 cpu_online_map;
 
diff -urN linux-2.5.2-pre3/arch/sparc/kernel/smp.c linux/arch/sparc/kernel/smp.c
--- linux-2.5.2-pre3/arch/sparc/kernel/smp.c	Tue Nov 13 09:16:05 2001
+++ linux/arch/sparc/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -18,6 +18,7 @@
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
+#include <linux/cache.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
@@ -66,7 +67,7 @@
  */
 
 /* Kernel spinlock */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 /* Used to make bitops atomic */
 unsigned char bitops_spinlock = 0;
diff -urN linux-2.5.2-pre3/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
--- linux-2.5.2-pre3/arch/sparc64/kernel/smp.c	Wed Nov 21 10:31:09 2001
+++ linux/arch/sparc64/kernel/smp.c	Sun Dec 30 11:38:10 2001
@@ -17,6 +17,7 @@
 #include <linux/spinlock.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
+#include <linux/cache.h>
 
 #include <asm/head.h>
 #include <asm/ptrace.h>
@@ -39,17 +40,17 @@
 extern void calibrate_delay(void);
 extern unsigned prom_cpu_nodes[];
 
-struct cpuinfo_sparc cpu_data[NR_CPUS]  __attribute__ ((aligned (64)));
+cpuinfo_sparc cpu_data[NR_CPUS];
 
-volatile int __cpu_number_map[NR_CPUS]  __attribute__ ((aligned (64)));
-volatile int __cpu_logical_map[NR_CPUS] __attribute__ ((aligned (64)));
+volatile int __cpu_number_map[NR_CPUS]  __attribute__ ((aligned (SMP_CACHE_BYTES)));
+volatile int __cpu_logical_map[NR_CPUS] __attribute__ ((aligned (SMP_CACHE_BYTES)));
 
 /* Please don't make this stuff initdata!!!  --DaveM */
 static unsigned char boot_cpu_id = 0;
 static int smp_activated = 0;
 
 /* Kernel spinlock */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 volatile int smp_processors_ready = 0;
 unsigned long cpu_present_map = 0;
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/ac_adapter/ac_osl.c linux/drivers/acpi/ospm/ac_adapter/ac_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/ac_adapter/ac_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/ac_adapter/ac_osl.c	Sun Dec 30 11:38:10 2001
@@ -35,6 +35,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - AC Adapter Driver");
+MODULE_LICENSE("GPL");
 
 
 #define AC_PROC_ROOT		"ac_adapter"
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/battery/bt_osl.c linux/drivers/acpi/ospm/battery/bt_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/battery/bt_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/battery/bt_osl.c	Sun Dec 30 11:38:10 2001
@@ -44,6 +44,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Control Method Battery Driver");
+MODULE_LICENSE("GPL");
 
 
 #define BT_PROC_ROOT		"battery"
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/busmgr/bm_osl.c linux/drivers/acpi/ospm/busmgr/bm_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/busmgr/bm_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/busmgr/bm_osl.c	Sun Dec 30 11:38:10 2001
@@ -38,6 +38,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI Bus Manager");
+MODULE_LICENSE("GPL");
 
 
 /*****************************************************************************
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/button/bn_osl.c linux/drivers/acpi/ospm/button/bn_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/button/bn_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/button/bn_osl.c	Sun Dec 30 11:38:10 2001
@@ -35,6 +35,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Button Driver");
+MODULE_LICENSE("GPL");
 
 
 #define BN_PROC_ROOT		"button"
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/ec/ec_osl.c linux/drivers/acpi/ospm/ec/ec_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/ec/ec_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/ec/ec_osl.c	Sun Dec 30 11:38:10 2001
@@ -36,6 +36,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Embedded Controller Driver");
+MODULE_LICENSE("GPL");
 
 extern struct proc_dir_entry	*bm_proc_root;
 
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/processor/pr_osl.c linux/drivers/acpi/ospm/processor/pr_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/processor/pr_osl.c	Fri Nov  9 13:58:02 2001
+++ linux/drivers/acpi/ospm/processor/pr_osl.c	Sun Dec 30 11:38:10 2001
@@ -37,6 +37,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - IA32 Processor Driver");
+MODULE_LICENSE("GPL");
 
 
 #define PR_PROC_ROOT		"processor"
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/system/sm_osl.c linux/drivers/acpi/ospm/system/sm_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/system/sm_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/system/sm_osl.c	Sun Dec 30 11:38:10 2001
@@ -42,6 +42,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI System Driver");
+MODULE_LICENSE("GPL");
 
 
 #define SM_PROC_INFO		"info"
diff -urN linux-2.5.2-pre3/drivers/acpi/ospm/thermal/tz_osl.c linux/drivers/acpi/ospm/thermal/tz_osl.c
--- linux-2.5.2-pre3/drivers/acpi/ospm/thermal/tz_osl.c	Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/thermal/tz_osl.c	Sun Dec 30 11:38:10 2001
@@ -35,6 +35,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Thermal Zone Driver");
+MODULE_LICENSE("GPL");
 
 int TZP = 0;
 MODULE_PARM(TZP, "i");
diff -urN linux-2.5.2-pre3/drivers/atm/fore200e.c linux/drivers/atm/fore200e.c
--- linux-2.5.2-pre3/drivers/atm/fore200e.c	Thu Sep 13 15:21:32 2001
+++ linux/drivers/atm/fore200e.c	Sun Dec 30 11:38:10 2001
@@ -39,7 +39,6 @@
 #include <linux/atm_suni.h>
 #include <asm/io.h>
 #include <asm/string.h>
-#include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/irq.h>
 #include <asm/dma.h>
diff -urN linux-2.5.2-pre3/drivers/block/DAC960.c linux/drivers/block/DAC960.c
--- linux-2.5.2-pre3/drivers/block/DAC960.c	Sun Dec 16 12:20:20 2001
+++ linux/drivers/block/DAC960.c	Sun Dec 30 11:38:10 2001
@@ -45,7 +45,6 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include "DAC960.h"
 
diff -urN linux-2.5.2-pre3/drivers/block/elevator.c linux/drivers/block/elevator.c
--- linux-2.5.2-pre3/drivers/block/elevator.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/block/elevator.c	Sun Dec 30 11:38:10 2001
@@ -165,12 +165,13 @@
 	while ((entry = entry->prev) != &q->queue_head) {
 		__rq = list_entry_rq(entry);
 
+		if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
+			break;
+
 		/*
 		 * simply "aging" of requests in queue
 		 */
 		if (__rq->elevator_sequence-- <= 0)
-			break;
-		if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
 			break;
 		if (!(__rq->flags & REQ_CMD))
 			continue;
diff -urN linux-2.5.2-pre3/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- linux-2.5.2-pre3/drivers/block/ll_rw_blk.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/block/ll_rw_blk.c	Sun Dec 30 11:38:10 2001
@@ -881,7 +881,9 @@
 
 	BUG_ON(rw != READ && rw != WRITE);
 
+	spin_lock_irq(q->queue_lock);
 	rq = get_request(q, rw);
+	spin_unlock_irq(q->queue_lock);
 
 	if (!rq && (gfp_mask & __GFP_WAIT))
 		rq = get_request_wait(q, rw);
@@ -1081,7 +1083,7 @@
 {
 	struct request *req, *freereq = NULL;
 	int el_ret, latency = 0, rw, nr_sectors, cur_nr_sectors, barrier;
-	struct list_head *insert_here = &q->queue_head;
+	struct list_head *insert_here;
 	elevator_t *elevator = &q->elevator;
 	sector_t sector;
 
@@ -1103,15 +1105,14 @@
 	barrier = test_bit(BIO_RW_BARRIER, &bio->bi_rw);
 
 	spin_lock_irq(q->queue_lock);
+again:
+	req = NULL;
+	insert_here = q->queue_head.prev;
 
 	if (blk_queue_empty(q) || barrier) {
 		blk_plug_device(q);
 		goto get_rq;
 	}
-
-again:
-	req = NULL;
-	insert_here = q->queue_head.prev;
 
 	el_ret = elevator->elevator_merge_fn(q, &req, bio);
 	switch (el_ret) {
diff -urN linux-2.5.2-pre3/drivers/block/loop.c linux/drivers/block/loop.c
--- linux-2.5.2-pre3/drivers/block/loop.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/block/loop.c	Sun Dec 30 11:38:10 2001
@@ -552,6 +552,8 @@
 	atomic_inc(&lo->lo_pending);
 	spin_unlock_irq(&lo->lo_lock);
 
+	current->flags |= PF_NOIO;
+
 	/*
 	 * up sem, we are running
 	 */
@@ -613,6 +615,10 @@
 
 	if (S_ISBLK(inode->i_mode)) {
 		lo_device = inode->i_rdev;
+		if (lo_device == dev) {
+			error = -EBUSY;
+			goto out;
+		}
 	} else if (S_ISREG(inode->i_mode)) {
 		struct address_space_operations *aops = inode->i_mapping->a_ops;
 		/*
diff -urN linux-2.5.2-pre3/drivers/block/nbd.c linux/drivers/block/nbd.c
--- linux-2.5.2-pre3/drivers/block/nbd.c	Sun Dec 16 12:20:20 2001
+++ linux/drivers/block/nbd.c	Sun Dec 30 11:38:10 2001
@@ -45,7 +45,6 @@
 
 #include <linux/devfs_fs_kernel.h>
 
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <asm/types.h>
 
diff -urN linux-2.5.2-pre3/drivers/block/paride/Config.in linux/drivers/block/paride/Config.in
--- linux-2.5.2-pre3/drivers/block/paride/Config.in	Thu Oct 25 00:07:39 2001
+++ linux/drivers/block/paride/Config.in	Sun Dec 30 11:38:10 2001
@@ -29,7 +29,7 @@
 dep_tristate '    Shuttle EPAT/EPEZ protocol' CONFIG_PARIDE_EPAT $CONFIG_PARIDE
 if [ "$CONFIG_PARIDE_EPAT" != "n" ]; then
   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-    bool '     Support c7/c8 chips (EXPERIMENTAL)' CONFIG_PARIDE_EPATC8 $CONFIG_PARIDE
+    bool '     Support c7/c8 chips (EXPERIMENTAL)' CONFIG_PARIDE_EPATC8
   fi
 fi
 
diff -urN linux-2.5.2-pre3/drivers/block/ps2esdi.c linux/drivers/block/ps2esdi.c
--- linux-2.5.2-pre3/drivers/block/ps2esdi.c	Sun Dec 16 12:20:20 2001
+++ linux/drivers/block/ps2esdi.c	Sun Dec 30 11:38:10 2001
@@ -51,7 +51,6 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/dma.h>
 #include <asm/mca_dma.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.2-pre3/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- linux-2.5.2-pre3/drivers/cdrom/cdrom.c	Thu Dec  6 14:02:56 2001
+++ linux/drivers/cdrom/cdrom.c	Sun Dec 30 11:38:10 2001
@@ -266,7 +266,6 @@
 #include <linux/init.h>
 
 #include <asm/fcntl.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 /* used to tell the module to turn on full debugging messages */
diff -urN linux-2.5.2-pre3/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- linux-2.5.2-pre3/drivers/cdrom/cdu31a.c	Tue Nov 27 09:23:27 2001
+++ linux/drivers/cdrom/cdu31a.c	Sun Dec 30 11:38:10 2001
@@ -237,6 +237,7 @@
 static volatile unsigned short sony_cd_read_reg;
 static volatile unsigned short sony_cd_fifost_reg;
 
+static spinlock_t cdu31a_lock = SPIN_LOCK_UNLOCKED; /* queue lock */
 
 static int sony_spun_up = 0;	/* Has the drive been spun up? */
 
@@ -1605,17 +1606,7 @@
 			scd_spinup();
 		}
 
-		/* I don't use INIT_REQUEST because it calls return, which would
-		   return without unlocking the device.  It shouldn't matter,
-		   but just to be safe... */
-		if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) {
-			panic(DEVICE_NAME ": request list destroyed");
-		}
-		if (CURRENT->bh) {
-			if (!buffer_locked(CURRENT->bh)) {
-				panic(DEVICE_NAME ": block not locked");
-			}
-		}
+		INIT_REQUEST;
 
 		block = CURRENT->sector;
 		nblock = CURRENT->nr_sectors;
@@ -1626,112 +1617,105 @@
 			goto cdu31a_request_startover;
 		}
 
-		switch (CURRENT->cmd) {
-		case READ:
-			/*
-			 * If the block address is invalid or the request goes beyond the end of
-			 * the media, return an error.
-			 */
-#if 0
-			if ((block / 4) < sony_toc.start_track_lba) {
-				printk
-				    ("CDU31A: Request before beginning of media\n");
-				end_request(0);
-				goto cdu31a_request_startover;
-			}
-#endif
-			if ((block / 4) >= sony_toc.lead_out_start_lba) {
-				printk
-				    ("CDU31A: Request past end of media\n");
-				end_request(0);
-				goto cdu31a_request_startover;
-			}
-			if (((block + nblock) / 4) >=
-			    sony_toc.lead_out_start_lba) {
-				printk
-				    ("CDU31A: Request past end of media\n");
-				end_request(0);
-				goto cdu31a_request_startover;
-			}
-
-			num_retries = 0;
-
-		      try_read_again:
-			while (handle_sony_cd_attention());
-
-			if (!sony_toc_read) {
-				printk("CDU31A: TOC not read\n");
-				end_request(0);
-				goto cdu31a_request_startover;
-			}
-
-			/* If no data is left to be read from the drive, start the
-			   next request. */
-			if (sony_blocks_left == 0) {
-				if (start_request
-				    (block / 4, CDU31A_READAHEAD / 4, 0)) {
-					end_request(0);
-					goto cdu31a_request_startover;
-				}
-			}
-			/* If the requested block is not the next one waiting in
-			   the driver, abort the current operation and start a
-			   new one. */
-			else if (block != sony_next_block) {
-#if DEBUG
-				printk
-				    ("CDU31A Warning: Read for block %d, expected %d\n",
-				     block, sony_next_block);
-#endif
-				abort_read();
-				if (!sony_toc_read) {
-					printk("CDU31A: TOC not read\n");
+		if(CURRENT->flags & REQ_CMD) {
+			switch (rq_data_dir(CURRENT)) {
+			case READ:
+				/*
+				 * If the block address is invalid or the request goes beyond the end of
+				 * the media, return an error.
+				 */
+				if ((block / 4) >= sony_toc.lead_out_start_lba) {
+					printk
+						("CDU31A: Request past end of media\n");
 					end_request(0);
 					goto cdu31a_request_startover;
 				}
-				if (start_request
-				    (block / 4, CDU31A_READAHEAD / 4, 0)) {
+				if (((block + nblock) / 4) >=
+				    sony_toc.lead_out_start_lba) {
 					printk
-					    ("CDU31a: start request failed\n");
+						("CDU31A: Request past end of media\n");
 					end_request(0);
 					goto cdu31a_request_startover;
 				}
-			}
 
-			read_data_block(CURRENT->buffer, block, nblock,
-					res_reg, &res_size);
-			if (res_reg[0] == 0x20) {
-				if (num_retries > MAX_CDU31A_RETRIES) {
+				num_retries = 0;
+
+			try_read_again:
+				while (handle_sony_cd_attention());
+
+				if (!sony_toc_read) {
+					printk("CDU31A: TOC not read\n");
 					end_request(0);
 					goto cdu31a_request_startover;
 				}
 
-				num_retries++;
-				if (res_reg[1] == SONY_NOT_SPIN_ERR) {
-					do_sony_cd_cmd(SONY_SPIN_UP_CMD,
-						       NULL, 0, res_reg,
-						       &res_size);
-				} else {
+				/* If no data is left to be read from the drive, start the
+				   next request. */
+				if (sony_blocks_left == 0) {
+					if (start_request
+					    (block / 4, CDU31A_READAHEAD / 4, 0)) {
+						end_request(0);
+						goto cdu31a_request_startover;
+					}
+				}
+				/* If the requested block is not the next one waiting in
+				   the driver, abort the current operation and start a
+				   new one. */
+				else if (block != sony_next_block) {
+#if DEBUG
 					printk
-					    ("CDU31A: %s error for block %d, nblock %d\n",
-					     translate_error(res_reg[1]),
-					     block, nblock);
+						("CDU31A Warning: Read for block %d, expected %d\n",
+						 block, sony_next_block);
+#endif
+					abort_read();
+					if (!sony_toc_read) {
+						printk("CDU31A: TOC not read\n");
+						end_request(0);
+						goto cdu31a_request_startover;
+					}
+					if (start_request
+					    (block / 4, CDU31A_READAHEAD / 4, 0)) {
+						printk
+							("CDU31a: start request failed\n");
+						end_request(0);
+						goto cdu31a_request_startover;
+					}
 				}
-				goto try_read_again;
-			} else {
-				end_request(1);
-			}
-			break;
 
-		case WRITE:
-			end_request(0);
-			break;
+				read_data_block(CURRENT->buffer, block, nblock,
+						res_reg, &res_size);
+				if (res_reg[0] == 0x20) {
+					if (num_retries > MAX_CDU31A_RETRIES) {
+						end_request(0);
+						goto cdu31a_request_startover;
+					}
 
-		default:
-			panic("CDU31A: Unknown cmd");
+					num_retries++;
+					if (res_reg[1] == SONY_NOT_SPIN_ERR) {
+						do_sony_cd_cmd(SONY_SPIN_UP_CMD,
+							       NULL, 0, res_reg,
+							       &res_size);
+					} else {
+						printk
+							("CDU31A: %s error for block %d, nblock %d\n",
+							 translate_error(res_reg[1]),
+							 block, nblock);
+					}
+					goto try_read_again;
+				} else {
+					end_request(1);
+				}
+				break;
+
+			case WRITE:
+				end_request(0);
+				break;
+
+			default:
+				panic("CDU31A: Unknown cmd");
+			}
 		}
 	}
-
       end_do_cdu31a_request:
 	spin_lock_irq(&q->queue_lock);
 #if 0
@@ -3456,7 +3440,8 @@
 		    strcmp("CD-ROM CDU31A", drive_config.product_id) == 0;
 
 		blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR),
-			       DEVICE_REQUEST);
+			       DEVICE_REQUEST,
+			       &cdu31a_lock);
 		read_ahead[MAJOR_NR] = CDU31A_READAHEAD;
 		cdu31a_block_size = 1024;	/* 1kB default block size */
 		/* use 'mount -o block=2048' */
diff -urN linux-2.5.2-pre3/drivers/char/Config.in linux/drivers/char/Config.in
--- linux-2.5.2-pre3/drivers/char/Config.in	Mon Nov 12 09:34:16 2001
+++ linux/drivers/char/Config.in	Sun Dec 30 11:38:10 2001
@@ -16,7 +16,7 @@
       tristate '   Dual serial port support' CONFIG_DUALSP_SERIAL
    fi
 fi
-if [ "$CONFIG_ACPI" = "y" ]; then
+if [ "$CONFIG_ACPI" = "y" -a "$CONFIG_IA64" = "y" ]; then
    bool '  Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
 fi
 dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL
diff -urN linux-2.5.2-pre3/drivers/char/dsp56k.c linux/drivers/char/dsp56k.c
--- linux-2.5.2-pre3/drivers/char/dsp56k.c	Mon Sep 10 08:06:32 2001
+++ linux/drivers/char/dsp56k.c	Sun Dec 30 11:38:10 2001
@@ -37,7 +37,6 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 
-#include <asm/segment.h>
 #include <asm/atarihw.h>
 #include <asm/traps.h>
 #include <asm/uaccess.h>	/* For put_user and get_user */
diff -urN linux-2.5.2-pre3/drivers/char/dtlk.c linux/drivers/char/dtlk.c
--- linux-2.5.2-pre3/drivers/char/dtlk.c	Fri Nov 30 08:26:04 2001
+++ linux/drivers/char/dtlk.c	Sun Dec 30 11:38:10 2001
@@ -57,7 +57,6 @@
 #include <linux/errno.h>	/* for -EBUSY */
 #include <linux/ioport.h>	/* for check_region, request_region */
 #include <linux/delay.h>	/* for loops_per_jiffy */
-#include <asm/segment.h>	/* for put_user_byte */
 #include <asm/io.h>		/* for inb_p, outb_p, inb, outb, etc. */
 #include <asm/uaccess.h>	/* for get_user, etc. */
 #include <linux/wait.h>		/* for wait_queue */
diff -urN linux-2.5.2-pre3/drivers/char/epca.c linux/drivers/char/epca.c
--- linux-2.5.2-pre3/drivers/char/epca.c	Fri Oct 12 13:48:42 2001
+++ linux/drivers/char/epca.c	Sun Dec 30 11:38:10 2001
@@ -897,7 +897,6 @@
 					inline void copy_from_user(void * to, const void * from,
 					                          unsigned long count);
 
-					You must include <asm/segment.h>
 					I also think (Check hackers guide) that optimization must
 					be turned ON.  (Which sounds strange to me...)
 	
diff -urN linux-2.5.2-pre3/drivers/char/esp.c linux/drivers/char/esp.c
--- linux-2.5.2-pre3/drivers/char/esp.c	Fri Nov  9 14:01:21 2001
+++ linux/drivers/char/esp.c	Sun Dec 30 11:38:10 2001
@@ -60,7 +60,6 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 
 #include <asm/dma.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/RELEASE-NOTES linux/drivers/char/ftape/RELEASE-NOTES
--- linux-2.5.2-pre3/drivers/char/ftape/RELEASE-NOTES	Tue Dec 29 11:27:38 1998
+++ linux/drivers/char/ftape/RELEASE-NOTES	Sun Dec 30 11:38:10 2001
@@ -838,7 +838,6 @@
 - 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.
diff -urN linux-2.5.2-pre3/drivers/char/ftape/compressor/zftape-compress.c linux/drivers/char/ftape/compressor/zftape-compress.c
--- linux-2.5.2-pre3/drivers/char/ftape/compressor/zftape-compress.c	Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/ftape/compressor/zftape-compress.c	Sun Dec 30 11:38:10 2001
@@ -40,7 +40,6 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-buffer.c linux/drivers/char/ftape/lowlevel/ftape-buffer.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-buffer.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/ftape/lowlevel/ftape-buffer.c	Sun Dec 30 11:38:10 2001
@@ -24,7 +24,6 @@
  *  buffer.
  */
 
-#include <asm/segment.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-ctl.c linux/drivers/char/ftape/lowlevel/ftape-ctl.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-ctl.c	Tue Nov  7 11:09:19 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-ctl.c	Sun Dec 30 11:38:10 2001
@@ -36,7 +36,6 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #endif
 #include <asm/io.h>
 
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-io.c linux/drivers/char/ftape/lowlevel/ftape-io.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-io.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-io.c	Sun Dec 30 11:38:10 2001
@@ -29,7 +29,6 @@
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/ioctl.h>
 #include <linux/mtio.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-read.c linux/drivers/char/ftape/lowlevel/ftape-read.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-read.c	Tue Nov 25 14:45:27 1997
+++ linux/drivers/char/ftape/lowlevel/ftape-read.c	Sun Dec 30 11:38:10 2001
@@ -29,7 +29,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <asm/segment.h>
 
 #include <linux/ftape.h>
 #include <linux/qic117.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-setup.c linux/drivers/char/ftape/lowlevel/ftape-setup.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-setup.c	Thu Aug 12 11:53:22 1999
+++ linux/drivers/char/ftape/lowlevel/ftape-setup.c	Sun Dec 30 11:38:10 2001
@@ -29,7 +29,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <asm/segment.h>
 
 #include <linux/ftape.h>
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,16)
diff -urN linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-write.c linux/drivers/char/ftape/lowlevel/ftape-write.c
--- linux-2.5.2-pre3/drivers/char/ftape/lowlevel/ftape-write.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-write.c	Sun Dec 30 11:38:10 2001
@@ -28,7 +28,6 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <asm/segment.h>
 
 #include <linux/ftape.h>
 #include <linux/qic117.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-buffers.c linux/drivers/char/ftape/zftape/zftape-buffers.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-buffers.c	Fri Feb  9 11:30:22 2001
+++ linux/drivers/char/ftape/zftape/zftape-buffers.c	Sun Dec 30 11:38:10 2001
@@ -27,7 +27,6 @@
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <asm/segment.h>
 
 #include <linux/zftape.h>
 
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-ctl.c linux/drivers/char/ftape/zftape/zftape-ctl.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-ctl.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-ctl.c	Sun Dec 30 11:38:10 2001
@@ -36,7 +36,6 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-init.c linux/drivers/char/ftape/zftape/zftape-init.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-init.c	Fri Nov 30 12:33:17 2001
+++ linux/drivers/char/ftape/zftape/zftape-init.c	Sun Dec 30 11:38:10 2001
@@ -25,7 +25,6 @@
 #include <linux/errno.h>
 #include <linux/version.h>
 #include <linux/fs.h>
-#include <asm/segment.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/major.h>
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-read.c linux/drivers/char/ftape/zftape/zftape-read.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-read.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-read.c	Sun Dec 30 11:38:10 2001
@@ -32,7 +32,6 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-rw.c linux/drivers/char/ftape/zftape/zftape-rw.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-rw.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-rw.c	Sun Dec 30 11:38:10 2001
@@ -27,7 +27,6 @@
 #include <linux/config.h> /* for CONFIG_ZFT_DFLT_BLK_SZ */
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <asm/segment.h>
 
 #include <linux/zftape.h>
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-vtbl.c linux/drivers/char/ftape/zftape/zftape-vtbl.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-vtbl.c	Fri Apr  6 10:42:55 2001
+++ linux/drivers/char/ftape/zftape/zftape-vtbl.c	Sun Dec 30 11:38:10 2001
@@ -31,7 +31,6 @@
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <asm/segment.h>
 
 #include <linux/zftape.h>
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-write.c linux/drivers/char/ftape/zftape/zftape-write.c
--- linux-2.5.2-pre3/drivers/char/ftape/zftape/zftape-write.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-write.c	Sun Dec 30 11:38:10 2001
@@ -32,7 +32,6 @@
 #if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #endif
 
 #include "../zftape/zftape-init.h"
diff -urN linux-2.5.2-pre3/drivers/char/h8.c linux/drivers/char/h8.c
--- linux-2.5.2-pre3/drivers/char/h8.c	Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/h8.c	Sun Dec 30 11:38:10 2001
@@ -14,7 +14,6 @@
 #include <linux/module.h>
 
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 
 #include <linux/types.h>
diff -urN linux-2.5.2-pre3/drivers/char/i8k.c linux/drivers/char/i8k.c
--- linux-2.5.2-pre3/drivers/char/i8k.c	Fri Nov  2 17:46:47 2001
+++ linux/drivers/char/i8k.c	Sun Dec 30 11:38:10 2001
@@ -1,5 +1,7 @@
 /*
- * i8k.c -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ * i8k.c -- Linux driver for accessing the SMM BIOS on Dell laptops.
+ *	    See http://www.debian.org/~dz/i8k/ for more information
+ *	    and for latest version of this driver.
  *
  * Copyright (C) 2001  Massimo Dal Zotto <dz@debian.org>
  *
@@ -19,15 +21,13 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
-#include <asm/io.h>
+#include <linux/apm_bios.h>
 #include <asm/uaccess.h>
+#include <asm/io.h>
 
 #include <linux/i8k.h>
 
-#define I8K_VERSION		"1.1 02/11/2001"
-#define I8K_BIOS_SIGNATURE	"Dell System Inspiron 8000"
-#define I8K_BIOS_SIGNATURE_ADDR 0x000ec000
-#define I8K_BIOS_VERSION_OFFSET	32
+#define I8K_VERSION		"1.7 21/11/2001"
 
 #define I8K_SMM_FN_STATUS	0x0025
 #define I8K_SMM_POWER_STATUS	0x0069
@@ -35,31 +35,47 @@
 #define I8K_SMM_GET_FAN		0x00a3
 #define I8K_SMM_GET_SPEED	0x02a3
 #define I8K_SMM_GET_TEMP	0x10a3
+#define I8K_SMM_GET_DELL_SIG	0xffa3
 #define I8K_SMM_BIOS_VERSION	0x00a6
 
 #define I8K_FAN_MULT		30
 #define I8K_MAX_TEMP		127
 
-#define I8K_FN_NONE		0x08
-#define I8K_FN_UP		0x09
-#define I8K_FN_DOWN		0x0a
-#define I8K_FN_MUTE		0x0c
+#define I8K_FN_NONE		0x00
+#define I8K_FN_UP		0x01
+#define I8K_FN_DOWN		0x02
+#define I8K_FN_MUTE		0x04
+#define I8K_FN_MASK		0x07
+#define I8K_FN_SHIFT		8
 
 #define I8K_POWER_AC		0x05
 #define I8K_POWER_BATTERY	0x01
 
 #define I8K_TEMPERATURE_BUG	1
 
-static char bios_version[4] = "?";
-static char bios_machine_id[16] = "?";
+#define DELL_SIGNATURE		"Dell Computer"
+
+static char *supported_models[] = {
+    "Inspiron",
+    "Latitude",
+    NULL
+};
+
+static char system_vendor[48] = "?";
+static char product_name [48] = "?";
+static char bios_version [4]  = "?";
+static char serial_number[16] = "?";
 
 int force = 0;
+int power_status = 0;
 
 MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
-MODULE_DESCRIPTION("Driver for accessing the SMM BIOS on Dell I8000 laptops");
+MODULE_DESCRIPTION("Driver for accessing SMM BIOS on Dell laptops");
 MODULE_LICENSE("GPL");
 MODULE_PARM(force, "i");
-MODULE_PARM_DESC(force, "Force loading without checking for an Inspiron 8000");
+MODULE_PARM(power_status, "i");
+MODULE_PARM_DESC(force, "Force loading without checking for supported models");
+MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
 
 static ssize_t i8k_read(struct file *, char *, size_t, loff_t *);
 static int i8k_ioctl(struct inode *, struct file *, unsigned int,
@@ -79,12 +95,19 @@
     unsigned int edi __attribute__ ((packed));
 } SMMRegisters;
 
+typedef struct {
+    u8	type;
+    u8	length;
+    u16	handle;
+} DMIHeader;
+
 /*
- * Call the System Management Mode BIOS.
+ * Call the System Management Mode BIOS. Code provided by Jonathan Buzzard.
  */
 static int i8k_smm(SMMRegisters *regs)
 {
     int rc;
+    int eax = regs->eax;
 
     asm("pushl %%eax\n\t" \
 	"movl 0(%%eax),%%edx\n\t" \
@@ -112,7 +135,7 @@
 	: "a" (regs)
 	: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
 
-    if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff)) {
+    if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff) || (regs->eax == eax)) {
 	return -EINVAL;
     }
 
@@ -137,11 +160,12 @@
 }
 
 /*
- * Read the machine id. Not yet implemented.
+ * Read the machine id.
  */
-static int i8k_get_machine_id(unsigned char *buff)
+static int i8k_get_serial_number(unsigned char *buff)
 {
-    return -EINVAL;
+    strncpy(buff, serial_number, 16);
+    return 0;
 }
 
 /*
@@ -157,7 +181,7 @@
 	return rc;
     }
 
-    switch ((regs.eax & 0xff00) >> 8) {
+    switch ((regs.eax >> I8K_FN_SHIFT) & I8K_FN_MASK) {
     case I8K_FN_UP:
 	return I8K_VOL_UP;
     case I8K_FN_DOWN:
@@ -281,6 +305,23 @@
     return temp;
 }
 
+static int i8k_get_dell_signature(void)
+{
+    SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+    int rc;
+
+    regs.eax = I8K_SMM_GET_DELL_SIG;
+    if ((rc=i8k_smm(&regs)) < 0) {
+	return rc;
+    }
+
+    if ((regs.eax == 1145651527) && (regs.edx == 1145392204)) {
+	return 0;
+    } else {
+	return -1;
+    }
+}
+
 static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
 		     unsigned long arg)
 {
@@ -299,7 +340,7 @@
 
     case I8K_MACHINE_ID:
 	memset(buff, 0, 16);
-	val = i8k_get_machine_id(buff);
+	val = i8k_get_serial_number(buff);
 	break;
 
     case I8K_FN_STATUS:
@@ -375,13 +416,17 @@
     int n, fn_key, cpu_temp, ac_power;
     int left_fan, right_fan, left_speed, right_speed;
 
-    cpu_temp    = i8k_get_cpu_temp();
-    left_fan    = i8k_get_fan_status(I8K_FAN_LEFT);
-    right_fan   = i8k_get_fan_status(I8K_FAN_RIGHT);
-    left_speed  = i8k_get_fan_speed(I8K_FAN_LEFT);
-    right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT);
-    ac_power    = i8k_get_power_status();
-    fn_key      = i8k_get_fn_status();
+    cpu_temp     = i8k_get_cpu_temp();			/* 11100 µs */
+    left_fan     = i8k_get_fan_status(I8K_FAN_LEFT);	/*   580 µs */
+    right_fan    = i8k_get_fan_status(I8K_FAN_RIGHT);	/*   580 µs */
+    left_speed   = i8k_get_fan_speed(I8K_FAN_LEFT);	/*   580 µs */
+    right_speed  = i8k_get_fan_speed(I8K_FAN_RIGHT);	/*   580 µs */
+    fn_key       = i8k_get_fn_status();			/*   750 µs */
+    if (power_status) {
+	ac_power = i8k_get_power_status();		/* 14700 µs */
+    } else {
+	ac_power = -1;
+    }
 
     /*
      * Info:
@@ -400,7 +445,7 @@
     n = sprintf(buffer, "%s %s %s %d %d %d %d %d %d %d\n",
 		I8K_PROC_FMT,
 		bios_version,
-		bios_machine_id,
+		serial_number,
 		cpu_temp,
 		left_fan,
 		right_fan,
@@ -438,76 +483,253 @@
     return len;
 }
 
+static char* __init string_trim(char *s, int size)
+{
+    int len;
+    char *p;
+
+    if ((len = strlen(s)) > size) {
+	len = size;
+    }
+
+    for (p=s+len-1; len && (*p==' '); len--,p--) {
+	*p = '\0';
+    }
+
+    return s;
+}
+
+/* DMI code, stolen from arch/i386/kernel/dmi_scan.c */
+
 /*
- * Probe for the presence of an Inspiron I8000.
+ * |<-- dmi->length -->|
+ * |                   |
+ * |dmi header    s=N  | string1,\0, ..., stringN,\0, ..., \0
+ *                |                       |
+ *                +-----------------------+
  */
-static int i8k_probe(void)
+static char* __init dmi_string(DMIHeader *dmi, u8 s)
 {
-    unsigned char *buff, *p;
-    unsigned char bios_vers[4];
-    int version;
+    u8 *p;
+
+    if (!s) {
+	return "";
+    }
+    s--;
+
+    p = (u8 *)dmi + dmi->length;
+    while (s > 0) {
+	p += strlen(p);
+	p++;
+	s--;
+    }
+
+    return p;
+}
+
+static void __init dmi_decode(DMIHeader *dmi)
+{
+    u8 *data = (u8 *) dmi;
+    char *p;
+
+#ifdef I8K_DEBUG
+    int i;
+    printk("%08x ", (int)data);
+    for (i=0; i<data[1] && i<64; i++) {
+	printk("%02x ", data[i]);
+    }
+    printk("\n");
+#endif
+
+    switch (dmi->type) {
+    case  0:	/* BIOS Information */
+	p = dmi_string(dmi,data[5]);
+	if (*p) {
+	    strncpy(bios_version, p, sizeof(bios_version));
+	    string_trim(bios_version, sizeof(bios_version));
+	}
+	break;	
+    case 1:	/* System Information */
+	p = dmi_string(dmi,data[4]);
+	if (*p) {
+	    strncpy(system_vendor, p, sizeof(system_vendor));
+	    string_trim(system_vendor, sizeof(system_vendor));
+	}
+	p = dmi_string(dmi,data[5]);
+	if (*p) {
+	    strncpy(product_name, p, sizeof(product_name));
+	    string_trim(product_name, sizeof(product_name));
+	}
+	p = dmi_string(dmi,data[7]);
+	if (*p) {
+	    strncpy(serial_number, p, sizeof(serial_number));
+	    string_trim(serial_number, sizeof(serial_number));
+	}
+	break;
+    }
+}
+
+static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*))
+{
+    u8 *buf;
+    u8 *data;
+    DMIHeader *dmi;
+    int i = 1;
+
+    buf = ioremap(base, len);
+    if (buf == NULL) {
+	return -1;
+    }
+    data = buf;
 
     /*
-     * Until Dell tell us how to reliably check for an Inspiron system
-     * look for a signature at a fixed location in the BIOS memory.
-     * Ugly but safe.
+     * Stop when we see al the items the table claimed to have
+     * or we run off the end of the table (also happens)
      */
-    if (!force) {
-	buff = ioremap(I8K_BIOS_SIGNATURE_ADDR, I8K_BIOS_VERSION_OFFSET+4);
-	if (buff == NULL) {
-	    printk("i8k: ioremap failed\n");
-	    return -ENODEV;
+    while ((i<num) && ((data-buf) < len)) {
+	dmi = (DMIHeader *)data;
+	/*
+	 * Avoid misparsing crud if the length of the last
+	 * record is crap
+	 */
+	if ((data-buf+dmi->length) >= len) {
+	    break;
+	}
+	fn(dmi);
+	data += dmi->length;
+	/*
+	 * Don't go off the end of the data if there is
+	 * stuff looking like string fill past the end
+	 */
+	while (((data-buf) < len) && (*data || data[1])) {
+	    data++;
 	}
-	if (strncmp(buff,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE)) != 0) {
-	    printk("i8k: Inspiron 8000 BIOS signature not found\n");
-	    iounmap(buff);
-	    return -ENODEV;
+	data += 2;
+	i++;
+    }
+    iounmap(buf);
+
+    return 0;
+}
+
+static int __init dmi_iterate(void (*decode)(DMIHeader *))
+{
+    unsigned char buf[20];
+    long fp = 0x000e0000L;
+    fp -= 16;
+
+    while (fp < 0x000fffffL) {
+	fp += 16;
+	isa_memcpy_fromio(buf, fp, 20);
+	if (memcmp(buf, "_DMI_", 5)==0) {
+	    u16 num  = buf[13]<<8  | buf[12];
+	    u16 len  = buf [7]<<8  | buf [6];
+	    u32 base = buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8];
+#ifdef I8K_DEBUG
+	    printk(KERN_INFO "DMI %d.%d present.\n",
+		   buf[14]>>4, buf[14]&0x0F);
+	    printk(KERN_INFO "%d structures occupying %d bytes.\n",
+		   buf[13]<<8 | buf[12],
+		   buf [7]<<8 | buf[6]);
+	    printk(KERN_INFO "DMI table at 0x%08X.\n",
+		   buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
+#endif
+	    if (dmi_table(base, len, num, decode)==0) {
+		return 0;
+	    }
 	}
-	strncpy(bios_vers, buff+I8K_BIOS_VERSION_OFFSET, 3);
-	bios_vers[3] = '\0';
-	iounmap(buff);
-    }
-    if (force >= 2) {
-	buff = ioremap(0x000c0000, 0x00100000-0x000c0000);
-	if (buff == NULL) {
-	    printk("i8k: ioremap failed\n");
+    }
+    return -1;
+}
+/* end of DMI code */
+
+/*
+ * Get DMI information.
+ */
+static int __init i8k_dmi_probe(void)
+{
+    char **p;
+
+    if (dmi_iterate(dmi_decode) != 0) {
+	printk(KERN_INFO "i8k: unable to get DMI information\n");
+	return -ENODEV;
+    }
+
+    if (strncmp(system_vendor,DELL_SIGNATURE,strlen(DELL_SIGNATURE)) != 0) {
+	printk(KERN_INFO "i8k: not running on a Dell system\n");
+	return -ENODEV;
+    }
+
+    for (p=supported_models; ; p++) {
+	if (!*p) {
+	    printk(KERN_INFO "i8k: unsupported model: %s\n", product_name);
 	    return -ENODEV;
 	}
-	for (p=buff; (p-buff)<(0x00100000-0x000c0000); p+=16) {
-	    if (strncmp(p,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE))==0) {
-		printk("i8k: Inspiron 8000 BIOS signature found at %08x\n",
-		       0x000c0000+(p-buff));
-		break;
-	    }
+	if (strncmp(product_name,*p,strlen(*p)) == 0) {
+	    break;
 	}
-	iounmap(buff);
     }
 
+    return 0;
+}
+
+/*
+ * Probe for the presence of a supported laptop.
+ */
+static int __init i8k_probe(void)
+{
+    char buff[4];
+    int version;
+    int smm_found = 0;
+
     /*
-     * Next try to get the BIOS version with an SMM call. If this
-     * fails SMM can't be reliably used on this system.
+     * Get DMI information
      */
-    version = i8k_get_bios_version();
-    if (version <= 0) {
-	printk("i8k: unable to get BIOS version\n");
-	return -ENODEV;
+    if (i8k_dmi_probe() != 0) {
+	printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
+	       system_vendor, product_name, bios_version);
     }
-    bios_version[0] = (version >> 16) & 0xff;
-    bios_version[1] = (version >>  8) & 0xff;
-    bios_version[2] = (version)       & 0xff;
-    bios_version[3] = '\0';
 
     /*
-     * Finally check if the two versions match.
+     * Get SMM Dell signature
      */
-    if (!force) {
-	if (strncmp(bios_version,bios_vers,sizeof(bios_version)) != 0) {
-	    printk("i8k: BIOS version mismatch: %s != %s\n",
-		   bios_version, bios_vers);
-	    return -ENODEV;
+    if (i8k_get_dell_signature() != 0) {
+	printk(KERN_INFO "i8k: unable to get SMM Dell signature\n");
+    } else {
+	smm_found = 1;
+    }
+
+    /*
+     * Get SMM BIOS version.
+     */
+    version = i8k_get_bios_version();
+    if (version <= 0) {
+	printk(KERN_INFO "i8k: unable to get SMM BIOS version\n");
+    } else {
+	smm_found = 1;
+	buff[0] = (version >> 16) & 0xff;
+	buff[1] = (version >>  8) & 0xff;
+	buff[2] = (version)       & 0xff;
+	buff[3] = '\0';
+	/*
+	 * If DMI BIOS version is unknown use SMM BIOS version.
+	 */
+	if (bios_version[0] == '?') {
+	    strcpy(bios_version, buff);
+	}
+	/*
+	 * Check if the two versions match.
+	 */
+	if (strncmp(buff,bios_version,sizeof(bios_version)) != 0) {
+	    printk(KERN_INFO "i8k: BIOS version mismatch: %s != %s\n",
+		   buff, bios_version);
 	}
     }
 
+    if (!smm_found && !force) {
+	return -ENODEV;
+    }
+
     return 0;
 }
 
@@ -518,7 +740,7 @@
 {
     struct proc_dir_entry *proc_i8k;
 
-    /* Are we running on an Inspiron 8000 laptop? */
+    /* Are we running on an supported laptop? */
     if (i8k_probe() != 0) {
 	return -ENODEV;
     }
@@ -532,7 +754,7 @@
     SET_MODULE_OWNER(proc_i8k);
 
     printk(KERN_INFO
-	   "Inspiron 8000 SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n",
+	   "Dell laptop SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n",
 	   I8K_VERSION);
 
     return 0;
diff -urN linux-2.5.2-pre3/drivers/char/ip2main.c linux/drivers/char/ip2main.c
--- linux-2.5.2-pre3/drivers/char/ip2main.c	Fri Nov  2 17:26:17 2001
+++ linux/drivers/char/ip2main.c	Sun Dec 30 11:38:10 2001
@@ -142,7 +142,6 @@
 // so blame them.
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,4)
-#	include <asm/segment.h>
 #	define GET_USER(error,value,addr) error = get_user(value,addr)
 #	define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
 #	define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -urN linux-2.5.2-pre3/drivers/char/isicom.c linux/drivers/char/isicom.c
--- linux-2.5.2-pre3/drivers/char/isicom.c	Fri Nov  9 14:01:21 2001
+++ linux/drivers/char/isicom.c	Sun Dec 30 11:38:10 2001
@@ -51,7 +51,6 @@
 #include <linux/timer.h>
 #include <linux/ioport.h>
 
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.5.2-pre3/drivers/char/moxa.c linux/drivers/char/moxa.c
--- linux-2.5.2-pre3/drivers/char/moxa.c	Thu Oct 25 13:53:47 2001
+++ linux/drivers/char/moxa.c	Sun Dec 30 11:38:10 2001
@@ -53,7 +53,6 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.5.2-pre3/drivers/char/mxser.c linux/drivers/char/mxser.c
--- linux-2.5.2-pre3/drivers/char/mxser.c	Thu Oct 25 13:53:47 2001
+++ linux/drivers/char/mxser.c	Sun Dec 30 11:38:10 2001
@@ -58,7 +58,6 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.5.2-pre3/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
--- linux-2.5.2-pre3/drivers/char/n_hdlc.c	Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/n_hdlc.c	Sun Dec 30 11:38:10 2001
@@ -112,7 +112,6 @@
 #include <linux/kerneld.h>
 #endif
 
-#include <asm/segment.h>
 #define GET_USER(error,value,addr) error = get_user(value,addr)
 #define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
 #define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -urN linux-2.5.2-pre3/drivers/char/pc110pad.c linux/drivers/char/pc110pad.c
--- linux-2.5.2-pre3/drivers/char/pc110pad.c	Wed Nov 28 21:46:03 2001
+++ linux/drivers/char/pc110pad.c	Sun Dec 30 11:38:10 2001
@@ -590,7 +590,7 @@
 	spin_lock_irqsave(&pc110_lock, flags);
 	if (!--active_count)
 		outb(0x30, current_params.io+2);  /* switch off digitiser */
-	spin_unlock_irqrestore(&active_lock, flags);	
+	spin_unlock_irqrestore(&pc110_lock, flags);	
 	return 0;
 }
 
diff -urN linux-2.5.2-pre3/drivers/char/serial167.c linux/drivers/char/serial167.c
--- linux-2.5.2-pre3/drivers/char/serial167.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/char/serial167.c	Sun Dec 30 11:38:10 2001
@@ -65,7 +65,6 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/mvme16xhw.h>
 #include <asm/bootinfo.h>
diff -urN linux-2.5.2-pre3/drivers/char/synclink.c linux/drivers/char/synclink.c
--- linux-2.5.2-pre3/drivers/char/synclink.c	Fri Sep 14 14:39:59 2001
+++ linux/drivers/char/synclink.c	Sun Dec 30 11:38:10 2001
@@ -114,7 +114,6 @@
 #endif
 #endif
 
-#include <asm/segment.h>
 #define GET_USER(error,value,addr) error = get_user(value,addr)
 #define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
 #define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -urN linux-2.5.2-pre3/drivers/ieee1394/ohci1394.c linux/drivers/ieee1394/ohci1394.c
--- linux-2.5.2-pre3/drivers/ieee1394/ohci1394.c	Mon Oct  1 21:24:24 2001
+++ linux/drivers/ieee1394/ohci1394.c	Sun Dec 30 11:38:10 2001
@@ -99,7 +99,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 #include <linux/vmalloc.h>
diff -urN linux-2.5.2-pre3/drivers/ieee1394/video1394.c linux/drivers/ieee1394/video1394.c
--- linux-2.5.2-pre3/drivers/ieee1394/video1394.c	Mon Oct  1 21:24:25 2001
+++ linux/drivers/ieee1394/video1394.c	Sun Dec 30 11:38:10 2001
@@ -43,7 +43,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 #include <linux/vmalloc.h>
diff -urN linux-2.5.2-pre3/drivers/input/joydev.c linux/drivers/input/joydev.c
--- linux-2.5.2-pre3/drivers/input/joydev.c	Fri Nov 30 08:26:04 2001
+++ linux/drivers/input/joydev.c	Sun Dec 30 11:38:10 2001
@@ -31,7 +31,6 @@
 
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/joystick.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/act2000/act2000.h linux/drivers/isdn/act2000/act2000.h
--- linux-2.5.2-pre3/drivers/isdn/act2000/act2000.h	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/act2000/act2000.h	Sun Dec 30 11:38:10 2001
@@ -68,7 +68,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/avmb1/capidrv.c linux/drivers/isdn/avmb1/capidrv.c
--- linux-2.5.2-pre3/drivers/isdn/avmb1/capidrv.c	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/avmb1/capidrv.c	Sun Dec 30 11:38:10 2001
@@ -29,7 +29,6 @@
 #include <linux/kernelcapi.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
-#include <asm/segment.h>
 
 #include "capiutil.h"
 #include "capicmd.h"
diff -urN linux-2.5.2-pre3/drivers/isdn/avmb1/capiutil.c linux/drivers/isdn/avmb1/capiutil.c
--- linux-2.5.2-pre3/drivers/isdn/avmb1/capiutil.c	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/avmb1/capiutil.c	Sun Dec 30 11:38:11 2001
@@ -17,7 +17,6 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <asm/segment.h>
 #include <linux/config.h>
 #include "capiutil.h"
 
diff -urN linux-2.5.2-pre3/drivers/isdn/avmb1/kcapi.c linux/drivers/isdn/avmb1/kcapi.c
--- linux-2.5.2-pre3/drivers/isdn/avmb1/kcapi.c	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/avmb1/kcapi.c	Sun Dec 30 11:38:11 2001
@@ -17,7 +17,6 @@
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
-#include <asm/segment.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
 #include <linux/tqueue.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/eicon/eicon.h linux/drivers/isdn/eicon/eicon.h
--- linux-2.5.2-pre3/drivers/isdn/eicon/eicon.h	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/eicon/eicon.h	Sun Dec 30 11:38:11 2001
@@ -123,7 +123,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/eicon/lincfg.c linux/drivers/isdn/eicon/lincfg.c
--- linux-2.5.2-pre3/drivers/isdn/eicon/lincfg.c	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/eicon/lincfg.c	Sun Dec 30 11:38:11 2001
@@ -11,7 +11,6 @@
 #include <linux/fs.h>
 #undef N_DATA   /* Because we have our own definition */
 
-#include <asm/segment.h>
 #include <asm/io.h>
 
 #include "sys.h"
diff -urN linux-2.5.2-pre3/drivers/isdn/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h
--- linux-2.5.2-pre3/drivers/isdn/hisax/hisax.h	Sun Sep 30 12:26:05 2001
+++ linux/drivers/isdn/hisax/hisax.h	Sun Dec 30 11:38:11 2001
@@ -10,7 +10,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/icn/icn.h linux/drivers/isdn/icn/icn.h
--- linux-2.5.2-pre3/drivers/isdn/icn/icn.h	Sun Sep 30 12:26:06 2001
+++ linux/drivers/isdn/icn/icn.h	Sun Dec 30 11:38:11 2001
@@ -39,7 +39,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/isdn_bsdcomp.c linux/drivers/isdn/isdn_bsdcomp.c
--- linux-2.5.2-pre3/drivers/isdn/isdn_bsdcomp.c	Sun Sep 30 12:26:06 2001
+++ linux/drivers/isdn/isdn_bsdcomp.c	Sun Dec 30 11:38:11 2001
@@ -71,7 +71,6 @@
 
 #include <asm/system.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/byteorder.h>
 #include <asm/types.h>
 
diff -urN linux-2.5.2-pre3/drivers/isdn/isdnloop/isdnloop.h linux/drivers/isdn/isdnloop/isdnloop.h
--- linux-2.5.2-pre3/drivers/isdn/isdnloop/isdnloop.h	Sun Sep 30 12:26:06 2001
+++ linux/drivers/isdn/isdnloop/isdnloop.h	Sun Dec 30 11:38:11 2001
@@ -37,7 +37,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.5.2-pre3/drivers/isdn/sc/includes.h linux/drivers/isdn/sc/includes.h
--- linux-2.5.2-pre3/drivers/isdn/sc/includes.h	Sun Sep 30 12:26:06 2001
+++ linux/drivers/isdn/sc/includes.h	Sun Dec 30 11:38:11 2001
@@ -6,7 +6,6 @@
 
 #include <linux/version.h>
 #include <linux/errno.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
diff -urN linux-2.5.2-pre3/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- linux-2.5.2-pre3/drivers/macintosh/macserial.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/macintosh/macserial.c	Sun Dec 30 11:38:11 2001
@@ -38,7 +38,6 @@
 #include <asm/irq.h>
 #include <asm/prom.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/feature.h>
 #include <linux/adb.h>
diff -urN linux-2.5.2-pre3/drivers/md/lvm.c linux/drivers/md/lvm.c
--- linux-2.5.2-pre3/drivers/md/lvm.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/md/lvm.c	Sun Dec 30 11:38:11 2001
@@ -212,7 +212,6 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 #include <asm/ioctl.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_KERNELD
diff -urN linux-2.5.2-pre3/drivers/md/md.c linux/drivers/md/md.c
--- linux-2.5.2-pre3/drivers/md/md.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/md/md.c	Sun Dec 30 11:38:11 2001
@@ -4042,4 +4042,4 @@
 EXPORT_SYMBOL(mddev_map);
 EXPORT_SYMBOL(md_check_ordering);
 EXPORT_SYMBOL(get_spare);
-
+MODULE_LICENSE("GPL");
diff -urN linux-2.5.2-pre3/drivers/media/video/adv7175.c linux/drivers/media/video/adv7175.c
--- linux-2.5.2-pre3/drivers/media/video/adv7175.c	Sun Sep 30 12:26:06 2001
+++ linux/drivers/media/video/adv7175.c	Sun Dec 30 11:38:11 2001
@@ -38,7 +38,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 
diff -urN linux-2.5.2-pre3/drivers/media/video/bt856.c linux/drivers/media/video/bt856.c
--- linux-2.5.2-pre3/drivers/media/video/bt856.c	Sun Sep 30 12:26:06 2001
+++ linux/drivers/media/video/bt856.c	Sun Dec 30 11:38:11 2001
@@ -40,7 +40,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 
diff -urN linux-2.5.2-pre3/drivers/media/video/bttv-driver.c linux/drivers/media/video/bttv-driver.c
--- linux-2.5.2-pre3/drivers/media/video/bttv-driver.c	Wed Oct 17 14:19:20 2001
+++ linux/drivers/media/video/bttv-driver.c	Sun Dec 30 11:38:11 2001
@@ -37,7 +37,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 #include <linux/interrupt.h>
diff -urN linux-2.5.2-pre3/drivers/media/video/saa7185.c linux/drivers/media/video/saa7185.c
--- linux-2.5.2-pre3/drivers/media/video/saa7185.c	Sun Sep 30 12:26:06 2001
+++ linux/drivers/media/video/saa7185.c	Sun Dec 30 11:38:11 2001
@@ -36,7 +36,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 
diff -urN linux-2.5.2-pre3/drivers/media/video/stradis.c linux/drivers/media/video/stradis.c
--- linux-2.5.2-pre3/drivers/media/video/stradis.c	Thu Dec  6 14:07:57 2001
+++ linux/drivers/media/video/stradis.c	Sun Dec 30 11:38:11 2001
@@ -37,7 +37,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <asm/types.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
diff -urN linux-2.5.2-pre3/drivers/media/video/zr36067.c linux/drivers/media/video/zr36067.c
--- linux-2.5.2-pre3/drivers/media/video/zr36067.c	Fri Nov  9 14:01:22 2001
+++ linux/drivers/media/video/zr36067.c	Sun Dec 30 11:38:11 2001
@@ -58,7 +58,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 #include <linux/wrapper.h>
 
diff -urN linux-2.5.2-pre3/drivers/media/video/zr36120.c linux/drivers/media/video/zr36120.c
--- linux-2.5.2-pre3/drivers/media/video/zr36120.c	Fri Nov  9 14:01:22 2001
+++ linux/drivers/media/video/zr36120.c	Sun Dec 30 11:38:11 2001
@@ -35,7 +35,6 @@
 #include <asm/page.h>
 #include <linux/sched.h>
 #include <linux/video_decoder.h>
-#include <asm/segment.h>
 
 #include <linux/version.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.2-pre3/drivers/mtd/devices/doc1000.c linux/drivers/mtd/devices/doc1000.c
--- linux-2.5.2-pre3/drivers/mtd/devices/doc1000.c	Thu Oct  4 15:14:59 2001
+++ linux/drivers/mtd/devices/doc1000.c	Sun Dec 30 11:38:11 2001
@@ -20,7 +20,6 @@
 #include <linux/ioctl.h>
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <stdarg.h>
 #include <linux/delay.h>
 #include <linux/init.h>
diff -urN linux-2.5.2-pre3/drivers/mtd/devices/pmc551.c linux/drivers/mtd/devices/pmc551.c
--- linux-2.5.2-pre3/drivers/mtd/devices/pmc551.c	Thu Oct  4 15:14:59 2001
+++ linux/drivers/mtd/devices/pmc551.c	Sun Dec 30 11:38:11 2001
@@ -98,7 +98,6 @@
 #include <linux/ioctl.h>
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <stdarg.h>
 #include <linux/pci.h>
 
diff -urN linux-2.5.2-pre3/drivers/mtd/devices/slram.c linux/drivers/mtd/devices/slram.c
--- linux-2.5.2-pre3/drivers/mtd/devices/slram.c	Thu Oct  4 15:14:59 2001
+++ linux/drivers/mtd/devices/slram.c	Sun Dec 30 11:38:11 2001
@@ -20,7 +20,6 @@
 #include <linux/init.h>
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <stdarg.h>
 
 #include <linux/mtd/mtd.h>
diff -urN linux-2.5.2-pre3/drivers/net/hamradio/bpqether.c linux/drivers/net/hamradio/bpqether.c
--- linux-2.5.2-pre3/drivers/net/hamradio/bpqether.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/hamradio/bpqether.c	Sun Dec 30 11:38:11 2001
@@ -69,7 +69,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/drivers/net/hamradio/dmascc.c linux/drivers/net/hamradio/dmascc.c
--- linux-2.5.2-pre3/drivers/net/hamradio/dmascc.c	Wed Apr 18 14:40:06 2001
+++ linux/drivers/net/hamradio/dmascc.c	Sun Dec 30 11:38:11 2001
@@ -43,7 +43,6 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <net/ax25.h>
 #include "z8530.h"
diff -urN linux-2.5.2-pre3/drivers/net/hamradio/mkiss.c linux/drivers/net/hamradio/mkiss.c
--- linux-2.5.2-pre3/drivers/net/hamradio/mkiss.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/hamradio/mkiss.c	Sun Dec 30 11:38:11 2001
@@ -27,7 +27,6 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
diff -urN linux-2.5.2-pre3/drivers/net/hamradio/soundmodem/sm_sbc.c linux/drivers/net/hamradio/soundmodem/sm_sbc.c
--- linux-2.5.2-pre3/drivers/net/hamradio/soundmodem/sm_sbc.c	Tue Jul 18 16:55:19 2000
+++ linux/drivers/net/hamradio/soundmodem/sm_sbc.c	Sun Dec 30 11:38:11 2001
@@ -50,7 +50,6 @@
 #if LINUX_VERSION_CODE >= 0x20100
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #include <linux/mm.h>
 
 #undef put_user
diff -urN linux-2.5.2-pre3/drivers/net/hamradio/soundmodem/sm_wss.c linux/drivers/net/hamradio/soundmodem/sm_wss.c
--- linux-2.5.2-pre3/drivers/net/hamradio/soundmodem/sm_wss.c	Wed Jun 27 17:10:55 2001
+++ linux/drivers/net/hamradio/soundmodem/sm_wss.c	Sun Dec 30 11:38:11 2001
@@ -49,7 +49,6 @@
 #if LINUX_VERSION_CODE >= 0x20100
 #include <asm/uaccess.h>
 #else
-#include <asm/segment.h>
 #include <linux/mm.h>
 
 #undef put_user
diff -urN linux-2.5.2-pre3/drivers/net/irda/irtty.c linux/drivers/net/irda/irtty.c
--- linux-2.5.2-pre3/drivers/net/irda/irtty.c	Sun Sep 30 12:26:06 2001
+++ linux/drivers/net/irda/irtty.c	Sun Dec 30 11:38:11 2001
@@ -32,7 +32,6 @@
 #include <linux/if_arp.h>
 #include <linux/rtnetlink.h>
 
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 #include <net/irda/irda.h>
diff -urN linux-2.5.2-pre3/drivers/net/jazzsonic.c linux/drivers/net/jazzsonic.c
--- linux-2.5.2-pre3/drivers/net/jazzsonic.c	Sun Sep  9 10:43:01 2001
+++ linux/drivers/net/jazzsonic.c	Sun Dec 30 11:38:11 2001
@@ -29,7 +29,6 @@
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/jazz.h>
diff -urN linux-2.5.2-pre3/drivers/net/macsonic.c linux/drivers/net/macsonic.c
--- linux-2.5.2-pre3/drivers/net/macsonic.c	Tue Oct 16 21:56:29 2001
+++ linux/drivers/net/macsonic.c	Sun Dec 30 11:38:11 2001
@@ -40,7 +40,6 @@
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <asm/hwtest.h>
 #include <asm/dma.h>
diff -urN linux-2.5.2-pre3/drivers/net/pcmcia/fmvj18x_cs.c linux/drivers/net/pcmcia/fmvj18x_cs.c
--- linux-2.5.2-pre3/drivers/net/pcmcia/fmvj18x_cs.c	Tue Nov 13 09:02:30 2001
+++ linux/drivers/net/pcmcia/fmvj18x_cs.c	Sun Dec 30 11:38:11 2001
@@ -1247,3 +1247,4 @@
     }
     restore_flags(flags);
 }
+MODULE_LICENSE("GPL");
diff -urN linux-2.5.2-pre3/drivers/net/sgiseeq.c linux/drivers/net/sgiseeq.c
--- linux-2.5.2-pre3/drivers/net/sgiseeq.c	Thu Apr 12 12:15:25 2001
+++ linux/drivers/net/sgiseeq.c	Sun Dec 30 11:38:11 2001
@@ -16,7 +16,6 @@
 #include <linux/delay.h>
 
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/page.h>
diff -urN linux-2.5.2-pre3/drivers/net/strip.c linux/drivers/net/strip.c
--- linux-2.5.2-pre3/drivers/net/strip.c	Fri Nov  9 14:02:24 2001
+++ linux/drivers/net/strip.c	Sun Dec 30 11:38:11 2001
@@ -87,7 +87,6 @@
 #include <linux/init.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 
 /*
diff -urN linux-2.5.2-pre3/drivers/net/wan/lapbether.c linux/drivers/net/wan/lapbether.c
--- linux-2.5.2-pre3/drivers/net/wan/lapbether.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/lapbether.c	Sun Dec 30 11:38:11 2001
@@ -32,7 +32,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_main.c linux/drivers/net/wan/lmc/lmc_main.c
--- linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_main.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/lmc/lmc_main.c	Sun Dec 30 11:38:11 2001
@@ -50,7 +50,6 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <asm/segment.h>
 #include <linux/init.h>
 
 #if LINUX_VERSION_CODE < 0x20155
diff -urN linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_media.c linux/drivers/net/wan/lmc/lmc_media.c
--- linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_media.c	Tue Mar  6 19:44:36 2001
+++ linux/drivers/net/wan/lmc/lmc_media.c	Sun Dec 30 11:38:11 2001
@@ -12,7 +12,6 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
-#include <asm/segment.h>
 //#include <asm/smp.h>
 
 #if LINUX_VERSION_CODE < 0x20155
diff -urN linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_proto.c linux/drivers/net/wan/lmc/lmc_proto.c
--- linux-2.5.2-pre3/drivers/net/wan/lmc/lmc_proto.c	Tue Mar  6 19:44:36 2001
+++ linux/drivers/net/wan/lmc/lmc_proto.c	Sun Dec 30 11:38:11 2001
@@ -30,7 +30,6 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
-#include <asm/segment.h>
 #include <asm/smp.h>
 
 #include <linux/in.h>
diff -urN linux-2.5.2-pre3/drivers/net/wan/sdla_chdlc.c linux/drivers/net/wan/sdla_chdlc.c
--- linux-2.5.2-pre3/drivers/net/wan/sdla_chdlc.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/sdla_chdlc.c	Sun Dec 30 11:38:11 2001
@@ -65,7 +65,6 @@
  #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
 
diff -urN linux-2.5.2-pre3/drivers/net/wan/sdla_fr.c linux/drivers/net/wan/sdla_fr.c
--- linux-2.5.2-pre3/drivers/net/wan/sdla_fr.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/sdla_fr.c	Sun Dec 30 11:38:11 2001
@@ -169,7 +169,6 @@
  #include <linux/netdevice.h>
 
 #else
- #include <asm/segment.h>
 #endif
 
 #include <net/route.h>          	/* Dynamic Route Creation */
diff -urN linux-2.5.2-pre3/drivers/net/wan/sdla_ppp.c linux/drivers/net/wan/sdla_ppp.c
--- linux-2.5.2-pre3/drivers/net/wan/sdla_ppp.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/sdla_ppp.c	Sun Dec 30 11:38:11 2001
@@ -111,7 +111,6 @@
  #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
 
diff -urN linux-2.5.2-pre3/drivers/net/wan/sdla_x25.c linux/drivers/net/wan/sdla_x25.c
--- linux-2.5.2-pre3/drivers/net/wan/sdla_x25.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/sdla_x25.c	Sun Dec 30 11:38:11 2001
@@ -98,7 +98,6 @@
 #if defined(LINUX_2_1) || defined(LINUX_2_4)
  #include <asm/uaccess.h>
 #else
- #include <asm/segment.h>
  #include <net/route.h>
 #endif
 
diff -urN linux-2.5.2-pre3/drivers/net/wan/sdlamain.c linux/drivers/net/wan/sdlamain.c
--- linux-2.5.2-pre3/drivers/net/wan/sdlamain.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/net/wan/sdlamain.c	Sun Dec 30 11:38:11 2001
@@ -78,7 +78,6 @@
 
 #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
diff -urN linux-2.5.2-pre3/drivers/net/wireless/airo.c linux/drivers/net/wireless/airo.c
--- linux-2.5.2-pre3/drivers/net/wireless/airo.c	Fri Nov  9 13:41:42 2001
+++ linux/drivers/net/wireless/airo.c	Sun Dec 30 11:38:11 2001
@@ -19,7 +19,6 @@
 
 #include <linux/config.h>
 #include <linux/version.h>
-#include <asm/segment.h>
 #include <linux/init.h>
 
 #include <linux/kernel.h>
diff -urN linux-2.5.2-pre3/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c
--- linux-2.5.2-pre3/drivers/pcmcia/i82365.c	Sun Nov 25 09:43:42 2001
+++ linux/drivers/pcmcia/i82365.c	Sun Dec 30 11:38:11 2001
@@ -49,7 +49,6 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 
 #include <pcmcia/version.h>
diff -urN linux-2.5.2-pre3/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c
--- linux-2.5.2-pre3/drivers/pcmcia/tcic.c	Sun Sep 30 12:26:07 2001
+++ linux/drivers/pcmcia/tcic.c	Sun Dec 30 11:38:11 2001
@@ -39,7 +39,6 @@
 
 #include <asm/io.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 
 #include <linux/kernel.h>
diff -urN linux-2.5.2-pre3/drivers/sbus/char/aurora.c linux/drivers/sbus/char/aurora.c
--- linux-2.5.2-pre3/drivers/sbus/char/aurora.c	Tue Oct 30 15:08:11 2001
+++ linux/drivers/sbus/char/aurora.c	Sun Dec 30 11:38:11 2001
@@ -66,7 +66,6 @@
 #include <asm/irq.h>
 #include <asm/oplib.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/kdebug.h>
 #include <asm/sbus.h>
diff -urN linux-2.5.2-pre3/drivers/sbus/char/bpp.c linux/drivers/sbus/char/bpp.c
--- linux-2.5.2-pre3/drivers/sbus/char/bpp.c	Thu Oct 11 09:43:29 2001
+++ linux/drivers/sbus/char/bpp.c	Sun Dec 30 11:38:11 2001
@@ -28,7 +28,6 @@
 
 #if defined(__i386__)
 # include <asm/system.h>
-# include <asm/segment.h>
 #endif
 
 #if defined(__sparc__)
diff -urN linux-2.5.2-pre3/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
--- linux-2.5.2-pre3/drivers/scsi/aha1542.c	Fri Oct 12 15:35:53 2001
+++ linux/drivers/scsi/aha1542.c	Sun Dec 30 11:38:11 2001
@@ -67,10 +67,10 @@
 		       int nseg,
 		       int badseg)
 {
-	printk(KERN_CRIT "sgpnt[%d:%d] addr %p/0x%lx length %d\n",
+	printk(KERN_CRIT "sgpnt[%d:%d] page %p/0x%lx length %d\n",
 	       badseg, nseg,
-	       sgpnt[badseg].address,
-	       SCSI_PA(sgpnt[badseg].address),
+	       page_address(sgpnt[badseg].page) + sgpnt[badseg].offset,
+	       (unsigned long)page_to_bus(sgpnt[badseg].page) + sgpnt[badseg].offset,
 	       sgpnt[badseg].length);
 
 	/*
@@ -176,7 +176,7 @@
 
 static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
 static int aha1542_restart(struct Scsi_Host *shost);
-static void aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs);
+static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt_regs *regs);
 static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs);
 
 #define aha1542_intr_reset(base)  outb(IRST, CONTROL(base))
@@ -419,30 +419,30 @@
 static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long flags;
+	struct Scsi_Host *shost;
+
+	shost = aha_host[irq - 9];
+	if (!shost)
+		panic("Splunge!");
 
-	spin_lock_irqsave(&io_request_lock, flags);
-	aha1542_intr_handle(irq, dev_id, regs);
-	spin_unlock_irqrestore(&io_request_lock, flags);
+	spin_lock_irqsave(&shost->host_lock, flags);
+	aha1542_intr_handle(shost, dev_id, regs);
+	spin_unlock_irqrestore(&shost->host_lock, flags);
 }
 
 /* A "high" level interrupt handler */
-static void aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt_regs *regs)
 {
 	void (*my_done) (Scsi_Cmnd *) = NULL;
 	int errstatus, mbi, mbo, mbistatus;
 	int number_serviced;
 	unsigned long flags;
-	struct Scsi_Host *shost;
 	Scsi_Cmnd *SCtmp;
 	int flag;
 	int needs_restart;
 	struct mailbox *mb;
 	struct ccb *ccb;
 
-	shost = aha_host[irq - 9];
-	if (!shost)
-		panic("Splunge!");
-
 	mb = HOSTDATA(shost)->mb;
 	ccb = HOSTDATA(shost)->ccb;
 
@@ -542,7 +542,7 @@
 		}
 		my_done = SCtmp->scsi_done;
 		if (SCtmp->host_scribble) {
-			scsi_free(SCtmp->host_scribble, 512);
+			kfree(SCtmp->host_scribble);
 			SCtmp->host_scribble = 0;
 		}
 		/* Fetch the sense data, and tuck it away, in the required slot.  The
@@ -703,18 +703,19 @@
 #endif
 		int i;
 		ccb[mbo].op = 2;	/* SCSI Initiator Command  w/scatter-gather */
-		SCpnt->host_scribble = (unsigned char *) scsi_malloc(512);
+		SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_DMA);
 		sgpnt = (struct scatterlist *) SCpnt->request_buffer;
 		cptr = (struct chain *) SCpnt->host_scribble;
 		if (cptr == NULL)
 			panic("aha1542.c: unable to allocate DMA memory\n");
 		for (i = 0; i < SCpnt->use_sg; i++) {
 			if (sgpnt[i].length == 0 || SCpnt->use_sg > 16 ||
-			    (((int) sgpnt[i].address) & 1) || (sgpnt[i].length & 1)) {
+			    (((int) sgpnt[i].offset) & 1) || (sgpnt[i].length & 1)) {
 				unsigned char *ptr;
 				printk(KERN_CRIT "Bad segment list supplied to aha1542.c (%d, %d)\n", SCpnt->use_sg, i);
 				for (i = 0; i < SCpnt->use_sg; i++) {
-					printk(KERN_CRIT "%d: %p %d\n", i, sgpnt[i].address,
+					printk(KERN_CRIT "%d: %p %d\n", i,
+					       page_address(sgpnt[i].page) + sgpnt[i].offset,
 					       sgpnt[i].length);
 				};
 				printk(KERN_CRIT "cptr %x: ", (unsigned int) cptr);
@@ -723,8 +724,8 @@
 					printk("%02x ", ptr[i]);
 				panic("Foooooooood fight!");
 			};
-			any2scsi(cptr[i].dataptr, SCSI_PA(sgpnt[i].address));
-			if (SCSI_PA(sgpnt[i].address + sgpnt[i].length - 1) > ISA_DMA_THRESHOLD)
+			any2scsi(cptr[i].dataptr, page_to_bus(sgpnt[i].page) + sgpnt[i].offset);
+			if (page_to_bus(sgpnt[i].page) + sgpnt[i].offset + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD)
 				BAD_SG_DMA(SCpnt, sgpnt, SCpnt->use_sg, i);
 			any2scsi(cptr[i].datalen, sgpnt[i].length);
 		};
@@ -1442,7 +1443,7 @@
 			Scsi_Cmnd *SCtmp;
 			SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
 			if (SCtmp->host_scribble) {
-				scsi_free(SCtmp->host_scribble, 512);
+				kfree(SCtmp->host_scribble);
 				SCtmp->host_scribble = NULL;
 			}
 			HOSTDATA(SCpnt->host)->SCint[i] = NULL;
@@ -1474,9 +1475,9 @@
 	 * check for timeout, and if we are doing something like this
 	 * we are pretty desperate anyways.
 	 */
-	spin_unlock_irq(&io_request_lock);
+	spin_unlock_irq(&SCpnt->host->host_lock);
 	scsi_sleep(4 * HZ);
-	spin_lock_irq(&io_request_lock);
+	spin_lock_irq(&SCpnt->host->host_lock);
 
 	WAIT(STATUS(SCpnt->host->io_port),
 	     STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF);
@@ -1505,7 +1506,7 @@
 				continue;
 			}
 			if (SCtmp->host_scribble) {
-				scsi_free(SCtmp->host_scribble, 512);
+				kfree(SCtmp->host_scribble);
 				SCtmp->host_scribble = NULL;
 			}
 			HOSTDATA(SCpnt->host)->SCint[i] = NULL;
@@ -1538,9 +1539,9 @@
 	 * check for timeout, and if we are doing something like this
 	 * we are pretty desperate anyways.
 	 */
-	spin_unlock_irq(&io_request_lock);
+	spin_unlock_irq(&SCpnt->host->host_lock);
 	scsi_sleep(4 * HZ);
-	spin_lock_irq(&io_request_lock);
+	spin_lock_irq(&SCpnt->host->host_lock);
 
 	WAIT(STATUS(SCpnt->host->io_port),
 	     STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF);
@@ -1574,7 +1575,7 @@
 				continue;
 			}
 			if (SCtmp->host_scribble) {
-				scsi_free(SCtmp->host_scribble, 512);
+				kfree(SCtmp->host_scribble);
 				SCtmp->host_scribble = NULL;
 			}
 			HOSTDATA(SCpnt->host)->SCint[i] = NULL;
@@ -1623,7 +1624,7 @@
 	if (mb[mbi].status) {
 		printk(KERN_ERR "Lost interrupt discovered on irq %d - attempting to recover\n",
 		       SCpnt->host->irq);
-		aha1542_intr_handle(SCpnt->host->irq, NULL);
+		aha1542_intr_handle(SCpnt->host, NULL);
 		return 0;
 	}
 	/* OK, no lost interrupt.  Try looking to see how many pending commands
@@ -1712,7 +1713,7 @@
 				SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
 				SCtmp->result = DID_RESET << 16;
 				if (SCtmp->host_scribble) {
-					scsi_free(SCtmp->host_scribble, 512);
+					kfree(SCtmp->host_scribble);
 					SCtmp->host_scribble = NULL;
 				}
 				printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
@@ -1758,7 +1759,7 @@
 						SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
 						SCtmp->result = DID_RESET << 16;
 						if (SCtmp->host_scribble) {
-							scsi_free(SCtmp->host_scribble, 512);
+							kfree(SCtmp->host_scribble);
 							SCtmp->host_scribble = NULL;
 						}
 						printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
diff -urN linux-2.5.2-pre3/drivers/scsi/cpqfcTSworker.c linux/drivers/scsi/cpqfcTSworker.c
--- linux-2.5.2-pre3/drivers/scsi/cpqfcTSworker.c	Mon Dec 10 14:15:19 2001
+++ linux/drivers/scsi/cpqfcTSworker.c	Sun Dec 30 11:38:11 2001
@@ -159,7 +159,6 @@
 #ifdef PCI_KERNEL_TRACE
   PTACHYON fcChip = &cpqfcHBAdata->fcChip;
 #endif
-  struct fs_struct *fs;
   DECLARE_MUTEX_LOCKED(fcQueReady);
   DECLARE_MUTEX_LOCKED(fcTYOBcomplete); 
   DECLARE_MUTEX_LOCKED(TachFrozen);  
@@ -168,33 +167,7 @@
   ENTER("WorkerThread");
 
   lock_kernel();
-	/*
-	 * If we were started as result of loading a module, close all of the
-	 * user space pages.  We don't need them, and if we didn't close them
-	 * they would be locked into memory.
-	 */
-  exit_mm(current);
-
-  current->session = 1;
-  current->pgrp = 1;
-	
-  /* Become as one with the init task */
-	
-  exit_fs(current);	/* current->fs->count--; */
-  fs = init_task.fs;
-  // Some kernels compiled for SMP, while actually running
-  // on a uniproc machine, will return NULL for this call
-  if( !fs)
-  {
-    printk(" cpqfcTS FATAL: fs is NULL! Is this an SMP kernel on uniproc machine?\n ");
-  }
- 
-  else
-  { 
-    current->fs = fs;
-    atomic_inc(&fs->count);
-  }
-
+  daemonize();
   siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
 
 
diff -urN linux-2.5.2-pre3/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
--- linux-2.5.2-pre3/drivers/scsi/ide-scsi.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/scsi/ide-scsi.c	Sun Dec 30 11:38:11 2001
@@ -841,7 +841,7 @@
 
 static Scsi_Host_Template idescsi_template = {
 	module:		THIS_MODULE,
-	name:		"idescsi"
+	name:		"idescsi",
 	detect:		idescsi_detect,
 	release:	idescsi_release,
 	info:		idescsi_info,
diff -urN linux-2.5.2-pre3/drivers/scsi/mac_scsi.c linux/drivers/scsi/mac_scsi.c
--- linux-2.5.2-pre3/drivers/scsi/mac_scsi.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/mac_scsi.c	Sun Dec 30 11:38:11 2001
@@ -353,7 +353,7 @@
 	NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
 	NCR5380_read( RESET_PARITY_INTERRUPT_REG );
 
-	for( end = jiffies + AFTER_RESET_DELAY; jiffies < end; )
+	for( end = jiffies + AFTER_RESET_DELAY; time_before(jiffies, end); )
 		barrier();
 
 	/* switch on SCSI IRQ again */
diff -urN linux-2.5.2-pre3/drivers/scsi/qla1280.c linux/drivers/scsi/qla1280.c
--- linux-2.5.2-pre3/drivers/scsi/qla1280.c	Sun Sep 30 12:26:07 2001
+++ linux/drivers/scsi/qla1280.c	Sun Dec 30 11:38:11 2001
@@ -192,7 +192,6 @@
 #include <stdarg.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/segment.h>
 #include <asm/byteorder.h>
 #include <linux/version.h>
 #include <linux/types.h>
diff -urN linux-2.5.2-pre3/drivers/scsi/sd.c linux/drivers/scsi/sd.c
--- linux-2.5.2-pre3/drivers/scsi/sd.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/scsi/sd.c	Sun Dec 30 11:38:11 2001
@@ -969,9 +969,9 @@
 			 */
 			int hard_sector = sector_size;
 			int sz = rscsi_disks[i].capacity * (hard_sector/256);
+			request_queue_t *queue = &rscsi_disks[i].device->request_queue;
 
-			/* There are 16 minors allocated for each major device */
-			blk_queue_hardsect_size(blk_get_queue(SD_MAJOR(i)), hard_sector);
+			blk_queue_hardsect_size(queue, hard_sector);
 			printk("SCSI device %s: "
 			       "%d %d-byte hdwr sectors (%d MB)\n",
 			       nbuff, rscsi_disks[i].capacity,
diff -urN linux-2.5.2-pre3/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- linux-2.5.2-pre3/drivers/scsi/sr.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/scsi/sr.c	Sun Dec 30 11:38:11 2001
@@ -475,6 +475,7 @@
 	int the_result, retries;
 	int sector_size;
 	Scsi_Request *SRpnt;
+	request_queue_t *queue;
 
 	buffer = (unsigned char *) kmalloc(512, GFP_DMA);
 	SRpnt = scsi_allocate_request(scsi_CDs[i].device);
@@ -564,8 +565,9 @@
 		 */
 		scsi_CDs[i].needs_sector_size = 0;
 		sr_sizes[i] = scsi_CDs[i].capacity >> (BLOCK_SIZE_BITS - 9);
-	};
-	blk_queue_hardsect_size(blk_get_queue(MAJOR_NR), sector_size);
+	}
+	queue = &scsi_CDs[i].device->request_queue;
+	blk_queue_hardsect_size(queue, sector_size);
 	kfree(buffer);
 }
 
diff -urN linux-2.5.2-pre3/drivers/sound/msnd.c linux/drivers/sound/msnd.c
--- linux-2.5.2-pre3/drivers/sound/msnd.c	Sun Sep 30 12:26:08 2001
+++ linux/drivers/sound/msnd.c	Sun Dec 30 11:38:11 2001
@@ -39,7 +39,6 @@
 #  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>
diff -urN linux-2.5.2-pre3/drivers/sound/os.h linux/drivers/sound/os.h
--- linux-2.5.2-pre3/drivers/sound/os.h	Sun Dec 16 15:46:59 2001
+++ linux/drivers/sound/os.h	Sun Dec 30 11:38:11 2001
@@ -25,7 +25,6 @@
 #include <asm/page.h>
 #include <asm/system.h>
 #ifdef __alpha__
-#include <asm/segment.h>
 #endif
 #include <linux/vmalloc.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.2-pre3/drivers/sound/soundcard.c linux/drivers/sound/soundcard.c
--- linux-2.5.2-pre3/drivers/sound/soundcard.c	Sun Sep 30 12:26:08 2001
+++ linux/drivers/sound/soundcard.c	Sun Dec 30 11:38:11 2001
@@ -35,7 +35,6 @@
 #include <linux/kmod.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <linux/wait.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
diff -urN linux-2.5.2-pre3/drivers/sound/sscape.c linux/drivers/sound/sscape.c
--- linux-2.5.2-pre3/drivers/sound/sscape.c	Sun Sep 30 12:26:08 2001
+++ linux/drivers/sound/sscape.c	Sun Dec 30 11:38:11 2001
@@ -34,7 +34,6 @@
 #include <linux/kmod.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <linux/wait.h>
 #include <linux/slab.h>
 #include <linux/ioport.h>
diff -urN linux-2.5.2-pre3/drivers/tc/zs.c linux/drivers/tc/zs.c
--- linux-2.5.2-pre3/drivers/tc/zs.c	Sun Dec 30 11:38:08 2001
+++ linux/drivers/tc/zs.c	Sun Dec 30 11:38:11 2001
@@ -64,7 +64,6 @@
 #include <asm/pgtable.h>
 #include <asm/irq.h>
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 #include <asm/wbflush.h>
diff -urN linux-2.5.2-pre3/drivers/telephony/ixj.c linux/drivers/telephony/ixj.c
--- linux-2.5.2-pre3/drivers/telephony/ixj.c	Thu Oct 25 13:53:52 2001
+++ linux/drivers/telephony/ixj.c	Sun Dec 30 11:38:11 2001
@@ -268,7 +268,6 @@
 #include <linux/pci.h>
 
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 #include <linux/isapnp.h>
diff -urN linux-2.5.2-pre3/drivers/video/aty/atyfb_base.c linux/drivers/video/aty/atyfb_base.c
--- linux-2.5.2-pre3/drivers/video/aty/atyfb_base.c	Tue Oct 30 15:08:11 2001
+++ linux/drivers/video/aty/atyfb_base.c	Sun Dec 30 11:38:11 2001
@@ -2891,3 +2891,4 @@
 }
 
 #endif
+MODULE_LICENSE("GPL");
diff -urN linux-2.5.2-pre3/drivers/video/dn_cfb4.c linux/drivers/video/dn_cfb4.c
--- linux-2.5.2-pre3/drivers/video/dn_cfb4.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/video/dn_cfb4.c	Sun Dec 30 11:38:11 2001
@@ -7,7 +7,6 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/amigahw.h>
diff -urN linux-2.5.2-pre3/drivers/video/dn_cfb8.c linux/drivers/video/dn_cfb8.c
--- linux-2.5.2-pre3/drivers/video/dn_cfb8.c	Mon Oct 15 13:47:13 2001
+++ linux/drivers/video/dn_cfb8.c	Sun Dec 30 11:38:11 2001
@@ -7,7 +7,6 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/amigahw.h>
diff -urN linux-2.5.2-pre3/drivers/video/dnfb.c linux/drivers/video/dnfb.c
--- linux-2.5.2-pre3/drivers/video/dnfb.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/video/dnfb.c	Sun Dec 30 11:38:12 2001
@@ -7,7 +7,6 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/amigahw.h>
diff -urN linux-2.5.2-pre3/drivers/video/fbmem.c linux/drivers/video/fbmem.c
--- linux-2.5.2-pre3/drivers/video/fbmem.c	Wed Nov 14 15:41:37 2001
+++ linux/drivers/video/fbmem.c	Sun Dec 30 11:38:12 2001
@@ -576,12 +576,13 @@
 		return -EINVAL;
 	off += start;
 	vma->vm_pgoff = off >> PAGE_SHIFT;
+	/* This is an IO map - tell maydump to skip this VMA */
+	vma->vm_flags |= VM_IO;
 #if defined(__sparc_v9__)
 	vma->vm_flags |= (VM_SHM | VM_LOCKED);
 	if (io_remap_page_range(vma->vm_start, off,
 				vma->vm_end - vma->vm_start, vma->vm_page_prot, 0))
 		return -EAGAIN;
-	vma->vm_flags |= VM_IO;
 #else
 #if defined(__mc68000__)
 #if defined(CONFIG_SUN3)
@@ -607,8 +608,6 @@
 	pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
 #elif defined(__arm__)
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-	/* This is an IO map - tell maydump to skip this VMA */
-	vma->vm_flags |= VM_IO;
 #elif defined(__sh__)
 	pgprot_val(vma->vm_page_prot) &= ~_PAGE_CACHABLE;
 #else
@@ -931,3 +930,5 @@
 #if 1 /* to go away in 2.5.0 */
 EXPORT_SYMBOL(GET_FB_IDX);
 #endif
+
+MODULE_LICENSE("GPL");
diff -urN linux-2.5.2-pre3/drivers/video/q40fb.c linux/drivers/video/q40fb.c
--- linux-2.5.2-pre3/drivers/video/q40fb.c	Thu Sep 13 16:04:43 2001
+++ linux/drivers/video/q40fb.c	Sun Dec 30 11:38:12 2001
@@ -9,7 +9,6 @@
 
 #include <asm/uaccess.h>
 #include <asm/setup.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 /*#include <asm/irq.h>*/
 #include <asm/q40_master.h>
diff -urN linux-2.5.2-pre3/fs/adfs/inode.c linux/fs/adfs/inode.c
--- linux-2.5.2-pre3/fs/adfs/inode.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/adfs/inode.c	Sun Dec 30 11:38:12 2001
@@ -248,7 +248,6 @@
 	if (!inode)
 		goto out;
 
-	inode->i_version = ++event;
 	inode->i_uid	 = sb->u.adfs_sb.s_uid;
 	inode->i_gid	 = sb->u.adfs_sb.s_gid;
 	inode->i_ino	 = obj->file_id;
diff -urN linux-2.5.2-pre3/fs/autofs/inode.c linux/fs/autofs/inode.c
--- linux-2.5.2-pre3/fs/autofs/inode.c	Thu Oct 25 00:02:26 2001
+++ linux/fs/autofs/inode.c	Sun Dec 30 11:38:12 2001
@@ -11,6 +11,7 @@
  * ------------------------------------------------------------------------- */
 
 #include <linux/kernel.h>
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/locks.h>
diff -urN linux-2.5.2-pre3/fs/bfs/dir.c linux/fs/bfs/dir.c
--- linux-2.5.2-pre3/fs/bfs/dir.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/bfs/dir.c	Sun Dec 30 11:38:12 2001
@@ -173,7 +173,6 @@
 		inode->i_nlink = 1;
 	}
 	de->ino = 0;
-	dir->i_version = ++event;
 	mark_buffer_dirty(bh);
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(dir);
@@ -226,7 +225,6 @@
 	}
 	old_de->ino = 0;
 	old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-	old_dir->i_version = ++event;
 	mark_inode_dirty(old_dir);
 	if (new_inode) {
 		new_inode->i_nlink--;
@@ -279,7 +277,6 @@
 				}
 				dir->i_mtime = CURRENT_TIME;
 				mark_inode_dirty(dir);
-				dir->i_version = ++event;
 				de->ino = ino;
 				for (i=0; i<BFS_NAMELEN; i++)
 					de->name[i] = (i < namelen) ? name[i] : 0;
diff -urN linux-2.5.2-pre3/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.5.2-pre3/fs/binfmt_elf.c	Sat Oct 20 19:16:59 2001
+++ linux/fs/binfmt_elf.c	Sun Dec 30 11:38:12 2001
@@ -32,7 +32,7 @@
 #include <linux/highuid.h>
 #include <linux/smp_lock.h>
 #include <linux/compiler.h>
-#include <linux/limits.h>
+#include <linux/highmem.h>
 
 #include <asm/uaccess.h>
 #include <asm/param.h>
@@ -505,30 +505,10 @@
 #if 0
 			printk("Using ELF interpreter %s\n", elf_interpreter);
 #endif
-#ifdef __sparc__
-			if (ibcs2_interpreter) {
-				unsigned long old_pers = current->personality;
-				struct exec_domain *old_domain = current->exec_domain;
-				struct exec_domain *new_domain;
-				struct fs_struct *old_fs = current->fs, *new_fs;
-				get_exec_domain(old_domain);
-				atomic_inc(&old_fs->count);
-
-				set_personality(PER_SVR4);
-				interpreter = open_exec(elf_interpreter);
-
-				new_domain = current->exec_domain;
-				new_fs = current->fs;
-				current->personality = old_pers;
-				current->exec_domain = old_domain;
-				current->fs = old_fs;
-				put_exec_domain(new_domain);
-				put_fs_struct(new_fs);
-			} else
-#endif
-			{
-				interpreter = open_exec(elf_interpreter);
-			}
+
+			SET_PERSONALITY(elf_ex, ibcs2_interpreter);
+
+			interpreter = open_exec(elf_interpreter);
 			retval = PTR_ERR(interpreter);
 			if (IS_ERR(interpreter))
 				goto out_free_interp;
@@ -602,10 +582,6 @@
 	current->flags &= ~PF_FORKNOEXEC;
 	elf_entry = (unsigned long) elf_ex.e_entry;
 
-	/* Do this immediately, since STACK_TOP as used in setup_arg_pages
-	   may depend on the personality.  */
-	SET_PERSONALITY(elf_ex, ibcs2_interpreter);
-
 	/* Do this so that we can load the interpreter, if need be.  We will
 	   change some of these later */
 	current->mm->rss = 0;
@@ -1032,6 +1008,25 @@
 	elf_fpregset_t fpu;		/* NT_PRFPREG */
 	struct elf_prpsinfo psinfo;	/* NT_PRPSINFO */
 
+	/* first copy the parameters from user space */
+	memset(&psinfo, 0, sizeof(psinfo));
+	{
+		int i, len;
+
+		len = current->mm->arg_end - current->mm->arg_start;
+		if (len >= ELF_PRARGSZ)
+			len = ELF_PRARGSZ-1;
+		copy_from_user(&psinfo.pr_psargs,
+			      (const char *)current->mm->arg_start, len);
+		for(i = 0; i < len; i++)
+			if (psinfo.pr_psargs[i] == 0)
+				psinfo.pr_psargs[i] = ' ';
+		psinfo.pr_psargs[len] = 0;
+
+	}
+
+	/* now stop all vm operations */
+	down_write(&current->mm->mmap_sem);
 	segs = current->mm->map_count;
 
 #ifdef DEBUG
@@ -1073,7 +1068,6 @@
 	 * Set up the notes in similar form to SVR4 core dumps made
 	 * with info from their /proc.
 	 */
-	memset(&psinfo, 0, sizeof(psinfo));
 	memset(&prstatus, 0, sizeof(prstatus));
 
 	notes[0].name = "CORE";
@@ -1129,23 +1123,6 @@
 	psinfo.pr_flag = current->flags;
 	psinfo.pr_uid = NEW_TO_OLD_UID(current->uid);
 	psinfo.pr_gid = NEW_TO_OLD_GID(current->gid);
-	{
-		int i, len;
-
-		set_fs(fs);
-
-		len = current->mm->arg_end - current->mm->arg_start;
-		if (len >= ELF_PRARGSZ)
-			len = ELF_PRARGSZ-1;
-		copy_from_user(&psinfo.pr_psargs,
-			      (const char *)current->mm->arg_start, len);
-		for(i = 0; i < len; i++)
-			if (psinfo.pr_psargs[i] == 0)
-				psinfo.pr_psargs[i] = ' ';
-		psinfo.pr_psargs[len] = 0;
-
-		set_fs(KERNEL_DS);
-	}
 	strncpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
 
 	notes[2].name = "CORE";
@@ -1217,8 +1194,6 @@
 		if (!writenote(&notes[i], file))
 			goto end_coredump;
 
-	set_fs(fs);
-
 	DUMP_SEEK(dataoff);
 
 	for(vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
@@ -1232,22 +1207,24 @@
 		for (addr = vma->vm_start;
 		     addr < vma->vm_end;
 		     addr += PAGE_SIZE) {
-			pgd_t *pgd;
-			pmd_t *pmd;
-			pte_t *pte;
-
-			pgd = pgd_offset(vma->vm_mm, addr);
-			if (pgd_none(*pgd))
-				goto nextpage_coredump;
-			pmd = pmd_offset(pgd, addr);
-			if (pmd_none(*pmd))
-				goto nextpage_coredump;
-			pte = pte_offset(pmd, addr);
-			if (pte_none(*pte)) {
-nextpage_coredump:
+			struct page* page;
+			struct vm_area_struct *vma;
+
+			if (get_user_pages(current, current->mm, addr, 1, 0, 1,
+						&page, &vma) <= 0) {
 				DUMP_SEEK (file->f_pos + PAGE_SIZE);
 			} else {
-				DUMP_WRITE((void*)addr, PAGE_SIZE);
+				if (page == ZERO_PAGE(addr)) {
+					DUMP_SEEK (file->f_pos + PAGE_SIZE);
+				} else {
+					void *kaddr;
+					flush_cache_page(vma, addr);
+					kaddr = kmap(page);
+					DUMP_WRITE(kaddr, PAGE_SIZE);
+					flush_page_to_ram(page);
+					kunmap(page);
+				}
+				put_page(page);
 			}
 		}
 	}
@@ -1260,6 +1237,7 @@
 
  end_coredump:
 	set_fs(fs);
+	up_write(&current->mm->mmap_sem);
 	return has_dumped;
 }
 #endif		/* USE_ELF_CORE_DUMP */
diff -urN linux-2.5.2-pre3/fs/char_dev.c linux/fs/char_dev.c
--- linux-2.5.2-pre3/fs/char_dev.c	Fri Nov  2 11:48:21 2001
+++ linux/fs/char_dev.c	Sun Dec 30 11:38:12 2001
@@ -6,6 +6,7 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/fs.h>
 #include <linux/slab.h>
 
 #define HASH_BITS	6
diff -urN linux-2.5.2-pre3/fs/coda/cache.c linux/fs/coda/cache.c
--- linux-2.5.2-pre3/fs/coda/cache.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/cache.c	Sun Dec 30 11:38:12 2001
@@ -14,7 +14,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/list.h>
diff -urN linux-2.5.2-pre3/fs/coda/coda_linux.c linux/fs/coda/coda_linux.c
--- linux-2.5.2-pre3/fs/coda/coda_linux.c	Wed Apr 25 16:18:54 2001
+++ linux/fs/coda/coda_linux.c	Sun Dec 30 11:38:12 2001
@@ -15,7 +15,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 
diff -urN linux-2.5.2-pre3/fs/coda/file.c linux/fs/coda/file.c
--- linux-2.5.2-pre3/fs/coda/file.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/file.c	Sun Dec 30 11:38:12 2001
@@ -16,7 +16,6 @@
 #include <linux/errno.h>
 #include <linux/locks.h>
 #include <linux/smp_lock.h>
-#include <asm/segment.h>
 #include <linux/string.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.5.2-pre3/fs/coda/inode.c linux/fs/coda/inode.c
--- linux-2.5.2-pre3/fs/coda/inode.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/inode.c	Sun Dec 30 11:38:12 2001
@@ -25,7 +25,6 @@
 
 #include <linux/fs.h>
 #include <linux/vmalloc.h>
-#include <asm/segment.h>
 
 #include <linux/coda.h>
 #include <linux/coda_linux.h>
diff -urN linux-2.5.2-pre3/fs/coda/pioctl.c linux/fs/coda/pioctl.c
--- linux-2.5.2-pre3/fs/coda/pioctl.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/pioctl.c	Sun Dec 30 11:38:12 2001
@@ -14,7 +14,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <linux/string.h>
 #define __NO_VERSION__
 #include <linux/module.h>
diff -urN linux-2.5.2-pre3/fs/coda/psdev.c linux/fs/coda/psdev.c
--- linux-2.5.2-pre3/fs/coda/psdev.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/psdev.c	Sun Dec 30 11:38:12 2001
@@ -38,7 +38,6 @@
 #include <linux/list.h>
 #include <linux/smp_lock.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/poll.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.2-pre3/fs/coda/sysctl.c linux/fs/coda/sysctl.c
--- linux-2.5.2-pre3/fs/coda/sysctl.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/sysctl.c	Sun Dec 30 11:38:12 2001
@@ -21,7 +21,6 @@
 #include <linux/stat.h>
 #include <linux/ctype.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/utsname.h>
 #define __NO_VERSION__
diff -urN linux-2.5.2-pre3/fs/coda/upcall.c linux/fs/coda/upcall.c
--- linux-2.5.2-pre3/fs/coda/upcall.c	Wed Dec  5 13:02:14 2001
+++ linux/fs/coda/upcall.c	Sun Dec 30 11:38:12 2001
@@ -15,7 +15,6 @@
  */
 
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/signal.h>
 #include <linux/signal.h>
 
diff -urN linux-2.5.2-pre3/fs/devfs/base.c linux/fs/devfs/base.c
--- linux-2.5.2-pre3/fs/devfs/base.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/devfs/base.c	Sun Dec 30 11:38:12 2001
@@ -517,7 +517,6 @@
     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
diff -urN linux-2.5.2-pre3/fs/exec.c linux/fs/exec.c
--- linux-2.5.2-pre3/fs/exec.c	Wed Nov 28 09:30:47 2001
+++ linux/fs/exec.c	Sun Dec 30 11:38:12 2001
@@ -973,9 +973,7 @@
 	if (do_truncate(file->f_dentry, 0) != 0)
 		goto close_fail;
 
-	down_read(&current->mm->mmap_sem);
 	retval = binfmt->core_dump(signr, regs, file);
-	up_read(&current->mm->mmap_sem);
 
 close_fail:
 	filp_close(file, NULL);
diff -urN linux-2.5.2-pre3/fs/ext2/ialloc.c linux/fs/ext2/ialloc.c
--- linux-2.5.2-pre3/fs/ext2/ialloc.c	Sun Dec 16 12:23:00 2001
+++ linux/fs/ext2/ialloc.c	Sun Dec 30 11:38:12 2001
@@ -393,7 +393,7 @@
 	if (inode->u.ext2_i.i_flags & EXT2_SYNC_FL)
 		inode->i_flags |= S_SYNC;
 	insert_inode_hash(inode);
-	inode->i_generation = event++;
+	inode->i_generation = sb->u.ext2_sb.s_next_generation++;
 	mark_inode_dirty(inode);
 
 	unlock_super (sb);
diff -urN linux-2.5.2-pre3/fs/ext2/super.c linux/fs/ext2/super.c
--- linux-2.5.2-pre3/fs/ext2/super.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/ext2/super.c	Sun Dec 30 11:38:12 2001
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/locks.h>
 #include <linux/blkdev.h>
+#include <linux/random.h>
 #include <asm/uaccess.h>
 
 
@@ -623,6 +624,7 @@
 	sb->u.ext2_sb.s_loaded_inode_bitmaps = 0;
 	sb->u.ext2_sb.s_loaded_block_bitmaps = 0;
 	sb->u.ext2_sb.s_gdb_count = db_count;
+	get_random_bytes(&sb->u.ext2_sb.s_next_generation, sizeof(u32));
 	/*
 	 * set up enough so that it can read an inode
 	 */
diff -urN linux-2.5.2-pre3/fs/fat/inode.c linux/fs/fat/inode.c
--- linux-2.5.2-pre3/fs/fat/inode.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/fat/inode.c	Sun Dec 30 11:38:12 2001
@@ -146,6 +146,7 @@
 		goto out;
 	*res = 0;
 	inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
+	inode->i_version = 0;
 	fat_fill_inode(inode, de);
 	fat_attach(inode, ino);
 	insert_inode_hash(inode);
@@ -383,7 +384,7 @@
 	MSDOS_I(inode)->i_fat_inode = inode;
 	inode->i_uid = sbi->options.fs_uid;
 	inode->i_gid = sbi->options.fs_gid;
-	inode->i_version = ++event;
+	inode->i_version++;
 	inode->i_generation = 0;
 	inode->i_mode = (S_IRWXUGO & ~sbi->options.fs_umask) | S_IFDIR;
 	inode->i_op = sbi->dir_ops;
@@ -776,6 +777,7 @@
 	if (!root_inode)
 		goto out_unload_nls;
 	root_inode->i_ino = MSDOS_ROOT_INO;
+	root_inode->i_version = 0;
 	fat_read_root(root_inode);
 	insert_inode_hash(root_inode);
 	sb->s_root = d_alloc_root(root_inode);
@@ -887,7 +889,7 @@
 	MSDOS_I(inode)->i_fat_inode = inode;
 	inode->i_uid = sbi->options.fs_uid;
 	inode->i_gid = sbi->options.fs_gid;
-	inode->i_version = ++event;
+	inode->i_version++;
 	inode->i_generation = CURRENT_TIME;
 	
 	if ((de->attr & ATTR_DIR) && !IS_FREE(de->name)) {
diff -urN linux-2.5.2-pre3/fs/freevxfs/vxfs_inode.c linux/fs/freevxfs/vxfs_inode.c
--- linux-2.5.2-pre3/fs/freevxfs/vxfs_inode.c	Sun Dec 16 12:23:00 2001
+++ linux/fs/freevxfs/vxfs_inode.c	Sun Dec 30 11:38:12 2001
@@ -35,6 +35,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/pagemap.h>
 
 #include "vxfs.h"
 #include "vxfs_inode.h"
diff -urN linux-2.5.2-pre3/fs/hfs/dir.c linux/fs/hfs/dir.c
--- linux-2.5.2-pre3/fs/hfs/dir.c	Tue Feb 13 14:13:45 2001
+++ linux/fs/hfs/dir.c	Sun Dec 30 11:38:12 2001
@@ -69,8 +69,8 @@
 /*
  * update_dirs_plus()
  *
- * Update the fields 'i_size', 'i_nlink', 'i_ctime', 'i_mtime' and
- * 'i_version' of the inodes associated with a directory that has
+ * Update the fields 'i_size', 'i_nlink', 'i_ctime' and 'i_mtime'
+ * of the inodes associated with a directory that has
  * had a file ('is_dir'==0) or directory ('is_dir'!=0) added to it.
  */
 static inline void update_dirs_plus(struct hfs_cat_entry *dir, int is_dir)
@@ -88,7 +88,6 @@
 					++(tmp->i_nlink);
 				}
 				tmp->i_size += HFS_I(tmp)->dir_size;
-				tmp->i_version = ++event;
 			}
 			tmp->i_ctime = tmp->i_mtime = CURRENT_TIME;
 			mark_inode_dirty(tmp);
@@ -100,7 +99,7 @@
  * update_dirs_minus()
  *
  * Update the fields 'i_size', 'i_nlink', 'i_ctime', 'i_mtime' and
- * 'i_version' of the inodes associated with a directory that has
+ * of the inodes associated with a directory that has
  * had a file ('is_dir'==0) or directory ('is_dir'!=0) removed.
  */
 static inline void update_dirs_minus(struct hfs_cat_entry *dir, int is_dir)
@@ -118,7 +117,6 @@
 					--(tmp->i_nlink);
 				}
 				tmp->i_size -= HFS_I(tmp)->dir_size;
-				tmp->i_version = ++event;
 			}
 			tmp->i_ctime = tmp->i_mtime = CURRENT_TIME;
 			mark_inode_dirty(tmp);
diff -urN linux-2.5.2-pre3/fs/hfs/file_cap.c linux/fs/hfs/file_cap.c
--- linux-2.5.2-pre3/fs/hfs/file_cap.c	Mon Sep 10 07:31:25 2001
+++ linux/fs/hfs/file_cap.c	Sun Dec 30 11:38:12 2001
@@ -103,7 +103,6 @@
 		if (offset != file->f_pos) {
 			file->f_pos = offset;
 			file->f_reada = 0;
-			file->f_version = ++event;
 		}
 		retval = offset;
 	}
diff -urN linux-2.5.2-pre3/fs/hfs/file_hdr.c linux/fs/hfs/file_hdr.c
--- linux-2.5.2-pre3/fs/hfs/file_hdr.c	Sun Aug 12 10:56:56 2001
+++ linux/fs/hfs/file_hdr.c	Sun Dec 30 11:38:12 2001
@@ -359,7 +359,6 @@
 		if (offset != file->f_pos) {
 			file->f_pos = offset;
 			file->f_reada = 0;
-			file->f_version = ++event;
 		}
 		retval = offset;
 	}
diff -urN linux-2.5.2-pre3/fs/hpfs/hpfs_fn.h linux/fs/hpfs/hpfs_fn.h
--- linux-2.5.2-pre3/fs/hpfs/hpfs_fn.h	Sun Dec 16 12:23:05 2001
+++ linux/fs/hpfs/hpfs_fn.h	Sun Dec 30 11:38:12 2001
@@ -19,7 +19,6 @@
 #include <linux/stat.h>
 #include <linux/string.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.5.2-pre3/fs/intermezzo/dcache.c linux/fs/intermezzo/dcache.c
--- linux-2.5.2-pre3/fs/intermezzo/dcache.c	Tue Nov 13 09:20:56 2001
+++ linux/fs/intermezzo/dcache.c	Sun Dec 30 11:38:12 2001
@@ -16,7 +16,6 @@
 #include <linux/errno.h>
 #include <linux/locks.h>
 #include <linux/slab.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 
diff -urN linux-2.5.2-pre3/fs/intermezzo/ext_attr.c linux/fs/intermezzo/ext_attr.c
--- linux-2.5.2-pre3/fs/intermezzo/ext_attr.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/ext_attr.c	Sun Dec 30 11:38:12 2001
@@ -28,7 +28,6 @@
 #include <asm/uaccess.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <asm/segment.h>
 #include <linux/smp_lock.h>
 
 #include <linux/intermezzo_fs.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/inode.c linux/fs/intermezzo/inode.c
--- linux-2.5.2-pre3/fs/intermezzo/inode.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/inode.c	Sun Dec 30 11:38:12 2001
@@ -29,7 +29,6 @@
 #include <asm/uaccess.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <asm/segment.h>
 
 #include <linux/intermezzo_fs.h>
 #include <linux/intermezzo_upcall.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal.c linux/fs/intermezzo/journal.c
--- linux-2.5.2-pre3/fs/intermezzo/journal.c	Tue Nov 13 09:20:56 2001
+++ linux/fs/intermezzo/journal.c	Sun Dec 30 11:38:12 2001
@@ -14,7 +14,6 @@
 #include <linux/time.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal_ext2.c linux/fs/intermezzo/journal_ext2.c
--- linux-2.5.2-pre3/fs/intermezzo/journal_ext2.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/journal_ext2.c	Sun Dec 30 11:38:12 2001
@@ -12,7 +12,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/ext2_fs.h> 
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal_ext3.c linux/fs/intermezzo/journal_ext3.c
--- linux-2.5.2-pre3/fs/intermezzo/journal_ext3.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/journal_ext3.c	Sun Dec 30 11:38:12 2001
@@ -17,7 +17,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal_obdfs.c linux/fs/intermezzo/journal_obdfs.c
--- linux-2.5.2-pre3/fs/intermezzo/journal_obdfs.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/journal_obdfs.c	Sun Dec 30 11:38:12 2001
@@ -17,7 +17,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #ifdef CONFIG_OBDFS_FS
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal_reiserfs.c linux/fs/intermezzo/journal_reiserfs.c
--- linux-2.5.2-pre3/fs/intermezzo/journal_reiserfs.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/journal_reiserfs.c	Sun Dec 30 11:38:12 2001
@@ -17,7 +17,6 @@
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #if 0
diff -urN linux-2.5.2-pre3/fs/intermezzo/journal_xfs.c linux/fs/intermezzo/journal_xfs.c
--- linux-2.5.2-pre3/fs/intermezzo/journal_xfs.c	Tue Nov 13 09:20:56 2001
+++ linux/fs/intermezzo/journal_xfs.c	Sun Dec 30 11:38:12 2001
@@ -12,7 +12,6 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #ifdef CONFIG_FS_XFS
diff -urN linux-2.5.2-pre3/fs/intermezzo/presto.c linux/fs/intermezzo/presto.c
--- linux-2.5.2-pre3/fs/intermezzo/presto.c	Tue Nov 13 09:20:56 2001
+++ linux/fs/intermezzo/presto.c	Sun Dec 30 11:38:12 2001
@@ -17,7 +17,6 @@
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/locks.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/string.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/psdev.c linux/fs/intermezzo/psdev.c
--- linux-2.5.2-pre3/fs/intermezzo/psdev.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/psdev.c	Sun Dec 30 11:38:12 2001
@@ -35,6 +35,7 @@
 #include <linux/sched.h>
 #include <linux/lp.h>
 #include <linux/slab.h>
+#include <asm/ioctls.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/delay.h>
@@ -46,7 +47,6 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <asm/io.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/poll.h>
 #include <asm/uaccess.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/sysctl.c linux/fs/intermezzo/sysctl.c
--- linux-2.5.2-pre3/fs/intermezzo/sysctl.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/sysctl.c	Sun Dec 30 11:38:12 2001
@@ -16,7 +16,6 @@
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <asm/bitops.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <linux/utsname.h>
 #include <linux/blk.h>
diff -urN linux-2.5.2-pre3/fs/intermezzo/upcall.c linux/fs/intermezzo/upcall.c
--- linux-2.5.2-pre3/fs/intermezzo/upcall.c	Sun Nov 11 10:20:21 2001
+++ linux/fs/intermezzo/upcall.c	Sun Dec 30 11:38:12 2001
@@ -20,7 +20,6 @@
  */
 
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/signal.h>
 #include <linux/signal.h>
 
@@ -37,7 +36,6 @@
 #include <linux/string.h>
 #include <asm/uaccess.h>
 #include <linux/vmalloc.h>
-#include <asm/segment.h>
 
 #include <linux/intermezzo_fs.h>
 #include <linux/intermezzo_upcall.h>
diff -urN linux-2.5.2-pre3/fs/isofs/joliet.c linux/fs/isofs/joliet.c
--- linux-2.5.2-pre3/fs/isofs/joliet.c	Sun Aug 12 10:56:56 2001
+++ linux/fs/isofs/joliet.c	Sun Dec 30 11:38:12 2001
@@ -8,7 +8,7 @@
 
 #include <linux/string.h>
 #include <linux/nls.h>
-#include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/iso_fs.h>
 #include <asm/unaligned.h>
 
diff -urN linux-2.5.2-pre3/fs/isofs/namei.c linux/fs/isofs/namei.c
--- linux-2.5.2-pre3/fs/isofs/namei.c	Sun Dec 16 12:23:05 2001
+++ linux/fs/isofs/namei.c	Sun Dec 30 11:38:12 2001
@@ -12,7 +12,7 @@
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/errno.h>
 #include <linux/config.h>	/* Joliet? */
 
diff -urN linux-2.5.2-pre3/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c
--- linux-2.5.2-pre3/fs/jffs/inode-v23.c	Thu Oct  4 15:14:35 2001
+++ linux/fs/jffs/inode-v23.c	Sun Dec 30 11:38:12 2001
@@ -365,7 +365,6 @@
 	inode->i_ctime = raw_inode->ctime;
 	inode->i_blksize = PAGE_SIZE;
 	inode->i_blocks = (inode->i_size + 511) >> 9;
-	inode->i_version = 0;
 
 	f = jffs_find_file(c, raw_inode->ino);
 
@@ -1023,7 +1022,6 @@
 	   from the in-memory file system structures.  */
 	jffs_insert_node(c, del_f, &raw_inode, 0, del_node);
 
-	dir->i_version = ++event;
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(dir);
 	inode->i_nlink--;
diff -urN linux-2.5.2-pre3/fs/jffs2/write.c linux/fs/jffs2/write.c
--- linux-2.5.2-pre3/fs/jffs2/write.c	Thu Oct  4 15:13:18 2001
+++ linux/fs/jffs2/write.c	Sun Dec 30 11:38:12 2001
@@ -31,7 +31,7 @@
  * provisions above, a recipient may use your version of this file
  * under either the RHEPL or the GPL.
  *
- * $Id: write.c,v 1.28 2001/05/01 16:25:25 dwmw2 Exp $
+ * $Id: write.c,v 1.30 2001/12/30 16:01:11 dwmw2 Exp $
  *
  */
 
@@ -207,8 +207,6 @@
 	}
 	raw->flash_offset = flash_ofs;
 	raw->totlen = PAD(ri->totlen);
-	raw->next_in_ino = f->inocache->nodes;
-	f->inocache->nodes = raw;
 	raw->next_phys = NULL;
 
 	fn->ofs = ri->offset;
@@ -222,6 +220,14 @@
 		       sizeof(*ri)+datalen, flash_ofs, ret, retlen);
 		/* Mark the space as dirtied */
 		if (retlen) {
+			/* Doesn't belong to any inode */
+			raw->next_in_ino = NULL;
+
+			/* Don't change raw->size to match retlen. We may have 
+			   written the node header already, and only the data will
+			   seem corrupted, in which case the scan would skip over
+			   any node we write before the original intended end of 
+			   this node */
 			jffs2_add_physical_node_ref(c, raw, sizeof(*ri)+datalen, 1);
 			jffs2_mark_node_obsolete(c, raw);
 		} else {
@@ -237,6 +243,11 @@
 	}
 	/* Mark the space used */
 	jffs2_add_physical_node_ref(c, raw, retlen, 0);
+
+	/* Link into per-inode list */
+	raw->next_in_ino = f->inocache->nodes;
+	f->inocache->nodes = raw;
+
 	D1(printk(KERN_DEBUG "jffs2_write_dnode wrote node at 0x%08x with dsize 0x%x, csize 0x%x, node_crc 0x%08x, data_crc 0x%08x, totlen 0x%08x\n", flash_ofs, ri->dsize, ri->csize, ri->node_crc, ri->data_crc, ri->totlen));
 	if (writelen)
 		*writelen = retlen;
diff -urN linux-2.5.2-pre3/fs/msdos/namei.c linux/fs/msdos/namei.c
--- linux-2.5.2-pre3/fs/msdos/namei.c	Fri Oct 12 13:48:42 2001
+++ linux/fs/msdos/namei.c	Sun Dec 30 11:38:12 2001
@@ -476,7 +476,7 @@
 		if (error)
 			goto out;
 	}
-	new_dir->i_version = ++event;
+	new_dir->i_version++;
 
 	/* There we go */
 
@@ -491,7 +491,7 @@
 	else
 		MSDOS_I(old_inode)->i_attrs &= ~ATTR_HIDDEN;
 	mark_inode_dirty(old_inode);
-	old_dir->i_version = ++event;
+	old_dir->i_version++;
 	old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(old_dir);
 	if (new_inode) {
@@ -528,7 +528,7 @@
 	else
 		MSDOS_I(old_inode)->i_attrs &= ~ATTR_HIDDEN;
 	mark_inode_dirty(old_inode);
-	old_dir->i_version = ++event;
+	old_dir->i_version++;
 	old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(old_dir);
 	return 0;
diff -urN linux-2.5.2-pre3/fs/namespace.c linux/fs/namespace.c
--- linux-2.5.2-pre3/fs/namespace.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/namespace.c	Sun Dec 30 11:38:12 2001
@@ -10,6 +10,7 @@
 
 #include <linux/config.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/quotaops.h>
diff -urN linux-2.5.2-pre3/fs/ncpfs/symlink.c linux/fs/ncpfs/symlink.c
--- linux-2.5.2-pre3/fs/ncpfs/symlink.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/ncpfs/symlink.c	Sun Dec 30 11:38:12 2001
@@ -21,7 +21,6 @@
 #ifdef CONFIG_NCPFS_EXTRAS
 
 #include <asm/uaccess.h>
-#include <asm/segment.h>
 
 #include <linux/errno.h>
 #include <linux/fs.h>
diff -urN linux-2.5.2-pre3/fs/nfs/write.c linux/fs/nfs/write.c
--- linux-2.5.2-pre3/fs/nfs/write.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/nfs/write.c	Sun Dec 30 11:38:12 2001
@@ -49,7 +49,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
-#include <linux/swap.h>
+#include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
 
diff -urN linux-2.5.2-pre3/fs/nfsd/export.c linux/fs/nfsd/export.c
--- linux-2.5.2-pre3/fs/nfsd/export.c	Wed Oct  3 22:57:36 2001
+++ linux/fs/nfsd/export.c	Sun Dec 30 11:38:12 2001
@@ -16,6 +16,7 @@
 
 #include <linux/unistd.h>
 #include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/stat.h>
 #include <linux/in.h>
 
diff -urN linux-2.5.2-pre3/fs/nls/nls_base.c linux/fs/nls/nls_base.c
--- linux-2.5.2-pre3/fs/nls/nls_base.c	Fri Feb  9 11:29:44 2001
+++ linux/fs/nls/nls_base.c	Sun Dec 30 11:38:12 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/config.h>
 #include <linux/nls.h>
-#include <linux/slab.h>
+#include <linux/kernel.h>
 #include <linux/errno.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
diff -urN linux-2.5.2-pre3/fs/nls/nls_big5.c linux/fs/nls/nls_big5.c
--- linux-2.5.2-pre3/fs/nls/nls_big5.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nls/nls_big5.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_big5)
 module_exit(exit_nls_big5)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp1251.c linux/fs/nls/nls_cp1251.c
--- linux-2.5.2-pre3/fs/nls/nls_cp1251.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp1251.c	Sun Dec 30 11:38:12 2001
@@ -315,4 +315,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp1255.c linux/fs/nls/nls_cp1255.c
--- linux-2.5.2-pre3/fs/nls/nls_cp1255.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp1255.c	Sun Dec 30 11:38:12 2001
@@ -396,4 +396,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp437.c linux/fs/nls/nls_cp437.c
--- linux-2.5.2-pre3/fs/nls/nls_cp437.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp437.c	Sun Dec 30 11:38:12 2001
@@ -401,4 +401,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp737.c linux/fs/nls/nls_cp737.c
--- linux-2.5.2-pre3/fs/nls/nls_cp737.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp737.c	Sun Dec 30 11:38:12 2001
@@ -364,4 +364,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp775.c linux/fs/nls/nls_cp775.c
--- linux-2.5.2-pre3/fs/nls/nls_cp775.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp775.c	Sun Dec 30 11:38:12 2001
@@ -333,4 +333,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp850.c linux/fs/nls/nls_cp850.c
--- linux-2.5.2-pre3/fs/nls/nls_cp850.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp850.c	Sun Dec 30 11:38:12 2001
@@ -329,4 +329,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp852.c linux/fs/nls/nls_cp852.c
--- linux-2.5.2-pre3/fs/nls/nls_cp852.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp852.c	Sun Dec 30 11:38:12 2001
@@ -351,4 +351,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp855.c linux/fs/nls/nls_cp855.c
--- linux-2.5.2-pre3/fs/nls/nls_cp855.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp855.c	Sun Dec 30 11:38:12 2001
@@ -313,4 +313,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp857.c linux/fs/nls/nls_cp857.c
--- linux-2.5.2-pre3/fs/nls/nls_cp857.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp857.c	Sun Dec 30 11:38:12 2001
@@ -315,4 +315,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp860.c linux/fs/nls/nls_cp860.c
--- linux-2.5.2-pre3/fs/nls/nls_cp860.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp860.c	Sun Dec 30 11:38:12 2001
@@ -378,4 +378,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp861.c linux/fs/nls/nls_cp861.c
--- linux-2.5.2-pre3/fs/nls/nls_cp861.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp861.c	Sun Dec 30 11:38:12 2001
@@ -401,4 +401,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp862.c linux/fs/nls/nls_cp862.c
--- linux-2.5.2-pre3/fs/nls/nls_cp862.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp862.c	Sun Dec 30 11:38:12 2001
@@ -435,4 +435,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp863.c linux/fs/nls/nls_cp863.c
--- linux-2.5.2-pre3/fs/nls/nls_cp863.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp863.c	Sun Dec 30 11:38:12 2001
@@ -395,4 +395,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp864.c linux/fs/nls/nls_cp864.c
--- linux-2.5.2-pre3/fs/nls/nls_cp864.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp864.c	Sun Dec 30 11:38:12 2001
@@ -421,4 +421,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp865.c linux/fs/nls/nls_cp865.c
--- linux-2.5.2-pre3/fs/nls/nls_cp865.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp865.c	Sun Dec 30 11:38:12 2001
@@ -401,4 +401,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp866.c linux/fs/nls/nls_cp866.c
--- linux-2.5.2-pre3/fs/nls/nls_cp866.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp866.c	Sun Dec 30 11:38:12 2001
@@ -319,4 +319,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp869.c linux/fs/nls/nls_cp869.c
--- linux-2.5.2-pre3/fs/nls/nls_cp869.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp869.c	Sun Dec 30 11:38:12 2001
@@ -329,4 +329,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp874.c linux/fs/nls/nls_cp874.c
--- linux-2.5.2-pre3/fs/nls/nls_cp874.c	Sun Sep 30 12:26:08 2001
+++ linux/fs/nls/nls_cp874.c	Sun Dec 30 11:38:12 2001
@@ -287,4 +287,4 @@
  * c-continued-brace-offset: 0
  * End:
  */
-MODULE_LICENSE("BSD without advertising clause");
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp932.c linux/fs/nls/nls_cp932.c
--- linux-2.5.2-pre3/fs/nls/nls_cp932.c	Fri Apr  6 10:51:19 2001
+++ linux/fs/nls/nls_cp932.c	Sun Dec 30 11:38:12 2001
@@ -7904,6 +7904,7 @@
 
 module_init(init_nls_cp932)
 module_exit(exit_nls_cp932)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp936.c linux/fs/nls/nls_cp936.c
--- linux-2.5.2-pre3/fs/nls/nls_cp936.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_cp936.c	Sun Dec 30 11:38:12 2001
@@ -11024,6 +11024,7 @@
 
 module_init(init_nls_cp936)
 module_exit(exit_nls_cp936)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp949.c linux/fs/nls/nls_cp949.c
--- linux-2.5.2-pre3/fs/nls/nls_cp949.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_cp949.c	Sun Dec 30 11:38:12 2001
@@ -13941,6 +13941,7 @@
 
 module_init(init_nls_cp949)
 module_exit(exit_nls_cp949)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_cp950.c linux/fs/nls/nls_cp950.c
--- linux-2.5.2-pre3/fs/nls/nls_cp950.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_cp950.c	Sun Dec 30 11:38:12 2001
@@ -9480,6 +9480,7 @@
 
 module_init(init_nls_cp950)
 module_exit(exit_nls_cp950)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_euc-jp.c linux/fs/nls/nls_euc-jp.c
--- linux-2.5.2-pre3/fs/nls/nls_euc-jp.c	Fri Apr  6 10:51:19 2001
+++ linux/fs/nls/nls_euc-jp.c	Sun Dec 30 11:38:12 2001
@@ -581,6 +581,7 @@
 
 module_init(init_nls_euc_jp)
 module_exit(exit_nls_euc_jp)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_euc-kr.c linux/fs/nls/nls_euc-kr.c
--- linux-2.5.2-pre3/fs/nls/nls_euc-kr.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nls/nls_euc-kr.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_euc_kr)
 module_exit(exit_nls_euc_kr)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_gb2312.c linux/fs/nls/nls_gb2312.c
--- linux-2.5.2-pre3/fs/nls/nls_gb2312.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nls/nls_gb2312.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_gb2312)
 module_exit(exit_nls_gb2312)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-1.c linux/fs/nls/nls_iso8859-1.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-1.c	Tue Jul 18 22:48:33 2000
+++ linux/fs/nls/nls_iso8859-1.c	Sun Dec 30 11:38:12 2001
@@ -254,6 +254,7 @@
 
 module_init(init_nls_iso8859_1)
 module_exit(exit_nls_iso8859_1)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-13.c linux/fs/nls/nls_iso8859-13.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-13.c	Sat May 19 17:47:55 2001
+++ linux/fs/nls/nls_iso8859-13.c	Sun Dec 30 11:38:12 2001
@@ -282,6 +282,7 @@
 
 module_init(init_nls_iso8859_13)
 module_exit(exit_nls_iso8859_13)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-14.c linux/fs/nls/nls_iso8859-14.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-14.c	Tue Jul 18 22:48:33 2000
+++ linux/fs/nls/nls_iso8859-14.c	Sun Dec 30 11:38:12 2001
@@ -338,6 +338,7 @@
 
 module_init(init_nls_iso8859_14)
 module_exit(exit_nls_iso8859_14)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-15.c linux/fs/nls/nls_iso8859-15.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-15.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-15.c	Sun Dec 30 11:38:12 2001
@@ -304,6 +304,7 @@
 
 module_init(init_nls_iso8859_15)
 module_exit(exit_nls_iso8859_15)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-2.c linux/fs/nls/nls_iso8859-2.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-2.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-2.c	Sun Dec 30 11:38:12 2001
@@ -305,6 +305,7 @@
 
 module_init(init_nls_iso8859_2)
 module_exit(exit_nls_iso8859_2)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-3.c linux/fs/nls/nls_iso8859-3.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-3.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-3.c	Sun Dec 30 11:38:12 2001
@@ -305,6 +305,7 @@
 
 module_init(init_nls_iso8859_3)
 module_exit(exit_nls_iso8859_3)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-4.c linux/fs/nls/nls_iso8859-4.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-4.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-4.c	Sun Dec 30 11:38:12 2001
@@ -305,6 +305,7 @@
 
 module_init(init_nls_iso8859_4)
 module_exit(exit_nls_iso8859_4)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-5.c linux/fs/nls/nls_iso8859-5.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-5.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-5.c	Sun Dec 30 11:38:12 2001
@@ -269,6 +269,7 @@
 
 module_init(init_nls_iso8859_5)
 module_exit(exit_nls_iso8859_5)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-6.c linux/fs/nls/nls_iso8859-6.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-6.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-6.c	Sun Dec 30 11:38:12 2001
@@ -260,6 +260,7 @@
 
 module_init(init_nls_iso8859_6)
 module_exit(exit_nls_iso8859_6)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-7.c linux/fs/nls/nls_iso8859-7.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-7.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-7.c	Sun Dec 30 11:38:12 2001
@@ -314,6 +314,7 @@
 
 module_init(init_nls_iso8859_7)
 module_exit(exit_nls_iso8859_7)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-8.c linux/fs/nls/nls_iso8859-8.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-8.c	Fri Apr  6 10:51:19 2001
+++ linux/fs/nls/nls_iso8859-8.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_iso8859_8)
 module_exit(exit_nls_iso8859_8)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_iso8859-9.c linux/fs/nls/nls_iso8859-9.c
--- linux-2.5.2-pre3/fs/nls/nls_iso8859-9.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_iso8859-9.c	Sun Dec 30 11:38:12 2001
@@ -269,6 +269,7 @@
 
 module_init(init_nls_iso8859_9)
 module_exit(exit_nls_iso8859_9)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_koi8-r.c linux/fs/nls/nls_koi8-r.c
--- linux-2.5.2-pre3/fs/nls/nls_koi8-r.c	Fri Jul 21 15:19:51 2000
+++ linux/fs/nls/nls_koi8-r.c	Sun Dec 30 11:38:12 2001
@@ -320,6 +320,7 @@
 
 module_init(init_nls_koi8_r)
 module_exit(exit_nls_koi8_r)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_koi8-ru.c linux/fs/nls/nls_koi8-ru.c
--- linux-2.5.2-pre3/fs/nls/nls_koi8-ru.c	Sat May 19 17:47:55 2001
+++ linux/fs/nls/nls_koi8-ru.c	Sun Dec 30 11:38:12 2001
@@ -80,6 +80,7 @@
 
 module_init(init_nls_koi8_ru)
 module_exit(exit_nls_koi8_ru)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_koi8-u.c linux/fs/nls/nls_koi8-u.c
--- linux-2.5.2-pre3/fs/nls/nls_koi8-u.c	Sat May 19 17:47:55 2001
+++ linux/fs/nls/nls_koi8-u.c	Sun Dec 30 11:38:12 2001
@@ -327,6 +327,7 @@
 
 module_init(init_nls_koi8_u)
 module_exit(exit_nls_koi8_u)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_sjis.c linux/fs/nls/nls_sjis.c
--- linux-2.5.2-pre3/fs/nls/nls_sjis.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nls/nls_sjis.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_sjis)
 module_exit(exit_nls_sjis)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_tis-620.c linux/fs/nls/nls_tis-620.c
--- linux-2.5.2-pre3/fs/nls/nls_tis-620.c	Fri Apr  6 10:51:19 2001
+++ linux/fs/nls/nls_tis-620.c	Sun Dec 30 11:38:12 2001
@@ -42,6 +42,7 @@
 
 module_init(init_nls_tis_620)
 module_exit(exit_nls_tis_620)
+MODULE_LICENSE("Dual BSD/GPL");
 
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
diff -urN linux-2.5.2-pre3/fs/nls/nls_utf8.c linux/fs/nls/nls_utf8.c
--- linux-2.5.2-pre3/fs/nls/nls_utf8.c	Tue Jul 18 22:48:33 2000
+++ linux/fs/nls/nls_utf8.c	Sun Dec 30 11:38:12 2001
@@ -58,3 +58,4 @@
 
 module_init(init_nls_utf8)
 module_exit(exit_nls_utf8)
+MODULE_LICENSE("Dual BSD/GPL");
diff -urN linux-2.5.2-pre3/fs/proc/base.c linux/fs/proc/base.c
--- linux-2.5.2-pre3/fs/proc/base.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/proc/base.c	Sun Dec 30 11:38:12 2001
@@ -25,6 +25,7 @@
 #include <linux/string.h>
 #include <linux/seq_file.h>
 #include <linux/namespace.h>
+#include <linux/mm.h>
 
 /*
  * For hysterical raisins we keep the same inumbers as in the old procfs.
diff -urN linux-2.5.2-pre3/fs/qnx4/dir.c linux/fs/qnx4/dir.c
--- linux-2.5.2-pre3/fs/qnx4/dir.c	Sun Dec 16 12:23:05 2001
+++ linux/fs/qnx4/dir.c	Sun Dec 30 11:38:12 2001
@@ -18,7 +18,6 @@
 #include <linux/qnx4_fs.h>
 #include <linux/stat.h>
 
-#include <asm/segment.h>
 
 static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
diff -urN linux-2.5.2-pre3/fs/qnx4/fsync.c linux/fs/qnx4/fsync.c
--- linux-2.5.2-pre3/fs/qnx4/fsync.c	Sun Dec 16 12:23:05 2001
+++ linux/fs/qnx4/fsync.c	Sun Dec 30 11:38:12 2001
@@ -21,7 +21,6 @@
 #include <linux/fs.h>
 #include <linux/qnx4_fs.h>
 
-#include <asm/segment.h>
 #include <asm/system.h>
 
 /*
diff -urN linux-2.5.2-pre3/fs/qnx4/inode.c linux/fs/qnx4/inode.c
--- linux-2.5.2-pre3/fs/qnx4/inode.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/qnx4/inode.c	Sun Dec 30 11:38:12 2001
@@ -18,8 +18,8 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
-#include <linux/qnx4_fs.h>
 #include <linux/fs.h>
+#include <linux/qnx4_fs.h>
 #include <linux/locks.h>
 #include <linux/init.h>
 #include <linux/highuid.h>
diff -urN linux-2.5.2-pre3/fs/qnx4/namei.c linux/fs/qnx4/namei.c
--- linux-2.5.2-pre3/fs/qnx4/namei.c	Tue Sep  5 14:07:30 2000
+++ linux/fs/qnx4/namei.c	Sun Dec 30 11:38:12 2001
@@ -21,7 +21,6 @@
 #include <linux/fcntl.h>
 #include <linux/errno.h>
 
-#include <asm/segment.h>
 
 /*
  * check if the filename is correct. For some obscure reason, qnx writes a
diff -urN linux-2.5.2-pre3/fs/qnx4/truncate.c linux/fs/qnx4/truncate.c
--- linux-2.5.2-pre3/fs/qnx4/truncate.c	Fri Feb  9 11:29:44 2001
+++ linux/fs/qnx4/truncate.c	Sun Dec 30 11:38:12 2001
@@ -13,9 +13,8 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/qnx4_fs.h>
 #include <linux/fs.h>
+#include <linux/qnx4_fs.h>
 #include <linux/locks.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.5.2-pre3/fs/reiserfs/super.c linux/fs/reiserfs/super.c
--- linux-2.5.2-pre3/fs/reiserfs/super.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/reiserfs/super.c	Sun Dec 30 11:38:12 2001
@@ -637,7 +637,6 @@
 	else
 	    old_format = 1;
     }
-    s->s_blocksize = size;
 
     s->u.reiserfs_sb.s_mount_state = SB_REISERFS_STATE(s);
     s->u.reiserfs_sb.s_mount_state = REISERFS_VALID_FS ;
diff -urN linux-2.5.2-pre3/fs/sysv/dir.c linux/fs/sysv/dir.c
--- linux-2.5.2-pre3/fs/sysv/dir.c	Fri Nov  9 13:45:35 2001
+++ linux/fs/sysv/dir.c	Sun Dec 30 11:38:12 2001
@@ -41,7 +41,6 @@
 	struct inode *dir = (struct inode *)page->mapping->host;
 	int err = 0;
 
-	dir->i_version = ++event;
 	page->mapping->a_ops->commit_write(NULL, page, from, to);
 	if (IS_SYNC(dir))
 		err = waitfor_one_page(page);
@@ -111,7 +110,6 @@
 
 done:
 	filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
-	filp->f_version = inode->i_version;
 	UPDATE_ATIME(inode);
 	return 0;
 }
diff -urN linux-2.5.2-pre3/fs/udf/inode.c linux/fs/udf/inode.c
--- linux-2.5.2-pre3/fs/udf/inode.c	Sun Dec 30 11:38:08 2001
+++ linux/fs/udf/inode.c	Sun Dec 30 11:38:12 2001
@@ -215,7 +215,6 @@
 	page_cache_release(page);
 
 	mark_inode_dirty(inode);
-	inode->i_version ++;
 }
 
 struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int *err)
@@ -310,7 +309,6 @@
 	mark_buffer_dirty(sbh);
 	udf_release_data(sbh);
 	mark_inode_dirty(inode);
-	inode->i_version ++;
 	return dbh;
 }
 
@@ -1033,7 +1031,6 @@
 	long convtime_usec;
 	int offset, alen;
 
-	inode->i_version = ++event;
 	UDF_I_NEW_INODE(inode) = 0;
 
 	fe = (struct FileEntry *)bh->b_data;
diff -urN linux-2.5.2-pre3/fs/udf/namei.c linux/fs/udf/namei.c
--- linux-2.5.2-pre3/fs/udf/namei.c	Sun Dec 16 12:23:05 2001
+++ linux/fs/udf/namei.c	Sun Dec 30 11:38:12 2001
@@ -595,7 +595,6 @@
 		dir->i_size += nfidlen;
 		if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_IN_ICB)
 			UDF_I_LENALLOC(dir) += nfidlen;
-		dir->i_version = ++event;
 		mark_inode_dirty(dir);
 		return fi;
 	}
@@ -654,7 +653,6 @@
 	if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_IN_ICB)
 	{
 		mark_inode_dirty(dir);
-		dir->i_version = ++event;
 	}
 	if (fibh.sbh != fibh.ebh)
 		udf_release_data(fibh.ebh);
@@ -692,7 +690,6 @@
 	if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_IN_ICB)
 	{
 		mark_inode_dirty(dir);
-		dir->i_version = ++event;
 	}
 	mark_inode_dirty(inode);
 
@@ -756,7 +753,6 @@
 		cpu_to_le32(UDF_I_UNIQUE(inode) & 0x00000000FFFFFFFFUL);
 	cfi.fileCharacteristics |= FILE_DIRECTORY;
 	udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL);
-	dir->i_version = ++event;
 	dir->i_nlink++;
 	mark_inode_dirty(dir);
 	d_instantiate(dentry, inode);
@@ -851,14 +847,12 @@
 	if (!empty_dir(inode))
 		goto end_rmdir;
 	retval = udf_delete_entry(dir, fi, &fibh, &cfi);
-	dir->i_version = ++event;
 	if (retval)
 		goto end_rmdir;
 	if (inode->i_nlink != 2)
 		udf_warning(inode->i_sb, "udf_rmdir",
 			"empty directory has nlink != 2 (%d)",
 			inode->i_nlink);
-	inode->i_version = ++event;
 	inode->i_nlink = 0;
 	inode->i_size = 0;
 	mark_inode_dirty(inode);
@@ -1070,7 +1064,6 @@
 	if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_IN_ICB)
 	{
 		mark_inode_dirty(dir);
-		dir->i_version = ++event;
 	}
 	if (fibh.sbh != fibh.ebh)
 		udf_release_data(fibh.ebh);
@@ -1123,7 +1116,6 @@
 	if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_IN_ICB)
 	{
 		mark_inode_dirty(dir);
-		dir->i_version = ++event;
 	}
 	if (fibh.sbh != fibh.ebh)
 		udf_release_data(fibh.ebh);
@@ -1205,7 +1197,6 @@
 		if (!nfi)
 			goto end_rename;
 	}
-	new_dir->i_version = ++event;
 
 	/*
 	 * Like most other Unix systems, set the ctime for inodes on a
@@ -1227,7 +1218,6 @@
 	ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi);
 	udf_delete_entry(old_dir, ofi, &ofibh, &ocfi);
 
-	old_dir->i_version = ++event;
 	if (new_inode)
 	{
 		new_inode->i_nlink--;
@@ -1247,7 +1237,6 @@
 		if (UDF_I_ALLOCTYPE(old_inode) == ICB_FLAG_AD_IN_ICB)
 		{
 			mark_inode_dirty(old_inode);
-			old_inode->i_version = ++event;
 		}
 		else
 			mark_buffer_dirty_inode(dir_bh, old_inode);
diff -urN linux-2.5.2-pre3/fs/vfat/namei.c linux/fs/vfat/namei.c
--- linux-2.5.2-pre3/fs/vfat/namei.c	Thu Oct 25 00:02:26 2001
+++ linux/fs/vfat/namei.c	Sun Dec 30 11:38:12 2001
@@ -1040,8 +1040,8 @@
 		return res;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(inode);
-	inode->i_version = ++event;
-	dir->i_version = event;
+	inode->i_version++;
+	dir->i_version++;
 	dentry->d_time = dentry->d_parent->d_inode->i_version;
 	d_instantiate(dentry,inode);
 	return 0;
@@ -1057,7 +1057,7 @@
 	/* remove the shortname */
 	dir->i_mtime = CURRENT_TIME;
 	dir->i_atime = CURRENT_TIME;
-	dir->i_version = ++event;
+	dir->i_version++;
 	mark_inode_dirty(dir);
 	de->name[0] = DELETED_FLAG;
 	fat_mark_buffer_dirty(sb, bh);
@@ -1138,8 +1138,8 @@
 		goto out;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 	mark_inode_dirty(inode);
-	inode->i_version = ++event;
-	dir->i_version = event;
+	inode->i_version++;
+	dir->i_version++;
 	dir->i_nlink++;
 	inode->i_nlink = 2; /* no need to mark them dirty */
 	res = fat_new_dir(inode, dir, 1);
@@ -1209,7 +1209,7 @@
 		if (res < 0) goto rename_done;
 	}
 
-	new_dir->i_version = ++event;
+	new_dir->i_version++;
 
 	/* releases old_bh */
 	vfat_remove_entry(old_dir,&old_sinfo,old_bh,old_de);
@@ -1218,7 +1218,7 @@
 	fat_attach(old_inode, sinfo.ino);
 	mark_inode_dirty(old_inode);
 
-	old_dir->i_version = ++event;
+	old_dir->i_version++;
 	old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(old_dir);
 	if (new_inode) {
diff -urN linux-2.5.2-pre3/include/linux/blkdev.h linux/include/linux/blkdev.h
--- linux-2.5.2-pre3/include/linux/blkdev.h	Sun Dec 30 11:38:08 2001
+++ linux/include/linux/blkdev.h	Sun Dec 30 11:38:12 2001
@@ -228,8 +228,8 @@
  * BLK_BOUNCE_ANY	: don't bounce anything
  * BLK_BOUNCE_ISA	: bounce pages above ISA DMA boundary
  */
-#define BLK_BOUNCE_HIGH		((blk_max_low_pfn + 1) << PAGE_SHIFT)
-#define BLK_BOUNCE_ANY		((blk_max_pfn + 1) << PAGE_SHIFT)
+#define BLK_BOUNCE_HIGH		(blk_max_low_pfn << PAGE_SHIFT)
+#define BLK_BOUNCE_ANY		(blk_max_pfn << PAGE_SHIFT)
 #define BLK_BOUNCE_ISA		(ISA_DMA_THRESHOLD)
 
 extern int init_emergency_isa_pool(void);
diff -urN linux-2.5.2-pre3/include/linux/ext2_fs_sb.h linux/include/linux/ext2_fs_sb.h
--- linux-2.5.2-pre3/include/linux/ext2_fs_sb.h	Fri Dec 29 14:36:44 2000
+++ linux/include/linux/ext2_fs_sb.h	Sun Dec 30 11:38:12 2001
@@ -56,6 +56,7 @@
 	int s_desc_per_block_bits;
 	int s_inode_size;
 	int s_first_ino;
+	u32 s_next_generation;
 };
 
 #endif	/* _LINUX_EXT2_FS_SB */
diff -urN linux-2.5.2-pre3/include/linux/file.h linux/include/linux/file.h
--- linux-2.5.2-pre3/include/linux/file.h	Wed Aug 23 11:22:26 2000
+++ linux/include/linux/file.h	Sun Dec 30 11:38:12 2001
@@ -5,6 +5,8 @@
 #ifndef __LINUX_FILE_H
 #define __LINUX_FILE_H
 
+#include <linux/sched.h>
+
 extern void FASTCALL(fput(struct file *));
 extern struct file * FASTCALL(fget(unsigned int fd));
  
diff -urN linux-2.5.2-pre3/include/linux/gfp.h linux/include/linux/gfp.h
--- linux-2.5.2-pre3/include/linux/gfp.h	Wed Dec 31 16:00:00 1969
+++ linux/include/linux/gfp.h	Sun Dec 30 11:38:12 2001
@@ -0,0 +1,81 @@
+#ifndef __LINUX_GFP_H
+#define __LINUX_GFP_H
+
+#include <linux/mmzone.h>
+#include <linux/stddef.h>
+#include <linux/linkage.h>
+/*
+ * GFP bitmasks..
+ */
+/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low four bits) */
+#define __GFP_DMA	0x01
+#define __GFP_HIGHMEM	0x02
+
+/* Action modifiers - doesn't change the zoning */
+#define __GFP_WAIT	0x10	/* Can wait and reschedule? */
+#define __GFP_HIGH	0x20	/* Should access emergency pools? */
+#define __GFP_IO	0x40	/* Can start low memory physical IO? */
+#define __GFP_HIGHIO	0x80	/* Can start high mem physical IO? */
+#define __GFP_FS	0x100	/* Can call down to low-level FS? */
+
+#define GFP_NOHIGHIO	(__GFP_HIGH | __GFP_WAIT | __GFP_IO)
+#define GFP_NOIO	(__GFP_HIGH | __GFP_WAIT)
+#define GFP_NOFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO)
+#define GFP_ATOMIC	(__GFP_HIGH)
+#define GFP_USER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_HIGHUSER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS | __GFP_HIGHMEM)
+#define GFP_KERNEL	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_NFS		(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+#define GFP_KSWAPD	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
+
+/* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
+   platforms, used as appropriate on others */
+
+#define GFP_DMA		__GFP_DMA
+
+/*
+ * There is only one page-allocator function, and two main namespaces to
+ * it. The alloc_page*() variants return 'struct page *' and as such
+ * can allocate highmem pages, the *get*page*() variants return
+ * virtual kernel addresses to the allocated page(s).
+ */
+extern struct page * FASTCALL(_alloc_pages(unsigned int gfp_mask, unsigned int order));
+extern struct page * FASTCALL(__alloc_pages(unsigned int gfp_mask, unsigned int order, zonelist_t *zonelist));
+extern struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned int order);
+
+static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order)
+{
+	/*
+	 * Gets optimized away by the compiler.
+	 */
+	if (order >= MAX_ORDER)
+		return NULL;
+	return _alloc_pages(gfp_mask, order);
+}
+
+#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
+
+extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order));
+extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
+
+#define __get_free_page(gfp_mask) \
+		__get_free_pages((gfp_mask),0)
+
+#define __get_dma_pages(gfp_mask, order) \
+		__get_free_pages((gfp_mask) | GFP_DMA,(order))
+
+/*
+ * The old interface name will be removed in 2.5:
+ */
+#define get_free_page get_zeroed_page
+
+/*
+ * There is only one 'core' page-freeing function.
+ */
+extern void FASTCALL(__free_pages(struct page *page, unsigned int order));
+extern void FASTCALL(free_pages(unsigned long addr, unsigned int order));
+
+#define __free_page(page) __free_pages((page), 0)
+#define free_page(addr) free_pages((addr),0)
+
+#endif /* __LINUX_GFP_H */
diff -urN linux-2.5.2-pre3/include/linux/i8k.h linux/include/linux/i8k.h
--- linux-2.5.2-pre3/include/linux/i8k.h	Fri Nov  2 17:46:47 2001
+++ linux/include/linux/i8k.h	Sun Dec 30 11:38:12 2001
@@ -1,5 +1,5 @@
 /*
- * i8k.h -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ * i8k.h -- Linux driver for accessing the SMM BIOS on Dell laptops
  *
  * Copyright (C) 2001  Massimo Dal Zotto <dz@debian.org>
  *
@@ -36,9 +36,9 @@
 #define I8K_FAN_HIGH		2
 #define I8K_FAN_MAX		I8K_FAN_HIGH
 
-#define I8K_VOL_UP		0x01
-#define I8K_VOL_DOWN		0x02
-#define I8K_VOL_MUTE		0x03
+#define I8K_VOL_UP		1
+#define I8K_VOL_DOWN		2
+#define I8K_VOL_MUTE		4
 
 #define I8K_AC			1
 #define I8K_BATTERY		0
diff -urN linux-2.5.2-pre3/include/linux/interrupt.h linux/include/linux/interrupt.h
--- linux-2.5.2-pre3/include/linux/interrupt.h	Sun Dec 16 15:43:25 2001
+++ linux/include/linux/interrupt.h	Sun Dec 30 11:38:12 2001
@@ -3,12 +3,14 @@
 #define _LINUX_INTERRUPT_H
 
 #include <linux/config.h>
+#include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/cache.h>
 
 #include <asm/bitops.h>
 #include <asm/atomic.h>
+#include <asm/system.h>
 #include <asm/ptrace.h>
 
 struct irqaction {
diff -urN linux-2.5.2-pre3/include/linux/isdn.h linux/include/linux/isdn.h
--- linux-2.5.2-pre3/include/linux/isdn.h	Sun Sep 30 12:26:42 2001
+++ linux/include/linux/isdn.h	Sun Dec 30 11:38:12 2001
@@ -150,7 +150,6 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/major.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
diff -urN linux-2.5.2-pre3/include/linux/kernel.h linux/include/linux/kernel.h
--- linux-2.5.2-pre3/include/linux/kernel.h	Sun Dec 16 15:43:25 2001
+++ linux/include/linux/kernel.h	Sun Dec 30 11:38:12 2001
@@ -37,16 +37,6 @@
 #define	KERN_INFO	"<6>"	/* informational			*/
 #define	KERN_DEBUG	"<7>"	/* debug-level messages			*/
 
-# define NORET_TYPE    /**/
-# define ATTRIB_NORET  __attribute__((noreturn))
-# define NORET_AND     noreturn,
-
-#ifdef __i386__
-#define FASTCALL(x)	x __attribute__((regparm(3)))
-#else
-#define FASTCALL(x)	x
-#endif
-
 struct completion;
 
 extern struct notifier_block *panic_notifier_list;
diff -urN linux-2.5.2-pre3/include/linux/linkage.h linux/include/linux/linkage.h
--- linux-2.5.2-pre3/include/linux/linkage.h	Mon Dec 11 12:49:54 2000
+++ linux/include/linux/linkage.h	Sun Dec 30 11:38:12 2001
@@ -60,4 +60,14 @@
 
 #endif
 
+# define NORET_TYPE    /**/
+# define ATTRIB_NORET  __attribute__((noreturn))
+# define NORET_AND     noreturn,
+
+#ifdef __i386__
+#define FASTCALL(x)	x __attribute__((regparm(3)))
+#else
+#define FASTCALL(x)	x
+#endif
+
 #endif
diff -urN linux-2.5.2-pre3/include/linux/mm.h linux/include/linux/mm.h
--- linux-2.5.2-pre3/include/linux/mm.h	Sun Dec 16 15:43:26 2001
+++ linux/include/linux/mm.h	Sun Dec 30 11:38:12 2001
@@ -7,6 +7,7 @@
 #ifdef __KERNEL__
 
 #include <linux/config.h>
+#include <linux/gfp.h>
 #include <linux/string.h>
 #include <linux/list.h>
 #include <linux/mmzone.h>
@@ -344,51 +345,6 @@
 /* The array of struct pages */
 extern mem_map_t * mem_map;
 
-/*
- * There is only one page-allocator function, and two main namespaces to
- * it. The alloc_page*() variants return 'struct page *' and as such
- * can allocate highmem pages, the *get*page*() variants return
- * virtual kernel addresses to the allocated page(s).
- */
-extern struct page * FASTCALL(_alloc_pages(unsigned int gfp_mask, unsigned int order));
-extern struct page * FASTCALL(__alloc_pages(unsigned int gfp_mask, unsigned int order, zonelist_t *zonelist));
-extern struct page * alloc_pages_node(int nid, unsigned int gfp_mask, unsigned int order);
-
-static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order)
-{
-	/*
-	 * Gets optimized away by the compiler.
-	 */
-	if (order >= MAX_ORDER)
-		return NULL;
-	return _alloc_pages(gfp_mask, order);
-}
-
-#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
-
-extern unsigned long FASTCALL(__get_free_pages(unsigned int gfp_mask, unsigned int order));
-extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask));
-
-#define __get_free_page(gfp_mask) \
-		__get_free_pages((gfp_mask),0)
-
-#define __get_dma_pages(gfp_mask, order) \
-		__get_free_pages((gfp_mask) | GFP_DMA,(order))
-
-/*
- * The old interface name will be removed in 2.5:
- */
-#define get_free_page get_zeroed_page
-
-/*
- * There is only one 'core' page-freeing function.
- */
-extern void FASTCALL(__free_pages(struct page *page, unsigned int order));
-extern void FASTCALL(free_pages(unsigned long addr, unsigned int order));
-
-#define __free_page(page) __free_pages((page), 0)
-#define free_page(addr) free_pages((addr),0)
-
 extern void show_free_areas(void);
 extern void show_free_areas_node(pg_data_t *pgdat);
 
@@ -418,6 +374,9 @@
 extern void ptrace_disable(struct task_struct *);
 extern int ptrace_check_attach(struct task_struct *task, int kill);
 
+int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
+		int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
+
 /*
  * On a two-level page table, this ends up being trivial. Thus the
  * inlining and the symmetry break with pte_alloc() that does all
@@ -511,35 +470,6 @@
 /* generic vm_area_ops exported for stackable file systems */
 extern int filemap_sync(struct vm_area_struct *, unsigned long,	size_t, unsigned int);
 extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int);
-
-/*
- * GFP bitmasks..
- */
-/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low four bits) */
-#define __GFP_DMA	0x01
-#define __GFP_HIGHMEM	0x02
-
-/* Action modifiers - doesn't change the zoning */
-#define __GFP_WAIT	0x10	/* Can wait and reschedule? */
-#define __GFP_HIGH	0x20	/* Should access emergency pools? */
-#define __GFP_IO	0x40	/* Can start low memory physical IO? */
-#define __GFP_HIGHIO	0x80	/* Can start high mem physical IO? */
-#define __GFP_FS	0x100	/* Can call down to low-level FS? */
-
-#define GFP_NOHIGHIO	(__GFP_HIGH | __GFP_WAIT | __GFP_IO)
-#define GFP_NOIO	(__GFP_HIGH | __GFP_WAIT)
-#define GFP_NOFS	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO)
-#define GFP_ATOMIC	(__GFP_HIGH)
-#define GFP_USER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
-#define GFP_HIGHUSER	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS | __GFP_HIGHMEM)
-#define GFP_KERNEL	(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
-#define GFP_NFS		(__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
-#define GFP_KSWAPD	(             __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS)
-
-/* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
-   platforms, used as appropriate on others */
-
-#define GFP_DMA		__GFP_DMA
 
 /* vma is the first one with  address < vma->vm_end,
  * and even  address < vma->vm_start. Have to extend vma. */
diff -urN linux-2.5.2-pre3/include/linux/parport.h linux/include/linux/parport.h
--- linux-2.5.2-pre3/include/linux/parport.h	Wed Nov 14 14:52:47 2001
+++ linux/include/linux/parport.h	Sun Dec 30 11:38:12 2001
@@ -8,6 +8,7 @@
 
 #ifndef _PARPORT_H_
 #define _PARPORT_H_
+#include <linux/sched.h>
 
 /* Start off with user-visible constants */
 
diff -urN linux-2.5.2-pre3/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- linux-2.5.2-pre3/include/linux/proc_fs.h	Sun Dec 16 15:43:28 2001
+++ linux/include/linux/proc_fs.h	Sun Dec 30 11:38:12 2001
@@ -3,6 +3,8 @@
 
 #include <linux/config.h>
 #include <linux/slab.h>
+#include <linux/fs.h>
+#include <asm/atomic.h>
 
 /*
  * The proc filesystem constants/structures
diff -urN linux-2.5.2-pre3/include/linux/reiserfs_fs.h linux/include/linux/reiserfs_fs.h
--- linux-2.5.2-pre3/include/linux/reiserfs_fs.h	Sun Dec 30 11:38:08 2001
+++ linux/include/linux/reiserfs_fs.h	Sun Dec 30 11:38:12 2001
@@ -15,10 +15,10 @@
 #include <linux/types.h>
 #ifdef __KERNEL__
 #include <linux/slab.h>
+#include <linux/interrupt.h>
 #include <linux/tqueue.h>
 #include <asm/unaligned.h>
 #include <linux/bitops.h>
-#include <asm/hardirq.h>
 #include <linux/proc_fs.h>
 #endif
 
diff -urN linux-2.5.2-pre3/include/linux/shm.h linux/include/linux/shm.h
--- linux-2.5.2-pre3/include/linux/shm.h	Sun Dec 16 15:43:31 2001
+++ linux/include/linux/shm.h	Sun Dec 30 11:38:12 2001
@@ -80,7 +80,6 @@
 asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, unsigned long *addr);
 asmlinkage long sys_shmdt (char *shmaddr);
 asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds *buf);
-extern void shm_unuse(swp_entry_t entry, struct page *page);
 
 #endif /* __KERNEL__ */
 
diff -urN linux-2.5.2-pre3/include/linux/slab.h linux/include/linux/slab.h
--- linux-2.5.2-pre3/include/linux/slab.h	Sun Dec 16 15:43:26 2001
+++ linux/include/linux/slab.h	Sun Dec 30 11:38:12 2001
@@ -11,8 +11,8 @@
 
 typedef struct kmem_cache_s kmem_cache_t;
 
-#include	<linux/mm.h>
-#include	<linux/cache.h>
+#include	<linux/gfp.h>
+#include	<linux/types.h>
 
 /* flags for kmem_cache_alloc() */
 #define	SLAB_NOFS		GFP_NOFS
@@ -64,6 +64,7 @@
 extern int FASTCALL(kmem_cache_reap(int));
 extern int slabinfo_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data);
+struct file;
 extern int slabinfo_write_proc(struct file *file, const char *buffer,
 			   unsigned long count, void *data);
 
diff -urN linux-2.5.2-pre3/include/linux/sunrpc/clnt.h linux/include/linux/sunrpc/clnt.h
--- linux-2.5.2-pre3/include/linux/sunrpc/clnt.h	Sun Dec 16 15:44:19 2001
+++ linux/include/linux/sunrpc/clnt.h	Sun Dec 30 11:38:12 2001
@@ -15,6 +15,7 @@
 #include <linux/sunrpc/auth.h>
 #include <linux/sunrpc/stats.h>
 #include <linux/sunrpc/xdr.h>
+#include <asm/signal.h>
 
 /*
  * This defines an RPC port mapping
diff -urN linux-2.5.2-pre3/include/linux/wait.h linux/include/linux/wait.h
--- linux-2.5.2-pre3/include/linux/wait.h	Sun Dec 16 15:43:25 2001
+++ linux/include/linux/wait.h	Sun Dec 30 11:38:12 2001
@@ -19,24 +19,11 @@
 #include <asm/page.h>
 #include <asm/processor.h>
 
-/*
- * Debug control.  Slow but useful.
- */
-#if defined(CONFIG_DEBUG_WAITQ)
-#define WAITQUEUE_DEBUG 1
-#else
-#define WAITQUEUE_DEBUG 0
-#endif
-
 struct __wait_queue {
 	unsigned int flags;
 #define WQ_FLAG_EXCLUSIVE	0x01
 	struct task_struct * task;
 	struct list_head task_list;
-#if WAITQUEUE_DEBUG
-	long __magic;
-	long __waker;
-#endif
 };
 typedef struct __wait_queue wait_queue_t;
 
@@ -77,129 +64,47 @@
 struct __wait_queue_head {
 	wq_lock_t lock;
 	struct list_head task_list;
-#if WAITQUEUE_DEBUG
-	long __magic;
-	long __creator;
-#endif
 };
 typedef struct __wait_queue_head wait_queue_head_t;
 
 
 /*
- * Debugging macros.  We eschew `do { } while (0)' because gcc can generate
- * spurious .aligns.
- */
-#if WAITQUEUE_DEBUG
-#define WQ_BUG()	BUG()
-#define CHECK_MAGIC(x)							\
-	do {									\
-		if ((x) != (long)&(x)) {					\
-			printk("bad magic %lx (should be %lx), ",		\
-				(long)x, (long)&(x));				\
-			WQ_BUG();						\
-		}								\
-	} while (0)
-#define CHECK_MAGIC_WQHEAD(x)							\
-	do {									\
-		if ((x)->__magic != (long)&((x)->__magic)) {			\
-			printk("bad magic %lx (should be %lx, creator %lx), ",	\
-			(x)->__magic, (long)&((x)->__magic), (x)->__creator);	\
-			WQ_BUG();						\
-		}								\
-	} while (0)
-#define WQ_CHECK_LIST_HEAD(list) 						\
-	do {									\
-		if (!(list)->next || !(list)->prev)				\
-			WQ_BUG();						\
-	} while(0)
-#define WQ_NOTE_WAKER(tsk)							\
-	do {									\
-		(tsk)->__waker = (long)__builtin_return_address(0);		\
-	} while (0)
-#else
-#define WQ_BUG()
-#define CHECK_MAGIC(x)
-#define CHECK_MAGIC_WQHEAD(x)
-#define WQ_CHECK_LIST_HEAD(list)
-#define WQ_NOTE_WAKER(tsk)
-#endif
-
-/*
  * Macros for declaration and initialisaton of the datatypes
  */
 
-#if WAITQUEUE_DEBUG
-# define __WAITQUEUE_DEBUG_INIT(name) (long)&(name).__magic, 0
-# define __WAITQUEUE_HEAD_DEBUG_INIT(name) (long)&(name).__magic, (long)&(name).__magic
-#else
-# define __WAITQUEUE_DEBUG_INIT(name)
-# define __WAITQUEUE_HEAD_DEBUG_INIT(name)
-#endif
-
 #define __WAITQUEUE_INITIALIZER(name, tsk) {				\
 	task:		tsk,						\
-	task_list:	{ NULL, NULL },					\
-			 __WAITQUEUE_DEBUG_INIT(name)}
+	task_list:	{ NULL, NULL } }
 
 #define DECLARE_WAITQUEUE(name, tsk)					\
 	wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk)
 
 #define __WAIT_QUEUE_HEAD_INITIALIZER(name) {				\
 	lock:		WAITQUEUE_RW_LOCK_UNLOCKED,			\
-	task_list:	{ &(name).task_list, &(name).task_list },	\
-			__WAITQUEUE_HEAD_DEBUG_INIT(name)}
+	task_list:	{ &(name).task_list, &(name).task_list } }
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
 	wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name)
 
 static inline void init_waitqueue_head(wait_queue_head_t *q)
 {
-#if WAITQUEUE_DEBUG
-	if (!q)
-		WQ_BUG();
-#endif
 	q->lock = WAITQUEUE_RW_LOCK_UNLOCKED;
 	INIT_LIST_HEAD(&q->task_list);
-#if WAITQUEUE_DEBUG
-	q->__magic = (long)&q->__magic;
-	q->__creator = (long)current_text_addr();
-#endif
 }
 
 static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
 {
-#if WAITQUEUE_DEBUG
-	if (!q || !p)
-		WQ_BUG();
-#endif
 	q->flags = 0;
 	q->task = p;
-#if WAITQUEUE_DEBUG
-	q->__magic = (long)&q->__magic;
-#endif
 }
 
 static inline int waitqueue_active(wait_queue_head_t *q)
 {
-#if WAITQUEUE_DEBUG
-	if (!q)
-		WQ_BUG();
-	CHECK_MAGIC_WQHEAD(q);
-#endif
-
 	return !list_empty(&q->task_list);
 }
 
 static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
 {
-#if WAITQUEUE_DEBUG
-	if (!head || !new)
-		WQ_BUG();
-	CHECK_MAGIC_WQHEAD(head);
-	CHECK_MAGIC(new->__magic);
-	if (!head->task_list.next || !head->task_list.prev)
-		WQ_BUG();
-#endif
 	list_add(&new->task_list, &head->task_list);
 }
 
@@ -209,25 +114,12 @@
 static inline void __add_wait_queue_tail(wait_queue_head_t *head,
 						wait_queue_t *new)
 {
-#if WAITQUEUE_DEBUG
-	if (!head || !new)
-		WQ_BUG();
-	CHECK_MAGIC_WQHEAD(head);
-	CHECK_MAGIC(new->__magic);
-	if (!head->task_list.next || !head->task_list.prev)
-		WQ_BUG();
-#endif
 	list_add_tail(&new->task_list, &head->task_list);
 }
 
 static inline void __remove_wait_queue(wait_queue_head_t *head,
 							wait_queue_t *old)
 {
-#if WAITQUEUE_DEBUG
-	if (!old)
-		WQ_BUG();
-	CHECK_MAGIC(old->__magic);
-#endif
 	list_del(&old->task_list);
 }
 
diff -urN linux-2.5.2-pre3/ipc/shm.c linux/ipc/shm.c
--- linux-2.5.2-pre3/ipc/shm.c	Sat Dec  8 20:31:51 2001
+++ linux/ipc/shm.c	Sun Dec 30 11:38:12 2001
@@ -17,6 +17,7 @@
 
 #include <linux/config.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/shm.h>
 #include <linux/init.h>
 #include <linux/file.h>
diff -urN linux-2.5.2-pre3/kernel/exit.c linux/kernel/exit.c
--- linux-2.5.2-pre3/kernel/exit.c	Sun Dec 30 11:38:08 2001
+++ linux/kernel/exit.c	Sun Dec 30 11:38:12 2001
@@ -5,6 +5,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.5.2-pre3/kernel/fork.c linux/kernel/fork.c
--- linux-2.5.2-pre3/kernel/fork.c	Sun Dec 30 11:38:08 2001
+++ linux/kernel/fork.c	Sun Dec 30 11:38:12 2001
@@ -589,8 +589,10 @@
 	*p = *current;
 
 	retval = -EAGAIN;
-	if (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur)
-		goto bad_fork_free;
+	if (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur) {
+		if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE))
+			goto bad_fork_free;
+	}
 
 	atomic_inc(&p->user->__count);
 	atomic_inc(&p->user->processes);
diff -urN linux-2.5.2-pre3/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.5.2-pre3/kernel/ksyms.c	Sun Dec 30 11:38:08 2001
+++ linux/kernel/ksyms.c	Sun Dec 30 11:38:12 2001
@@ -46,6 +46,7 @@
 #include <linux/tty.h>
 #include <linux/in6.h>
 #include <linux/completion.h>
+#include <linux/seq_file.h>
 #include <asm/checksum.h>
 
 #if defined(CONFIG_PROC_FS)
@@ -480,6 +481,12 @@
 EXPORT_SYMBOL(reparent_to_init);
 EXPORT_SYMBOL(daemonize);
 EXPORT_SYMBOL(csum_partial); /* for networking and md */
+EXPORT_SYMBOL(seq_escape);
+EXPORT_SYMBOL(seq_printf);
+EXPORT_SYMBOL(seq_open);
+EXPORT_SYMBOL(seq_release);
+EXPORT_SYMBOL(seq_read);
+EXPORT_SYMBOL(seq_lseek);
 
 /* Program loader interfaces */
 EXPORT_SYMBOL(setup_arg_pages);
diff -urN linux-2.5.2-pre3/kernel/pm.c linux/kernel/pm.c
--- linux-2.5.2-pre3/kernel/pm.c	Fri Apr  6 10:51:19 2001
+++ linux/kernel/pm.c	Sun Dec 30 11:38:12 2001
@@ -20,6 +20,7 @@
 
 #include <linux/module.h>
 #include <linux/spinlock.h>
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/pm.h>
 #include <linux/interrupt.h>
diff -urN linux-2.5.2-pre3/kernel/ptrace.c linux/kernel/ptrace.c
--- linux-2.5.2-pre3/kernel/ptrace.c	Wed Nov 21 14:43:01 2001
+++ linux/kernel/ptrace.c	Sun Dec 30 11:38:12 2001
@@ -121,119 +121,17 @@
 }
 
 /*
- * Access another process' address space, one page at a time.
+ * Access another process' address space.
+ * Source/target buffer must be kernel space, 
+ * Do not walk the page table directly, use get_user_pages
  */
-static int access_one_page(struct mm_struct * mm, struct vm_area_struct * vma, unsigned long addr, void *buf, int len, int write)
-{
-	pgd_t * pgdir;
-	pmd_t * pgmiddle;
-	pte_t * pgtable;
-	char *maddr; 
-	struct page *page;
-
-repeat:
-	spin_lock(&mm->page_table_lock);
-	pgdir = pgd_offset(vma->vm_mm, addr);
-	if (pgd_none(*pgdir))
-		goto fault_in_page;
-	if (pgd_bad(*pgdir))
-		goto bad_pgd;
-	pgmiddle = pmd_offset(pgdir, addr);
-	if (pmd_none(*pgmiddle))
-		goto fault_in_page;
-	if (pmd_bad(*pgmiddle))
-		goto bad_pmd;
-	pgtable = pte_offset(pgmiddle, addr);
-	if (!pte_present(*pgtable))
-		goto fault_in_page;
-	if (write && (!pte_write(*pgtable) || !pte_dirty(*pgtable)))
-		goto fault_in_page;
-	page = pte_page(*pgtable);
-
-	/* ZERO_PAGE is special: reads from it are ok even though it's marked reserved */
-	if (page != ZERO_PAGE(addr) || write) {
-		if ((!VALID_PAGE(page)) || PageReserved(page)) {
-			spin_unlock(&mm->page_table_lock);
-			return 0;
-		}
-	}
-	get_page(page);
-	spin_unlock(&mm->page_table_lock);
-	flush_cache_page(vma, addr);
-
-	if (write) {
-		maddr = kmap(page);
-		memcpy(maddr + (addr & ~PAGE_MASK), buf, len);
-		flush_page_to_ram(page);
-		flush_icache_page(vma, page);
-		kunmap(page);
-	} else {
-		maddr = kmap(page);
-		memcpy(buf, maddr + (addr & ~PAGE_MASK), len);
-		flush_page_to_ram(page);
-		kunmap(page);
-	}
-	put_page(page);
-	return len;
-
-fault_in_page:
-	spin_unlock(&mm->page_table_lock);
-	/* -1: out of memory. 0 - unmapped page */
-	if (handle_mm_fault(mm, vma, addr, write) > 0)
-		goto repeat;
-	return 0;
-
-bad_pgd:
-	spin_unlock(&mm->page_table_lock);
-	pgd_ERROR(*pgdir);
-	return 0;
-
-bad_pmd:
-	spin_unlock(&mm->page_table_lock);
-	pmd_ERROR(*pgmiddle);
-	return 0;
-}
-
-static int access_mm(struct mm_struct *mm, struct vm_area_struct * vma, unsigned long addr, void *buf, int len, int write)
-{
-	int copied = 0;
-
-	for (;;) {
-		unsigned long offset = addr & ~PAGE_MASK;
-		int this_len = PAGE_SIZE - offset;
-		int retval;
-
-		if (this_len > len)
-			this_len = len;
-		retval = access_one_page(mm, vma, addr, buf, this_len, write);
-		copied += retval;
-		if (retval != this_len)
-			break;
-
-		len -= retval;
-		if (!len)
-			break;
-
-		addr += retval;
-		buf += retval;
-
-		if (addr < vma->vm_end)
-			continue;	
-		if (!vma->vm_next)
-			break;
-		if (vma->vm_next->vm_start != vma->vm_end)
-			break;
-	
-		vma = vma->vm_next;
-	}
-	return copied;
-}
 
 int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write)
 {
-	int copied;
 	struct mm_struct *mm;
-	struct vm_area_struct * vma;
+	struct vm_area_struct *vma;
+	struct page *page;
+	void *old_buf = buf;
 
 	/* Worry about races with exit() */
 	task_lock(tsk);
@@ -245,14 +143,41 @@
 		return 0;
 
 	down_read(&mm->mmap_sem);
-	vma = find_extend_vma(mm, addr);
-	copied = 0;
-	if (vma)
-		copied = access_mm(mm, vma, addr, buf, len, write);
+	/* ignore errors, just check how much was sucessfully transfered */
+	while (len) {
+		int bytes, ret, offset;
+		void *maddr;
+
+		ret = get_user_pages(current, mm, addr, 1,
+				write, 1, &page, &vma);
+		if (ret <= 0)
+			break;
+
+		bytes = len;
+		offset = addr & (PAGE_SIZE-1);
+		if (bytes > PAGE_SIZE-offset)
+			bytes = PAGE_SIZE-offset;
 
+		flush_cache_page(vma, addr);
+
+		maddr = kmap(page);
+		if (write) {
+			memcpy(maddr + offset, buf, bytes);
+			flush_page_to_ram(page);
+			flush_icache_page(vma, page);
+		} else {
+			memcpy(buf, maddr + offset, bytes);
+			flush_page_to_ram(page);
+		}
+		kunmap(page);
+		put_page(page);
+		len -= bytes;
+		buf += bytes;
+	}
 	up_read(&mm->mmap_sem);
 	mmput(mm);
-	return copied;
+	
+	return buf - old_buf;
 }
 
 int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len)
diff -urN linux-2.5.2-pre3/kernel/sched.c linux/kernel/sched.c
--- linux-2.5.2-pre3/kernel/sched.c	Sun Dec 30 11:38:08 2001
+++ linux/kernel/sched.c	Sun Dec 30 11:38:12 2001
@@ -68,7 +68,7 @@
 #define TICK_SCALE(x)	((x) << 2)
 #endif
 
-#define NICE_TO_TICKS(nice)	(TICK_SCALE(20-(nice))+1)
+#define TASK_TIMESLICE(p)	(TICK_SCALE(20-(p)->nice)+1)
 
 
 /*
@@ -94,7 +94,7 @@
 
 static LIST_HEAD(runqueue_head);
 
-static unsigned long rcl_curr = 0;
+static unsigned long rcl_curr;
 
 /*
  * We align per-CPU scheduling data on cacheline boundaries,
@@ -314,7 +314,8 @@
 {
 	p->dyn_prio += rcl_curr - p->rcl_last;
 	p->rcl_last = rcl_curr;
-	if (p->dyn_prio > MAX_DYNPRIO) p->dyn_prio = MAX_DYNPRIO;
+	if (p->dyn_prio > MAX_DYNPRIO)
+		p->dyn_prio = MAX_DYNPRIO;
 	list_add(&p->run_list, &runqueue_head);
 	nr_running++;
 }
@@ -367,9 +368,7 @@
 
 static void process_timeout(unsigned long __data)
 {
-	struct task_struct * p = (struct task_struct *) __data;
-
-	wake_up_process(p);
+	wake_up_process((struct task_struct *)__data);
 }
 
 /**
@@ -529,20 +528,21 @@
 
 void expire_task(struct task_struct *p)
 {
-	if (!p->time_slice)
+	if (unlikely(!p->time_slice))
+		goto need_resched;
+
+	if (!--p->time_slice) {
+		if (p->dyn_prio > 0) {
+			p->time_slice--;
+			p->dyn_prio--;
+		}
 		p->need_resched = 1;
-	else {
-		if (!--p->time_slice) {
-			if (p->dyn_prio > 0) {
-				--p->time_slice;
-				--p->dyn_prio;
-			}
-			p->need_resched = 1;
-		} else if (p->time_slice < -NICE_TO_TICKS(p->nice)) {
+	} else
+		if (p->time_slice < -TASK_TIMESLICE(p)) {
 			p->time_slice = 0;
+need_resched:
 			p->need_resched = 1;
 		}
-	}
 }
 
 /*
@@ -588,7 +588,7 @@
 	/* move an exhausted RR process to be last.. */
 	if (unlikely(prev->policy == SCHED_RR))
 		if (!prev->time_slice) {
-			prev->time_slice = NICE_TO_TICKS(prev->nice);
+			prev->time_slice = TASK_TIMESLICE(prev);
 			move_last_runqueue(prev);
 		}
 
@@ -625,10 +625,10 @@
 
 	/* Do we need to re-calculate counters? */
 	if (unlikely(!c)) {
-		++rcl_curr;
+		rcl_curr++;
 		list_for_each(tmp, &runqueue_head) {
 			p = list_entry(tmp, struct task_struct, run_list);
-			p->time_slice = NICE_TO_TICKS(p->nice);
+			p->time_slice = TASK_TIMESLICE(p);
 			p->rcl_last = rcl_curr;
 		}
 		goto repeat_schedule;
@@ -726,21 +726,17 @@
 	struct list_head *tmp;
 	struct task_struct *p;
 
-	CHECK_MAGIC_WQHEAD(q);
-	WQ_CHECK_LIST_HEAD(&q->task_list);
-	
 	list_for_each(tmp,&q->task_list) {
 		unsigned int state;
-                wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list);
+		wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list);
 
-		CHECK_MAGIC(curr->__magic);
 		p = curr->task;
 		state = p->state;
-		if (state & mode) {
-			WQ_NOTE_WAKER(curr);
-			if (try_to_wake_up(p, sync) && (curr->flags&WQ_FLAG_EXCLUSIVE) && !--nr_exclusive)
-				break;
-		}
+		if ((state & mode) &&
+				try_to_wake_up(p, sync) &&
+				((curr->flags & WQ_FLAG_EXCLUSIVE) &&
+					!--nr_exclusive))
+			break;
 	}
 }
 
@@ -898,11 +894,7 @@
 
 static inline struct task_struct *find_process_by_pid(pid_t pid)
 {
-	struct task_struct *tsk = current;
-
-	if (pid)
-		tsk = find_task_by_pid(pid);
-	return tsk;
+	return pid ? find_task_by_pid(pid) : current;
 }
 
 static int setscheduler(pid_t pid, int policy, 
@@ -1063,17 +1055,16 @@
 	nr_pending--;
 #endif
 	if (nr_pending) {
-		struct task_struct *ctsk = current;
 		/*
 		 * This process can only be rescheduled by us,
 		 * so this is safe without any locking.
 		 */
-		if (ctsk->policy == SCHED_OTHER)
-			ctsk->policy |= SCHED_YIELD;
-		ctsk->need_resched = 1;
+		if (current->policy == SCHED_OTHER)
+			current->policy |= SCHED_YIELD;
+		current->need_resched = 1;
 
-		ctsk->time_slice = 0;
-		++ctsk->dyn_prio;
+		current->time_slice = 0;
+		current->dyn_prio++;
 	}
 	return 0;
 }
@@ -1122,7 +1113,7 @@
 	read_lock(&tasklist_lock);
 	p = find_process_by_pid(pid);
 	if (p)
-		jiffies_to_timespec(p->policy & SCHED_FIFO ? 0 : NICE_TO_TICKS(p->nice),
+		jiffies_to_timespec(p->policy & SCHED_FIFO ? 0 : TASK_TIMESLICE(p),
 				    &t);
 	read_unlock(&tasklist_lock);
 	if (p)
@@ -1238,35 +1229,33 @@
  */
 void reparent_to_init(void)
 {
-	struct task_struct *this_task = current;
-
 	write_lock_irq(&tasklist_lock);
 
 	/* Reparent to init */
-	REMOVE_LINKS(this_task);
-	this_task->p_pptr = child_reaper;
-	this_task->p_opptr = child_reaper;
-	SET_LINKS(this_task);
+	REMOVE_LINKS(current);
+	current->p_pptr = child_reaper;
+	current->p_opptr = child_reaper;
+	SET_LINKS(current);
 
 	/* Set the exit signal to SIGCHLD so we signal init on exit */
-	this_task->exit_signal = SIGCHLD;
+	current->exit_signal = SIGCHLD;
 
 	/* We also take the runqueue_lock while altering task fields
 	 * which affect scheduling decisions */
 	spin_lock(&runqueue_lock);
 
-	this_task->ptrace = 0;
-	this_task->nice = DEF_NICE;
-	this_task->policy = SCHED_OTHER;
+	current->ptrace = 0;
+	current->nice = DEF_NICE;
+	current->policy = SCHED_OTHER;
 	/* cpus_allowed? */
 	/* rt_priority? */
 	/* signals? */
-	this_task->cap_effective = CAP_INIT_EFF_SET;
-	this_task->cap_inheritable = CAP_INIT_INH_SET;
-	this_task->cap_permitted = CAP_FULL_SET;
-	this_task->keep_capabilities = 0;
-	memcpy(this_task->rlim, init_task.rlim, sizeof(*(this_task->rlim)));
-	this_task->user = INIT_USER;
+	current->cap_effective = CAP_INIT_EFF_SET;
+	current->cap_inheritable = CAP_INIT_INH_SET;
+	current->cap_permitted = CAP_FULL_SET;
+	current->keep_capabilities = 0;
+	memcpy(current->rlim, init_task.rlim, sizeof(*(current->rlim)));
+	current->user = INIT_USER;
 
 	spin_unlock(&runqueue_lock);
 	write_unlock_irq(&tasklist_lock);
diff -urN linux-2.5.2-pre3/kernel/sysctl.c linux/kernel/sysctl.c
--- linux-2.5.2-pre3/kernel/sysctl.c	Mon Dec 10 10:39:20 2001
+++ linux/kernel/sysctl.c	Sun Dec 30 11:38:12 2001
@@ -19,6 +19,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/swapctl.h>
diff -urN linux-2.5.2-pre3/mm/highmem.c linux/mm/highmem.c
--- linux-2.5.2-pre3/mm/highmem.c	Sun Dec 30 11:38:08 2001
+++ linux/mm/highmem.c	Sun Dec 30 11:38:12 2001
@@ -46,7 +46,7 @@
 #ifdef CONFIG_HIGHMEM
 static int pkmap_count[LAST_PKMAP];
 static unsigned int last_pkmap_nr;
-static spinlock_t kmap_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t kmap_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 
 pte_t * pkmap_page_table;
 
diff -urN linux-2.5.2-pre3/mm/memory.c linux/mm/memory.c
--- linux-2.5.2-pre3/mm/memory.c	Wed Dec 12 09:14:21 2001
+++ linux/mm/memory.c	Sun Dec 30 11:38:12 2001
@@ -397,17 +397,16 @@
 	spin_unlock(&mm->page_table_lock);
 }
 
-
 /*
  * Do a quick page-table lookup for a single page. 
  */
-static struct page * follow_page(unsigned long address, int write) 
+static struct page * follow_page(struct mm_struct *mm, unsigned long address, int write) 
 {
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *ptep, pte;
 
-	pgd = pgd_offset(current->mm, address);
+	pgd = pgd_offset(mm, address);
 	if (pgd_none(*pgd) || pgd_bad(*pgd))
 		goto out;
 
@@ -443,21 +442,74 @@
 	return page;
 }
 
+int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
+		int len, int write, int force, struct page **pages, struct vm_area_struct **vmas)
+{
+	int i = 0;
+
+	do {
+		struct vm_area_struct *	vma;
+
+		vma = find_extend_vma(mm, start);
+
+		if ( !vma ||
+		    (!force &&
+		     	((write && (!(vma->vm_flags & VM_WRITE))) ||
+		    	 (!write && (!(vma->vm_flags & VM_READ))) ) )) {
+			if (i) return i;
+			return -EFAULT;
+		}
+
+		spin_lock(&mm->page_table_lock);
+		do {
+			struct page *map;
+			while (!(map = follow_page(mm, start, write))) {
+				spin_unlock(&mm->page_table_lock);
+				switch (handle_mm_fault(mm, vma, start, write)) {
+				case 1:
+					tsk->min_flt++;
+					break;
+				case 2:
+					tsk->maj_flt++;
+					break;
+				case 0:
+					if (i) return i;
+					return -EFAULT;
+				default:
+					if (i) return i;
+					return -ENOMEM;
+				}
+				spin_lock(&mm->page_table_lock);
+			}
+			if (pages) {
+				pages[i] = get_page_map(map);
+				/* FIXME: call the correct function,
+				 * depending on the type of the found page
+				 */
+				if (pages[i])
+					page_cache_get(pages[i]);
+			}
+			if (vmas)
+				vmas[i] = vma;
+			i++;
+			start += PAGE_SIZE;
+			len--;
+		} while(len && start < vma->vm_end);
+		spin_unlock(&mm->page_table_lock);
+	} while(len);
+	return i;
+}
+
 /*
  * Force in an entire range of pages from the current process's user VA,
  * and pin them in physical memory.  
  */
-
 #define dprintk(x...)
+
 int map_user_kiobuf(int rw, struct kiobuf *iobuf, unsigned long va, size_t len)
 {
-	unsigned long		ptr, end;
-	int			err;
+	int pgcount, err;
 	struct mm_struct *	mm;
-	struct vm_area_struct *	vma = 0;
-	struct page *		map;
-	int			i;
-	int			datain = (rw == READ);
 	
 	/* Make sure the iobuf is not already mapped somewhere. */
 	if (iobuf->nr_pages)
@@ -466,79 +518,37 @@
 	mm = current->mm;
 	dprintk ("map_user_kiobuf: begin\n");
 	
-	ptr = va & PAGE_MASK;
-	end = (va + len + PAGE_SIZE - 1) & PAGE_MASK;
-	err = expand_kiobuf(iobuf, (end - ptr) >> PAGE_SHIFT);
+	pgcount = (va + len + PAGE_SIZE - 1)/PAGE_SIZE - va/PAGE_SIZE;
+	/* mapping 0 bytes is not permitted */
+	if (!pgcount) BUG();
+	err = expand_kiobuf(iobuf, pgcount);
 	if (err)
 		return err;
 
-	down_read(&mm->mmap_sem);
-
-	err = -EFAULT;
 	iobuf->locked = 0;
-	iobuf->offset = va & ~PAGE_MASK;
+	iobuf->offset = va & (PAGE_SIZE-1);
 	iobuf->length = len;
 	
-	i = 0;
-	
-	/* 
-	 * First of all, try to fault in all of the necessary pages
-	 */
-	while (ptr < end) {
-		if (!vma || ptr >= vma->vm_end) {
-			vma = find_vma(current->mm, ptr);
-			if (!vma) 
-				goto out_unlock;
-			if (vma->vm_start > ptr) {
-				if (!(vma->vm_flags & VM_GROWSDOWN))
-					goto out_unlock;
-				if (expand_stack(vma, ptr))
-					goto out_unlock;
-			}
-			if (((datain) && (!(vma->vm_flags & VM_WRITE))) ||
-					(!(vma->vm_flags & VM_READ))) {
-				err = -EACCES;
-				goto out_unlock;
-			}
-		}
-		spin_lock(&mm->page_table_lock);
-		while (!(map = follow_page(ptr, datain))) {
-			int ret;
-
-			spin_unlock(&mm->page_table_lock);
-			ret = handle_mm_fault(current->mm, vma, ptr, datain);
-			if (ret <= 0) {
-				if (!ret)
-					goto out_unlock;
-				else {
-					err = -ENOMEM;
-					goto out_unlock;
-				}
-			}
-			spin_lock(&mm->page_table_lock);
-		}			
-		map = get_page_map(map);
-		if (map) {
-			flush_dcache_page(map);
-			page_cache_get(map);
-		} else
-			printk (KERN_INFO "Mapped page missing [%d]\n", i);
-		spin_unlock(&mm->page_table_lock);
-		iobuf->maplist[i] = map;
-		iobuf->nr_pages = ++i;
-		
-		ptr += PAGE_SIZE;
-	}
-
+	/* Try to fault in all of the necessary pages */
+	down_read(&mm->mmap_sem);
+	/* rw==READ means read from disk, write into memory area */
+	err = get_user_pages(current, mm, va, pgcount,
+			(rw==READ), 0, iobuf->maplist, NULL);
 	up_read(&mm->mmap_sem);
+	if (err < 0) {
+		unmap_kiobuf(iobuf);
+		dprintk ("map_user_kiobuf: end %d\n", err);
+		return err;
+	}
+	iobuf->nr_pages = err;
+	while (pgcount--) {
+		/* FIXME: flush superflous for rw==READ,
+		 * probably wrong function for rw==WRITE
+		 */
+		flush_dcache_page(iobuf->maplist[pgcount]);
+	}
 	dprintk ("map_user_kiobuf: end OK\n");
 	return 0;
-
- out_unlock:
-	up_read(&mm->mmap_sem);
-	unmap_kiobuf(iobuf);
-	dprintk ("map_user_kiobuf: end %d\n", err);
-	return err;
 }
 
 /*
@@ -588,6 +598,9 @@
 		if (map) {
 			if (iobuf->locked)
 				UnlockPage(map);
+			/* FIXME: cache flush missing for rw==READ
+			 * FIXME: call the correct reference counting function
+			 */
 			page_cache_release(map);
 		}
 	}
@@ -1414,23 +1427,19 @@
 	return pte_offset(pmd, address);
 }
 
-/*
- * Simplistic page force-in..
- */
 int make_pages_present(unsigned long addr, unsigned long end)
 {
-	int write;
-	struct mm_struct *mm = current->mm;
+	int ret, len, write;
 	struct vm_area_struct * vma;
 
-	vma = find_vma(mm, addr);
+	vma = find_vma(current->mm, addr);
 	write = (vma->vm_flags & VM_WRITE) != 0;
 	if (addr >= end)
 		BUG();
-	do {
-		if (handle_mm_fault(mm, vma, addr, write) < 0)
-			return -1;
-		addr += PAGE_SIZE;
-	} while (addr < end);
-	return 0;
+	if (end > vma->vm_end)
+		BUG();
+	len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
+	ret = get_user_pages(current, current->mm, addr,
+			len, write, 0, NULL, NULL);
+	return ret == len ? 0 : -1;
 }
diff -urN linux-2.5.2-pre3/mm/mempool.c linux/mm/mempool.c
--- linux-2.5.2-pre3/mm/mempool.c	Sun Dec 16 12:25:28 2001
+++ linux/mm/mempool.c	Sun Dec 30 11:38:12 2001
@@ -8,6 +8,7 @@
  *  started by Ingo Molnar, Copyright (C) 2001
  */
 
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/mempool.h>
diff -urN linux-2.5.2-pre3/mm/mprotect.c linux/mm/mprotect.c
--- linux-2.5.2-pre3/mm/mprotect.c	Mon Sep 17 15:30:23 2001
+++ linux/mm/mprotect.c	Sun Dec 30 11:38:12 2001
@@ -3,6 +3,7 @@
  *
  *  (C) Copyright 1994 Linus Torvalds
  */
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/shm.h>
diff -urN linux-2.5.2-pre3/mm/mremap.c linux/mm/mremap.c
--- linux-2.5.2-pre3/mm/mremap.c	Thu Sep 20 20:31:26 2001
+++ linux/mm/mremap.c	Sun Dec 30 11:38:12 2001
@@ -4,6 +4,7 @@
  *	(C) Copyright 1996 Linus Torvalds
  */
 
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/shm.h>
diff -urN linux-2.5.2-pre3/mm/slab.c linux/mm/slab.c
--- linux-2.5.2-pre3/mm/slab.c	Tue Nov 27 09:31:22 2001
+++ linux/mm/slab.c	Sun Dec 30 11:38:12 2001
@@ -70,6 +70,8 @@
 
 #include	<linux/config.h>
 #include	<linux/slab.h>
+#include	<linux/mm.h>
+#include	<linux/cache.h>
 #include	<linux/interrupt.h>
 #include	<linux/init.h>
 #include	<linux/compiler.h>
diff -urN linux-2.5.2-pre3/mm/swapfile.c linux/mm/swapfile.c
--- linux-2.5.2-pre3/mm/swapfile.c	Sun Dec 30 11:38:08 2001
+++ linux/mm/swapfile.c	Sun Dec 30 11:38:12 2001
@@ -5,6 +5,7 @@
  *  Swap reorganised 29.12.95, Stephen Tweedie
  */
 
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
diff -urN linux-2.5.2-pre3/mm/vmscan.c linux/mm/vmscan.c
--- linux-2.5.2-pre3/mm/vmscan.c	Sat Nov 17 19:18:17 2001
+++ linux/mm/vmscan.c	Sun Dec 30 11:38:12 2001
@@ -11,6 +11,7 @@
  *  Multiqueue VM started 5.8.00, Rik van Riel.
  */
 
+#include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/kernel_stat.h>
 #include <linux/swap.h>
diff -urN linux-2.5.2-pre3/net/802/fddi.c linux/net/802/fddi.c
--- linux-2.5.2-pre3/net/802/fddi.c	Tue Nov 28 21:53:45 2000
+++ linux/net/802/fddi.c	Sun Dec 30 11:38:12 2001
@@ -27,7 +27,6 @@
  */
  
 #include <linux/config.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
diff -urN linux-2.5.2-pre3/net/802/hippi.c linux/net/802/hippi.c
--- linux-2.5.2-pre3/net/802/hippi.c	Wed Jun 20 21:00:55 2001
+++ linux/net/802/hippi.c	Sun Dec 30 11:38:12 2001
@@ -36,7 +36,6 @@
 #include <net/sock.h>
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 
 /*
diff -urN linux-2.5.2-pre3/net/8021q/vlanproc.c linux/net/8021q/vlanproc.c
--- linux-2.5.2-pre3/net/8021q/vlanproc.c	Tue Nov 13 09:19:41 2001
+++ linux/net/8021q/vlanproc.c	Sun Dec 30 11:38:12 2001
@@ -25,7 +25,6 @@
 #include <linux/mm.h>		/* verify_area(), etc. */
 #include <linux/string.h>	/* inline mem*, str* functions */
 #include <linux/init.h>		/* __initfunc et al. */
-#include <asm/segment.h>	/* kernel <-> user copy */
 #include <asm/byteorder.h>	/* htons(), etc. */
 #include <asm/uaccess.h>	/* copy_to_user */
 #include <asm/io.h>
diff -urN linux-2.5.2-pre3/net/atm/resources.c linux/net/atm/resources.c
--- linux-2.5.2-pre3/net/atm/resources.c	Fri Nov  9 14:11:15 2001
+++ linux/net/atm/resources.c	Sun Dec 30 11:38:12 2001
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/bitops.h>
 #include <net/sock.h>	 /* for struct sock */
-#include <asm/segment.h> /* for get_fs_long and put_fs_long */
 
 #include "common.h"
 #include "resources.h"
diff -urN linux-2.5.2-pre3/net/decnet/af_decnet.c linux/net/decnet/af_decnet.c
--- linux-2.5.2-pre3/net/decnet/af_decnet.c	Fri Nov  9 14:12:54 2001
+++ linux/net/decnet/af_decnet.c	Sun Dec 30 11:38:12 2001
@@ -112,7 +112,6 @@
 #include <linux/route.h>
 #include <linux/netfilter.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/ioctls.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/decnet/dn_nsp_in.c linux/net/decnet/dn_nsp_in.c
--- linux-2.5.2-pre3/net/decnet/dn_nsp_in.c	Fri Nov  9 14:12:54 2001
+++ linux/net/decnet/dn_nsp_in.c	Sun Dec 30 11:38:12 2001
@@ -59,7 +59,6 @@
 #include <linux/inet.h>
 #include <linux/route.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/decnet/dn_nsp_out.c linux/net/decnet/dn_nsp_out.c
--- linux-2.5.2-pre3/net/decnet/dn_nsp_out.c	Mon Jan 22 13:32:10 2001
+++ linux/net/decnet/dn_nsp_out.c	Sun Dec 30 11:38:12 2001
@@ -51,7 +51,6 @@
 #include <linux/inet.h>
 #include <linux/route.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/irda/ircomm/ircomm_tty.c linux/net/irda/ircomm/ircomm_tty.c
--- linux-2.5.2-pre3/net/irda/ircomm/ircomm_tty.c	Sun Sep 30 12:26:09 2001
+++ linux/net/irda/ircomm/ircomm_tty.c	Sun Dec 30 11:38:12 2001
@@ -38,7 +38,6 @@
 #include <linux/tty.h>
 #include <linux/interrupt.h>
 
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 #include <net/irda/irda.h>
diff -urN linux-2.5.2-pre3/net/irda/ircomm/ircomm_tty_ioctl.c linux/net/irda/ircomm/ircomm_tty_ioctl.c
--- linux-2.5.2-pre3/net/irda/ircomm/ircomm_tty_ioctl.c	Wed Jul  4 11:50:38 2001
+++ linux/net/irda/ircomm/ircomm_tty_ioctl.c	Sun Dec 30 11:38:12 2001
@@ -35,7 +35,6 @@
 #include <linux/tty.h>
 #include <linux/serial.h>
 
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 
 #include <net/irda/irda.h>
diff -urN linux-2.5.2-pre3/net/irda/irda_device.c linux/net/irda/irda_device.c
--- linux-2.5.2-pre3/net/irda/irda_device.c	Mon Nov 12 11:29:57 2001
+++ linux/net/irda/irda_device.c	Sun Dec 30 11:38:12 2001
@@ -44,7 +44,6 @@
 #include <linux/spinlock.h>
 
 #include <asm/ioctls.h>
-#include <asm/segment.h>
 #include <asm/uaccess.h>
 #include <asm/dma.h>
 #include <asm/io.h>
diff -urN linux-2.5.2-pre3/net/irda/irsyms.c linux/net/irda/irsyms.c
--- linux-2.5.2-pre3/net/irda/irsyms.c	Fri Nov  9 14:22:17 2001
+++ linux/net/irda/irsyms.c	Sun Dec 30 11:38:12 2001
@@ -31,7 +31,6 @@
 #include <linux/proc_fs.h>
 #include <linux/smp_lock.h>
 
-#include <asm/segment.h>
 
 #include <net/irda/irda.h>
 #include <net/irda/irmod.h>
diff -urN linux-2.5.2-pre3/net/irda/irsysctl.c linux/net/irda/irsysctl.c
--- linux-2.5.2-pre3/net/irda/irsysctl.c	Fri Nov 30 13:25:10 2001
+++ linux/net/irda/irsysctl.c	Sun Dec 30 11:38:12 2001
@@ -27,7 +27,6 @@
 #include <linux/mm.h>
 #include <linux/ctype.h>
 #include <linux/sysctl.h>
-#include <asm/segment.h>
 
 #include <net/irda/irda.h>
 #include <net/irda/irias_object.h>
diff -urN linux-2.5.2-pre3/net/rose/af_rose.c linux/net/rose/af_rose.c
--- linux-2.5.2-pre3/net/rose/af_rose.c	Mon Sep 10 07:58:35 2001
+++ linux/net/rose/af_rose.c	Sun Dec 30 11:38:12 2001
@@ -44,7 +44,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_dev.c linux/net/rose/rose_dev.c
--- linux-2.5.2-pre3/net/rose/rose_dev.c	Wed Jun 27 17:10:55 2001
+++ linux/net/rose/rose_dev.c	Sun Dec 30 11:38:12 2001
@@ -32,7 +32,6 @@
 #include <linux/if_ether.h>	/* For the statistics structure. */
 
 #include <asm/system.h>
-#include <asm/segment.h>
 #include <asm/io.h>
 
 #include <linux/inet.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_in.c linux/net/rose/rose_in.c
--- linux-2.5.2-pre3/net/rose/rose_in.c	Fri Dec 29 14:44:46 2000
+++ linux/net/rose/rose_in.c	Sun Dec 30 11:38:12 2001
@@ -38,7 +38,6 @@
 #include <linux/skbuff.h>
 #include <net/sock.h>
 #include <net/ip.h>			/* For ip_rcv */
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_link.c linux/net/rose/rose_link.c
--- linux-2.5.2-pre3/net/rose/rose_link.c	Fri Dec 29 14:44:46 2000
+++ linux/net/rose/rose_link.c	Sun Dec 30 11:38:12 2001
@@ -29,7 +29,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_out.c linux/net/rose/rose_out.c
--- linux-2.5.2-pre3/net/rose/rose_out.c	Fri Dec 29 14:44:46 2000
+++ linux/net/rose/rose_out.c	Sun Dec 30 11:38:12 2001
@@ -30,7 +30,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_route.c linux/net/rose/rose_route.c
--- linux-2.5.2-pre3/net/rose/rose_route.c	Fri Jun 29 19:38:26 2001
+++ linux/net/rose/rose_route.c	Sun Dec 30 11:38:12 2001
@@ -36,7 +36,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_subr.c linux/net/rose/rose_subr.c
--- linux-2.5.2-pre3/net/rose/rose_subr.c	Fri Jun 29 19:38:26 2001
+++ linux/net/rose/rose_subr.c	Sun Dec 30 11:38:12 2001
@@ -30,7 +30,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/rose/rose_timer.c linux/net/rose/rose_timer.c
--- linux-2.5.2-pre3/net/rose/rose_timer.c	Fri Dec 29 14:44:46 2000
+++ linux/net/rose/rose_timer.c	Sun Dec 30 11:38:12 2001
@@ -30,7 +30,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/sunrpc/auth_null.c linux/net/sunrpc/auth_null.c
--- linux-2.5.2-pre3/net/sunrpc/auth_null.c	Thu Aug 16 09:39:37 2001
+++ linux/net/sunrpc/auth_null.c	Sun Dec 30 11:38:12 2001
@@ -7,11 +7,11 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/utsname.h>
 #include <linux/sunrpc/clnt.h>
+#include <linux/sched.h>
 
 #ifdef RPC_DEBUG
 # define RPCDBG_FACILITY	RPCDBG_AUTH
diff -urN linux-2.5.2-pre3/net/sunrpc/auth_unix.c linux/net/sunrpc/auth_unix.c
--- linux-2.5.2-pre3/net/sunrpc/auth_unix.c	Thu Aug 16 09:39:37 2001
+++ linux/net/sunrpc/auth_unix.c	Sun Dec 30 11:38:12 2001
@@ -7,7 +7,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/slab.h>
+#include <linux/sched.h>
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/sunrpc/clnt.h>
diff -urN linux-2.5.2-pre3/net/wanrouter/wanmain.c linux/net/wanrouter/wanmain.c
--- linux-2.5.2-pre3/net/wanrouter/wanmain.c	Wed Aug 15 01:22:18 2001
+++ linux/net/wanrouter/wanmain.c	Sun Dec 30 11:38:12 2001
@@ -75,7 +75,6 @@
  #include <../drivers/net/syncppp.h>
 
 #else
- #include <asm/segment.h>	/* kernel <-> user copy */
 #endif
 
 #define KMEM_SAFETYZONE 8
diff -urN linux-2.5.2-pre3/net/wanrouter/wanproc.c linux/net/wanrouter/wanproc.c
--- linux-2.5.2-pre3/net/wanrouter/wanproc.c	Mon Sep 10 07:58:35 2001
+++ linux/net/wanrouter/wanproc.c	Sun Dec 30 11:38:12 2001
@@ -40,7 +40,6 @@
  #define PROC_STATS_FORMAT "%30s: %12lu\n"
 #else
  #define PROC_STATS_FORMAT "%30s: %12u\n"
- #include <asm/segment.h>	/* kernel <-> user copy */
 #endif
 
 
diff -urN linux-2.5.2-pre3/net/x25/af_x25.c linux/net/x25/af_x25.c
--- linux-2.5.2-pre3/net/x25/af_x25.c	Mon Sep 10 07:58:35 2001
+++ linux/net/x25/af_x25.c	Sun Dec 30 11:38:12 2001
@@ -46,7 +46,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_dev.c linux/net/x25/x25_dev.c
--- linux-2.5.2-pre3/net/x25/x25_dev.c	Mon Jan 22 13:32:10 2001
+++ linux/net/x25/x25_dev.c	Sun Dec 30 11:38:12 2001
@@ -33,7 +33,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_facilities.c linux/net/x25/x25_facilities.c
--- linux-2.5.2-pre3/net/x25/x25_facilities.c	Wed Jan 24 15:28:36 2001
+++ linux/net/x25/x25_facilities.c	Sun Dec 30 11:38:12 2001
@@ -32,7 +32,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_in.c linux/net/x25/x25_in.c
--- linux-2.5.2-pre3/net/x25/x25_in.c	Wed Jan 24 15:28:36 2001
+++ linux/net/x25/x25_in.c	Sun Dec 30 11:38:12 2001
@@ -37,7 +37,6 @@
 #include <linux/skbuff.h>
 #include <net/sock.h>
 #include <net/ip.h>			/* For ip_rcv */
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_link.c linux/net/x25/x25_link.c
--- linux-2.5.2-pre3/net/x25/x25_link.c	Fri Jun 29 19:38:26 2001
+++ linux/net/x25/x25_link.c	Sun Dec 30 11:38:12 2001
@@ -34,7 +34,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_out.c linux/net/x25/x25_out.c
--- linux-2.5.2-pre3/net/x25/x25_out.c	Thu Apr 12 12:11:39 2001
+++ linux/net/x25/x25_out.c	Sun Dec 30 11:38:12 2001
@@ -35,7 +35,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_route.c linux/net/x25/x25_route.c
--- linux-2.5.2-pre3/net/x25/x25_route.c	Mon Jan 22 13:32:10 2001
+++ linux/net/x25/x25_route.c	Sun Dec 30 11:38:12 2001
@@ -33,7 +33,6 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/fcntl.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_subr.c linux/net/x25/x25_subr.c
--- linux-2.5.2-pre3/net/x25/x25_subr.c	Fri Jun 29 19:38:26 2001
+++ linux/net/x25/x25_subr.c	Sun Dec 30 11:38:12 2001
@@ -34,7 +34,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
diff -urN linux-2.5.2-pre3/net/x25/x25_timer.c linux/net/x25/x25_timer.c
--- linux-2.5.2-pre3/net/x25/x25_timer.c	Wed Jan 24 15:28:36 2001
+++ linux/net/x25/x25_timer.c	Sun Dec 30 11:38:12 2001
@@ -32,7 +32,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <linux/fcntl.h>
 #include <linux/mm.h>
