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

diff -urN linux-2.5.4-pre3/Makefile linux/Makefile
--- linux-2.5.4-pre3/Makefile	Fri Feb  8 17:34:18 2002
+++ linux/Makefile	Fri Feb  8 17:34:21 2002
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 4
-EXTRAVERSION =-pre3
+EXTRAVERSION =-pre4
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.5.4-pre3/arch/i386/defconfig linux/arch/i386/defconfig
--- linux-2.5.4-pre3/arch/i386/defconfig	Fri Feb  8 17:34:18 2002
+++ linux/arch/i386/defconfig	Fri Feb  8 17:34:21 2002
@@ -436,6 +436,7 @@
 # CONFIG_8139TOO_PIO is not set
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_NEW_RX_RESET is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -581,7 +582,7 @@
 CONFIG_AGP_INTEL=y
 CONFIG_AGP_I810=y
 CONFIG_AGP_VIA=y
-CONFIG_AGP_AMD=y
+# CONFIG_AGP_AMD is not set
 CONFIG_AGP_SIS=y
 CONFIG_AGP_ALI=y
 # CONFIG_AGP_SWORKS is not set
diff -urN linux-2.5.4-pre3/arch/i386/kernel/cpuid.c linux/arch/i386/kernel/cpuid.c
--- linux-2.5.4-pre3/arch/i386/kernel/cpuid.c	Fri Feb  8 17:34:18 2002
+++ linux/arch/i386/kernel/cpuid.c	Fri Feb  8 17:34:21 2002
@@ -95,6 +95,7 @@
   case 1:
     file->f_pos += offset;
     ret = file->f_pos;
+    break;
   default:
     ret = -EINVAL;
   }
diff -urN linux-2.5.4-pre3/arch/i386/kernel/i387.c linux/arch/i386/kernel/i387.c
--- linux-2.5.4-pre3/arch/i386/kernel/i387.c	Fri Feb  8 17:34:18 2002
+++ linux/arch/i386/kernel/i387.c	Fri Feb  8 17:34:21 2002
@@ -52,7 +52,7 @@
 		asm volatile( "fnsave %0 ; fwait"
 			      : "=m" (tsk->thread.i387.fsave) );
 	}
-	clear_thread_flag(TIF_USEDFPU);
+	clear_tsk_thread_flag(tsk, TIF_USEDFPU);
 }
 
 void save_init_fpu( struct task_struct *tsk )
@@ -63,10 +63,8 @@
 
 void kernel_fpu_begin(void)
 {
-	struct task_struct *tsk = current;
-
 	if (test_thread_flag(TIF_USEDFPU)) {
-		__save_init_fpu(tsk);
+		__save_init_fpu(current);
 		return;
 	}
 	clts();
diff -urN linux-2.5.4-pre3/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- linux-2.5.4-pre3/arch/i386/kernel/process.c	Fri Feb  8 17:34:18 2002
+++ linux/arch/i386/kernel/process.c	Fri Feb  8 17:34:21 2002
@@ -808,7 +808,7 @@
 	int count = 0;
 	if (!p || p == current || p->state == TASK_RUNNING)
 		return 0;
-	stack_page = (unsigned long)p;
+	stack_page = (unsigned long)p->thread_info;
 	esp = p->thread.esp;
 	if (!stack_page || esp < stack_page || esp > 8188+stack_page)
 		return 0;
diff -urN linux-2.5.4-pre3/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
--- linux-2.5.4-pre3/arch/i386/kernel/ptrace.c	Fri Feb  8 17:34:18 2002
+++ linux/arch/i386/kernel/ptrace.c	Fri Feb  8 17:34:21 2002
@@ -278,10 +278,10 @@
 		if ((unsigned long) data > _NSIG)
 			break;
 		if (request == PTRACE_SYSCALL) {
-			set_thread_flag(TIF_SYSCALL_TRACE);
+			set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		}
 		else {
-			clear_thread_flag(TIF_SYSCALL_TRACE);
+			clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		}
 		child->exit_code = data;
 	/* make sure the single step bit is not set. */
@@ -317,7 +317,7 @@
 		ret = -EIO;
 		if ((unsigned long) data > _NSIG)
 			break;
-		clear_thread_flag(TIF_SYSCALL_TRACE);
+		clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
 		if ((child->ptrace & PT_DTRACE) == 0) {
 			/* Spurious delayed TF traps may occur */
 			child->ptrace |= PT_DTRACE;
@@ -449,7 +449,7 @@
 {
 	if (!test_thread_flag(TIF_SYSCALL_TRACE))
 		return;
-	if (current->ptrace & PT_PTRACED)
+	if (!(current->ptrace & PT_PTRACED))
 		return;
 	/* the 0x80 provides a way for the tracing parent to distinguish
 	   between a syscall stop and SIGTRAP delivery */
diff -urN linux-2.5.4-pre3/drivers/base/core.c linux/drivers/base/core.c
--- linux-2.5.4-pre3/drivers/base/core.c	Fri Feb  8 17:34:19 2002
+++ linux/drivers/base/core.c	Fri Feb  8 17:34:21 2002
@@ -18,7 +18,10 @@
 # define DBG(x...)
 #endif
 
-static struct device * device_root;
+static struct device device_root = {
+	bus_id:		"root",
+	name:		"System Root",
+};
 
 int (*platform_notify)(struct device * dev) = NULL;
 int (*platform_notify_remove)(struct device * dev) = NULL;
@@ -49,9 +52,9 @@
 	spin_lock_init(&dev->lock);
 	atomic_set(&dev->refcount,2);
 
-	if (dev != device_root) {
+	if (dev != &device_root) {
 		if (!dev->parent)
-			dev->parent = device_root;
+			dev->parent = &device_root;
 		get_device(dev->parent);
 		list_add_tail(&dev->node,&dev->parent->children);
 	}
@@ -117,16 +120,10 @@
 
 static int __init device_init_root(void)
 {
-	device_root = kmalloc(sizeof(*device_root),GFP_KERNEL);
-	if (!device_root)
-		return -ENOMEM;
-	memset(device_root,0,sizeof(*device_root));
-	strcpy(device_root->bus_id,"root");
-	strcpy(device_root->name,"System Root");
-	return device_register(device_root);
+	return device_register(&device_root);
 }
 
-static int __init device_driver_init(void)
+static int __init device_init(void)
 {
 	int error = 0;
 
@@ -141,17 +138,12 @@
 		return error;
 	}
 
-	error = device_init_root();
-	if (error) {
+	if ((error = device_init_root()))
 		printk(KERN_ERR "%s: device root init failed!\n", __FUNCTION__);
-		return error;
-	}
-
-	DBG("DEV: Done Initialising\n");
 	return error;
 }
 
-subsys_initcall(device_driver_init);
+subsys_initcall(device_init);
 
 EXPORT_SYMBOL(device_register);
 EXPORT_SYMBOL(put_device);
diff -urN linux-2.5.4-pre3/drivers/ide/ide-dma.c linux/drivers/ide/ide-dma.c
--- linux-2.5.4-pre3/drivers/ide/ide-dma.c	Tue Jan 15 11:27:30 2002
+++ linux/drivers/ide/ide-dma.c	Fri Feb  8 17:34:21 2002
@@ -266,14 +266,16 @@
 #if 1	
 	if (sector_count > 128) {
 		memset(&sg[nents], 0, sizeof(*sg));
-		sg[nents].address = virt_addr;
+		sg[nents].page = virt_to_page(virt_addr);
+		sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK;
 		sg[nents].length = 128  * SECTOR_SIZE;
 		nents++;
 		virt_addr = virt_addr + (128 * SECTOR_SIZE);
 		sector_count -= 128;
 	}
 	memset(&sg[nents], 0, sizeof(*sg));
-	sg[nents].address = virt_addr;
+	sg[nents].page = virt_to_page(virt_addr);
+	sg[nents].offset = (unsigned long) virt_addr & ~PAGE_MASK;
 	sg[nents].length =  sector_count  * SECTOR_SIZE;
 	nents++;
  #endif
diff -urN linux-2.5.4-pre3/drivers/net/Config.help linux/drivers/net/Config.help
--- linux-2.5.4-pre3/drivers/net/Config.help	Fri Jan 25 16:04:23 2002
+++ linux/drivers/net/Config.help	Fri Feb  8 17:34:22 2002
@@ -1154,6 +1154,17 @@
   More specific information and updates are available from
   <http://www.scyld.com/network/natsemi.html>.
 
+CONFIG_NATSEMI_CABLE_MAGIC
+  Some systems see lots of errors with NatSemi ethernet controllers
+  on certain cables.  If you are seeing lots of errors, try turning
+  this option on.  Some boards have incorrect values for supporting
+  resistors that can cause this change to break.  If you turn this
+  option on and your network suddenly stops working, turn this
+  option off.
+
+  Say N unless you are certain you need this option.
+  Vendors should not enable this option by default.
+
 CONFIG_SK_G16
   If you have a network (Ethernet) card of this type, say Y and read
   the Ethernet-HOWTO, available from
diff -urN linux-2.5.4-pre3/drivers/net/Config.in linux/drivers/net/Config.in
--- linux-2.5.4-pre3/drivers/net/Config.in	Fri Feb  8 17:34:19 2002
+++ linux/drivers/net/Config.in	Fri Feb  8 17:34:22 2002
@@ -171,6 +171,9 @@
       dep_tristate '    Mylex EISA LNE390A/B support (EXPERIMENTAL)' CONFIG_LNE390 $CONFIG_EISA $CONFIG_EXPERIMENTAL
       dep_tristate '    Myson MTD-8xx PCI Ethernet support' CONFIG_FEALNX $CONFIG_PCI
       dep_tristate '    National Semiconductor DP8381x series PCI Ethernet support' CONFIG_NATSEMI $CONFIG_PCI
+      if [ "$CONFIG_NATSEMI" = "y" -o "$CONFIG_NATSEMI" = "m" ]; then
+        bool       '      NatSemi workaround for high errors' CONFIG_NATSEMI_CABLE_MAGIC
+      fi
       dep_tristate '    PCI NE2000 and clones support (see help)' CONFIG_NE2K_PCI $CONFIG_PCI
       dep_tristate '    Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)' CONFIG_NE3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
       dep_tristate '    Racal-Interlan EISA ES3210 support (EXPERIMENTAL)' CONFIG_ES3210 $CONFIG_EISA $CONFIG_EXPERIMENTAL
diff -urN linux-2.5.4-pre3/drivers/net/eepro100.c linux/drivers/net/eepro100.c
--- linux-2.5.4-pre3/drivers/net/eepro100.c	Tue Jan  8 09:34:50 2002
+++ linux/drivers/net/eepro100.c	Fri Feb  8 17:34:22 2002
@@ -833,6 +833,10 @@
 	sp->phy[0] = eeprom[6];
 	sp->phy[1] = eeprom[7];
 	sp->rx_bug = (eeprom[3] & 0x03) == 3 ? 0 : 1;
+	if (((pdev->device > 0x1030 && (pdev->device < 0x1039))) 
+	    || (pdev->device == 0x2449)) {
+	    	sp->chip_id = 1;
+	}
 
 	if (sp->rx_bug)
 		printk(KERN_INFO "  Receiver lock-up workaround activated.\n");
@@ -987,6 +991,11 @@
 	if ((sp->phy[0] & 0x8000) == 0)
 		sp->advertising = mdio_read(ioaddr, sp->phy[0] & 0x1f, 4);
 
+	if (mdio_read(ioaddr, sp->phy[0] & 0x1f, MII_BMSR) & BMSR_LSTATUS)
+		netif_carrier_on(dev);
+	else
+		netif_carrier_off(dev);
+
 	if (speedo_debug > 2) {
 		printk(KERN_DEBUG "%s: Done speedo_open(), status %8.8x.\n",
 			   dev->name, inw(ioaddr + SCBStatus));
@@ -1098,10 +1107,10 @@
 			/* Clear sticky bit. */
 			mdio_read(ioaddr, phy_num, 1);
 			/* If link beat has returned... */
-			if (mdio_read(ioaddr, phy_num, 1) & 0x0004)
-				dev->flags |= IFF_RUNNING;
+			if (mdio_read(ioaddr, phy_num, MII_BMSR) & BMSR_LSTATUS)
+				netif_carrier_on(dev);
 			else
-				dev->flags &= ~IFF_RUNNING;
+				netif_carrier_off(dev);
 		}
 	}
 	if (speedo_debug > 3) {
@@ -1375,7 +1384,7 @@
 
 	/* workaround for hardware bug on 10 mbit half duplex */
 
-	if ((sp->partner==0) && (sp->chip_id==1)) {
+	if ((sp->partner == 0) || (sp->chip_id == 1)) {
 		wait_for_cmd_done(ioaddr + SCBCmd);
 		outb(0 , ioaddr + SCBCmd);
 	}
diff -urN linux-2.5.4-pre3/drivers/net/natsemi.c linux/drivers/net/natsemi.c
--- linux-2.5.4-pre3/drivers/net/natsemi.c	Thu Jan 10 16:23:45 2002
+++ linux/drivers/net/natsemi.c	Fri Feb  8 17:34:22 2002
@@ -394,7 +394,11 @@
 	SDCFG			= 0xF8
 };
 /* the values for the 'magic' registers above (PGSEL=1) */
+#ifdef CONFIG_NATSEMI_CABLE_MAGIC
+#define PMDCSR_VAL	0x1898
+#else
 #define PMDCSR_VAL	0x189C
+#endif
 #define TSTDAT_VAL	0x0
 #define DSPCFG_VAL	0x5040
 #define SDCFG_VAL	0x008c
@@ -1511,7 +1515,7 @@
 		if (intr_status == 0)
 			break;
 
-		if (intr_status & (IntrRxDone | IntrRxIntr))
+		if (intr_status & (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | IntrRxErr | IntrRxOverrun ))
 			netdev_rx(dev);
 
 		if (intr_status & (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr) ) {
diff -urN linux-2.5.4-pre3/drivers/net/pcnet32.c linux/drivers/net/pcnet32.c
--- linux-2.5.4-pre3/drivers/net/pcnet32.c	Thu Jan 10 16:23:45 2002
+++ linux/drivers/net/pcnet32.c	Fri Feb  8 17:34:22 2002
@@ -65,15 +65,15 @@
 static const int max_interrupt_work = 80;
 static const int rx_copybreak = 200;
 
-#define PORT_AUI      0x00
-#define PORT_10BT     0x01
-#define PORT_GPSI     0x02
-#define PORT_MII      0x03
-
-#define PORT_PORTSEL  0x03
-#define PORT_ASEL     0x04
-#define PORT_100      0x40
-#define PORT_FD	      0x80
+#define PCNET32_PORT_AUI      0x00
+#define PCNET32_PORT_10BT     0x01
+#define PCNET32_PORT_GPSI     0x02
+#define PCNET32_PORT_MII      0x03
+
+#define PCNET32_PORT_PORTSEL  0x03
+#define PCNET32_PORT_ASEL     0x04
+#define PCNET32_PORT_100      0x40
+#define PCNET32_PORT_FD	      0x80
 
 #define PCNET32_DMA_MASK 0xffffffff
 
@@ -82,22 +82,22 @@
  * to internal options
  */
 static unsigned char options_mapping[] = {
-    PORT_ASEL,			   /*  0 Auto-select	  */
-    PORT_AUI,			   /*  1 BNC/AUI	  */
-    PORT_AUI,			   /*  2 AUI/BNC	  */ 
-    PORT_ASEL,			   /*  3 not supported	  */
-    PORT_10BT | PORT_FD,	   /*  4 10baseT-FD	  */
-    PORT_ASEL,			   /*  5 not supported	  */
-    PORT_ASEL,			   /*  6 not supported	  */
-    PORT_ASEL,			   /*  7 not supported	  */
-    PORT_ASEL,			   /*  8 not supported	  */
-    PORT_MII,			   /*  9 MII 10baseT	  */
-    PORT_MII | PORT_FD,		   /* 10 MII 10baseT-FD	  */
-    PORT_MII,			   /* 11 MII (autosel)	  */
-    PORT_10BT,			   /* 12 10BaseT	  */
-    PORT_MII | PORT_100,	   /* 13 MII 100BaseTx	  */
-    PORT_MII | PORT_100 | PORT_FD, /* 14 MII 100BaseTx-FD */
-    PORT_ASEL			   /* 15 not supported	  */
+    PCNET32_PORT_ASEL,			   /*  0 Auto-select	  */
+    PCNET32_PORT_AUI,			   /*  1 BNC/AUI	  */
+    PCNET32_PORT_AUI,			   /*  2 AUI/BNC	  */ 
+    PCNET32_PORT_ASEL,			   /*  3 not supported	  */
+    PCNET32_PORT_10BT | PCNET32_PORT_FD,	   /*  4 10baseT-FD	  */
+    PCNET32_PORT_ASEL,			   /*  5 not supported	  */
+    PCNET32_PORT_ASEL,			   /*  6 not supported	  */
+    PCNET32_PORT_ASEL,			   /*  7 not supported	  */
+    PCNET32_PORT_ASEL,			   /*  8 not supported	  */
+    PCNET32_PORT_MII,			   /*  9 MII 10baseT	  */
+    PCNET32_PORT_MII | PCNET32_PORT_FD,		   /* 10 MII 10baseT-FD	  */
+    PCNET32_PORT_MII,			   /* 11 MII (autosel)	  */
+    PCNET32_PORT_10BT,			   /* 12 10BaseT	  */
+    PCNET32_PORT_MII | PCNET32_PORT_100,	   /* 13 MII 100BaseTx	  */
+    PCNET32_PORT_MII | PCNET32_PORT_100 | PCNET32_PORT_FD, /* 14 MII 100BaseTx-FD */
+    PCNET32_PORT_ASEL			   /* 15 not supported	  */
 };
 
 #define MAX_UNITS 8
@@ -709,12 +709,12 @@
     lp->ltint = ltint;
     lp->mii = mii;
     if (options[card_idx] > sizeof (options_mapping))
-	lp->options = PORT_ASEL;
+	lp->options = PCNET32_PORT_ASEL;
     else
 	lp->options = options_mapping[options[card_idx]];
     
-    if (fdx && !(lp->options & PORT_ASEL) && full_duplex[card_idx])
-	lp->options |= PORT_FD;
+    if (fdx && !(lp->options & PCNET32_PORT_ASEL) && full_duplex[card_idx])
+	lp->options |= PCNET32_PORT_FD;
     
     if (a == NULL) {
       printk(KERN_ERR "pcnet32: No access methods\n");
@@ -726,7 +726,7 @@
     
     /* detect special T1/E1 WAN card by checking for MAC address */
     if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 && dev->dev_addr[2] == 0x75)
-	lp->options = PORT_FD | PORT_GPSI;
+	lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI;
 
     lp->init_block.mode = le16_to_cpu(0x0003);	/* Disable Rx and Tx. */
     lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); 
@@ -829,16 +829,16 @@
     
     /* set/reset autoselect bit */
     val = lp->a.read_bcr (ioaddr, 2) & ~2;
-    if (lp->options & PORT_ASEL)
+    if (lp->options & PCNET32_PORT_ASEL)
 	val |= 2;
     lp->a.write_bcr (ioaddr, 2, val);
     
     /* handle full duplex setting */
     if (lp->full_duplex) {
 	val = lp->a.read_bcr (ioaddr, 9) & ~3;
-	if (lp->options & PORT_FD) {
+	if (lp->options & PCNET32_PORT_FD) {
 	    val |= 1;
-	    if (lp->options == (PORT_FD | PORT_AUI))
+	    if (lp->options == (PCNET32_PORT_FD | PCNET32_PORT_AUI))
 		val |= 2;
 	}
 	lp->a.write_bcr (ioaddr, 9, val);
@@ -846,19 +846,19 @@
     
     /* set/reset GPSI bit in test register */
     val = lp->a.read_csr (ioaddr, 124) & ~0x10;
-    if ((lp->options & PORT_PORTSEL) == PORT_GPSI)
+    if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI)
 	val |= 0x10;
     lp->a.write_csr (ioaddr, 124, val);
     
-    if (lp->mii && !(lp->options & PORT_ASEL)) {
+    if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
 	val = lp->a.read_bcr (ioaddr, 32) & ~0x38; /* disable Auto Negotiation, set 10Mpbs, HD */
-	if (lp->options & PORT_FD)
+	if (lp->options & PCNET32_PORT_FD)
 	    val |= 0x10;
-	if (lp->options & PORT_100)
+	if (lp->options & PCNET32_PORT_100)
 	    val |= 0x08;
 	lp->a.write_bcr (ioaddr, 32, val);
     } else {
-	if (lp->options & PORT_ASEL) {  /* enable auto negotiate, setup, disable fd */
+	if (lp->options & PCNET32_PORT_ASEL) {  /* enable auto negotiate, setup, disable fd */
 		val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
 		val |= 0x20;
 		lp->a.write_bcr(ioaddr, 32, val);
@@ -878,7 +878,7 @@
 	lp->a.write_csr (ioaddr, 5, val);
     }
    
-    lp->init_block.mode = le16_to_cpu((lp->options & PORT_PORTSEL) << 7);
+    lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7);
     lp->init_block.filter[0] = 0x00000000;
     lp->init_block.filter[1] = 0x00000000;
     if (pcnet32_init_ring(dev))
@@ -1465,9 +1465,9 @@
     if (dev->flags&IFF_PROMISC) {
 	/* Log any net taps. */
 	printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
-	lp->init_block.mode = le16_to_cpu(0x8000 | (lp->options & PORT_PORTSEL) << 7);
+	lp->init_block.mode = le16_to_cpu(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) << 7);
     } else {
-	lp->init_block.mode = le16_to_cpu((lp->options & PORT_PORTSEL) << 7);
+	lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7);
 	pcnet32_load_multicast (dev);
     }
     
diff -urN linux-2.5.4-pre3/drivers/net/tulip/21142.c linux/drivers/net/tulip/21142.c
--- linux-2.5.4-pre3/drivers/net/tulip/21142.c	Fri Nov  9 13:45:35 2001
+++ linux/drivers/net/tulip/21142.c	Fri Feb  8 17:34:22 2002
@@ -39,8 +39,13 @@
 		printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n",
 			   dev->name, csr12, medianame[dev->if_port]);
 	if (tulip_media_cap[dev->if_port] & MediaIsMII) {
-		tulip_check_duplex(dev);
-		next_tick = 60*HZ;
+		if (tulip_check_duplex(dev) < 0) {
+			netif_carrier_off(dev);
+			next_tick = 3*HZ;
+		} else {
+			netif_carrier_on(dev);
+			next_tick = 60*HZ;
+		}
 	} else if (tp->nwayset) {
 		/* Don't screw up a negotiated session! */
 		if (tulip_debug > 1)
diff -urN linux-2.5.4-pre3/drivers/net/tulip/ChangeLog linux/drivers/net/tulip/ChangeLog
--- linux-2.5.4-pre3/drivers/net/tulip/ChangeLog	Tue Dec 11 10:47:49 2001
+++ linux/drivers/net/tulip/ChangeLog	Fri Feb  8 17:34:22 2002
@@ -1,3 +1,30 @@
+2002-01-28  Stefan Rompf  <srompf@isg.de>,
+            Jeff Garzik  <jgarzik@mandrakesoft.com>
+
+        * 21142.c (t21142_timer):  Use return value of
+        tulip_check_duplex() to indicate to system whether or not
+        carrier is present.  Use carrier presence/absence to determine
+        when next the 21142 media timer should check for link beat.
+
+        * timer (tulip_timer):  Un-comment-out calls to
+        netif_carrier_{on,off}, as there is now value in
+        reporting link beta information to userspace.
+
+2002-01-28  Pavel Roskin  <proski@gnu.org>
+
+	* tulip_core.c (tulip_init_one): Use tp->eeprom instead of
+	allocating a buffer for EEPROM copy on the stack.
+
+	* tulip_core.c: Add support for Conexant RS7112 (a.k.a. CN7112)
+	chip.
+	* tulip.h: Likewise.  Increase EEPROM_SIZE to 512 bytes to
+	accomodate EEPROM on Conexant RS7112.
+
+2002-02-07  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>
+
+        * tulip_core (tulip_pci_tbl[]):
+        Add PCI id for comet tulip clone.
+
 2001-12-11  Jeff Garzik  <jgarzik@mandrakesoft.com>
 
 	* eeprom.c, timer.c, media.c, tulip_core.c:
diff -urN linux-2.5.4-pre3/drivers/net/tulip/timer.c linux/drivers/net/tulip/timer.c
--- linux-2.5.4-pre3/drivers/net/tulip/timer.c	Tue Dec 11 10:47:49 2001
+++ linux/drivers/net/tulip/timer.c	Fri Feb  8 17:34:22 2002
@@ -83,10 +83,10 @@
 					       medianame[mleaf->media & MEDIA_MASK]);
 				if ((p[2] & 0x61) == 0x01)	/* Bogus Znyx board. */
 					goto actually_mii;
-				/* netif_carrier_on(dev); */
+				netif_carrier_on(dev);
 				break;
 			}
-			/* netif_carrier_off(dev); */
+			netif_carrier_off(dev);
 			if (tp->medialock)
 				break;
 	  select_next_media:
@@ -110,11 +110,13 @@
 		}
 		case 1:  case 3:		/* 21140, 21142 MII */
 		actually_mii:
-			if (tulip_check_duplex(dev) < 0)
-				{ /* netif_carrier_off(dev); */ }
-			else
-				{ /* netif_carrier_on(dev); */ }
-			next_tick = 60*HZ;
+			if (tulip_check_duplex(dev) < 0) {
+				netif_carrier_off(dev);
+				next_tick = 3*HZ;
+			} else {
+				netif_carrier_on(dev);
+				next_tick = 60*HZ;
+			}
 			break;
 		case 2:					/* 21142 serial block has no link beat. */
 		default:
diff -urN linux-2.5.4-pre3/drivers/net/tulip/tulip.h linux/drivers/net/tulip/tulip.h
--- linux-2.5.4-pre3/drivers/net/tulip/tulip.h	Fri Nov  9 13:45:35 2001
+++ linux/drivers/net/tulip/tulip.h	Fri Feb  8 17:34:22 2002
@@ -84,6 +84,7 @@
 	COMPEX9881,
 	I21145,
 	DM910X,
+	CONEXANT,
 };
 
 
@@ -290,7 +291,7 @@
 #define DESC_RING_WRAP 0x02000000
 
 
-#define EEPROM_SIZE 128 	/* 2 << EEPROM_ADDRLEN */
+#define EEPROM_SIZE 512 	/* 2 << EEPROM_ADDRLEN */
 
 
 #define RUN_AT(x) (jiffies + (x))
diff -urN linux-2.5.4-pre3/drivers/net/tulip/tulip_core.c linux/drivers/net/tulip/tulip_core.c
--- linux-2.5.4-pre3/drivers/net/tulip/tulip_core.c	Thu Jan 10 16:23:45 2002
+++ linux/drivers/net/tulip/tulip_core.c	Fri Feb  8 17:34:22 2002
@@ -15,8 +15,8 @@
 */
 
 #define DRV_NAME	"tulip"
-#define DRV_VERSION	"1.1.0"
-#define DRV_RELDATE	"Dec 11, 2001"
+#define DRV_VERSION	"1.1.11"
+#define DRV_RELDATE	"Feb 08, 2002"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -185,6 +185,10 @@
   { "Davicom DM9102/DM9102A", 128, 0x0001ebef,
 	HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI,
 	tulip_timer },
+
+  /* RS7112 */
+  { "Conexant LANfinity", 256, 0x0001ebef,
+	HAS_MII | HAS_ACPI, tulip_timer },
 };
 
 
@@ -202,6 +206,7 @@
 	{ 0x1317, 0x1985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x13D1, 0xAB02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x13D1, 0xAB03, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+	{ 0x13D1, 0xAB08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x104A, 0x0981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x104A, 0x2774, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 },
@@ -211,6 +216,7 @@
 	{ 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
 	{ 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
 	{ 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+	{ 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT },
 	{ } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, tulip_pci_tbl);
@@ -417,7 +423,7 @@
 		tp->csr6 = 0x01a80200;
 		outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
 		outl(0x11000 | inw(ioaddr + 0xa0), ioaddr + 0xa0);
-	} else if (tp->chip_id == COMET) {
+	} else if (tp->chip_id == COMET || tp->chip_id == CONEXANT) {
 		/* Enable automatic Tx underrun recovery. */
 		outl(inl(ioaddr + 0x88) | 1, ioaddr + 0x88);
 		dev->if_port = tp->mii_cnt ? 11 : 0;
@@ -1253,7 +1259,7 @@
 	u8 chip_rev;
 	int i, irq;
 	unsigned short sum;
-	u8 ee_data[EEPROM_SIZE];
+	unsigned char *ee_data;
 	struct net_device *dev;
 	long ioaddr;
 	static int board_idx = -1;
@@ -1430,6 +1436,7 @@
 	   be polled, waiting for the value to be read bit serially from the
 	   EEPROM.
 	   */
+	ee_data = tp->eeprom;
 	sum = 0;
 	if (chip_idx == LC82C168) {
 		for (i = 0; i < 3; i++) {
@@ -1452,17 +1459,22 @@
 		int sa_offset = 0;
 		int ee_addr_size = tulip_read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
 
-		for (i = 0; i < sizeof(ee_data)/2; i++)
+		for (i = 0; i < sizeof(tp->eeprom)/2; i++)
 			((u16 *)ee_data)[i] =
 				le16_to_cpu(tulip_read_eeprom(ioaddr, i, ee_addr_size));
 
 		/* DEC now has a specification (see Notes) but early board makers
 		   just put the address in the first EEPROM locations. */
-		/* This does  memcmp(eedata, eedata+16, 8) */
+		/* This does  memcmp(ee_data, ee_data+16, 8) */
 		for (i = 0; i < 8; i ++)
 			if (ee_data[i] != ee_data[16+i])
 				sa_offset = 20;
-		if (ee_data[0] == 0xff  &&  ee_data[1] == 0xff &&  ee_data[2] == 0) {
+		if (chip_idx == CONEXANT) {
+			/* Check that the tuple type and length is correct. */
+			if (ee_data[0x198] == 0x04  &&  ee_data[0x199] == 6)
+				sa_offset = 0x19A;
+		} else if (ee_data[0] == 0xff  &&  ee_data[1] == 0xff &&
+				   ee_data[2] == 0) {
 			sa_offset = 2;		/* Grrr, damn Matrox boards. */
 			multiport_cnt = 4;
 		}
@@ -1555,8 +1567,6 @@
 	}
 
 	if (tp->flags & HAS_MEDIA_TABLE) {
-		memcpy(tp->eeprom, ee_data, sizeof(tp->eeprom));
-
 		sprintf(dev->name, "tulip%d", board_idx);	/* hack */
 		tulip_parse_eeprom(dev);
 		strcpy(dev->name, "eth%d");			/* un-hack */
diff -urN linux-2.5.4-pre3/drivers/net/winbond-840.c linux/drivers/net/winbond-840.c
--- linux-2.5.4-pre3/drivers/net/winbond-840.c	Fri Feb  8 17:34:19 2002
+++ linux/drivers/net/winbond-840.c	Fri Feb  8 17:34:22 2002
@@ -347,7 +347,7 @@
 	struct w840_rx_desc *rx_ring;
 	dma_addr_t	rx_addr[RX_RING_SIZE];
 	struct w840_tx_desc *tx_ring;
-	dma_addr_t	tx_addr[RX_RING_SIZE];
+	dma_addr_t	tx_addr[TX_RING_SIZE];
 	dma_addr_t ring_dma_addr;
 	/* The addresses of receive-in-place skbuffs. */
 	struct sk_buff* rx_skbuff[RX_RING_SIZE];
diff -urN linux-2.5.4-pre3/drivers/pcmcia/cardbus.c linux/drivers/pcmcia/cardbus.c
--- linux-2.5.4-pre3/drivers/pcmcia/cardbus.c	Mon Nov 12 09:39:01 2001
+++ linux/drivers/pcmcia/cardbus.c	Fri Feb  8 17:34:22 2002
@@ -279,6 +279,12 @@
 		pci_readw(dev, PCI_DEVICE_ID, &dev->device);
 		dev->hdr_type = hdr & 0x7f;
 
+		dev->dev.parent = bus->device;
+		dev->dev.sysdata = bus->sysdata;
+		strcpy(dev->dev.name, dev->name);
+		strcpy(dev->dev.bus_id, dev->slot_name);
+		device_register(&dev->dev);
+
 		pci_setup_device(dev);
 
 		/* FIXME: Do we need to enable the expansion ROM? */
diff -urN linux-2.5.4-pre3/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
--- linux-2.5.4-pre3/drivers/scsi/ide-scsi.c	Tue Jan 15 11:27:47 2002
+++ linux/drivers/scsi/ide-scsi.c	Fri Feb  8 17:34:22 2002
@@ -130,6 +130,7 @@
 static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigned int bcount)
 {
 	int count;
+	char *buf;
 
 	while (bcount) {
 		if (pc->sg - (struct scatterlist *) pc->scsi_cmd->request_buffer > pc->scsi_cmd->use_sg) {
@@ -138,7 +139,8 @@
 			return;
 		}
 		count = IDE_MIN (pc->sg->length - pc->b_count, bcount);
-		atapi_input_bytes (drive, pc->sg->address + pc->b_count, count);
+		buf = page_address(pc->sg->page) + pc->sg->offset;
+		atapi_input_bytes (drive, buf + pc->b_count, count);
 		bcount -= count; pc->b_count += count;
 		if (pc->b_count == pc->sg->length) {
 			pc->sg++;
@@ -150,6 +152,7 @@
 static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigned int bcount)
 {
 	int count;
+	char *buf;
 
 	while (bcount) {
 		if (pc->sg - (struct scatterlist *) pc->scsi_cmd->request_buffer > pc->scsi_cmd->use_sg) {
@@ -158,7 +161,8 @@
 			return;
 		}
 		count = IDE_MIN (pc->sg->length - pc->b_count, bcount);
-		atapi_output_bytes (drive, pc->sg->address + pc->b_count, count);
+		buf = page_address(pc->sg->page) + pc->sg->offset;
+		atapi_output_bytes (drive, buf + pc->b_count, count);
 		bcount -= count; pc->b_count += count;
 		if (pc->b_count == pc->sg->length) {
 			pc->sg++;
@@ -750,25 +754,11 @@
 		printk ("ide-scsi: %s: building DMA table, %d segments, %dkB total\n", drive->name, segments, pc->request_transfer >> 10);
 #endif /* IDESCSI_DEBUG_LOG */
 		while (segments--) {
-			struct page *page = sg->page;
-			int offset = sg->offset;
-
-			if (!page) {
-				BUG_ON(!sg->address);
-				page = virt_to_page(sg->address);
-				offset = (unsigned long) sg->address & ~PAGE_MASK;
-			}
-				
-			bh->bi_io_vec[0].bv_page = page;
+			bh->bi_io_vec[0].bv_page = sg->page;
 			bh->bi_io_vec[0].bv_len = sg->length;
-			bh->bi_io_vec[0].bv_offset = offset;
+			bh->bi_io_vec[0].bv_offset = sg->offset;
 			bh->bi_size = sg->length;
 			bh = bh->bi_next;
-			/*
-			 * just until scsi_merge is fixed up...
-			 */
-			BUG_ON(PageHighMem(page));
-			sg->address = page_address(page) + offset;
 			sg++;
 		}
 	} else {
diff -urN linux-2.5.4-pre3/drivers/scsi/sg.c linux/drivers/scsi/sg.c
--- linux-2.5.4-pre3/drivers/scsi/sg.c	Thu Jan 17 13:59:33 2002
+++ linux/drivers/scsi/sg.c	Fri Feb  8 17:34:22 2002
@@ -76,8 +76,6 @@
 #include <linux/version.h>
 #endif /* LINUX_VERSION_CODE */
 
-#define SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
-
 #define SG_ALLOW_DIO_DEF 0
 #define SG_ALLOW_DIO_CODE	/* compile out be commenting this define */
 #ifdef SG_ALLOW_DIO_CODE
@@ -1714,9 +1712,6 @@
 						rem_sz;
 	sclp->page = kp->maplist[k];
 	sclp->offset = offset;
-#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
-	sclp->address = page_address(kp->maplist[k]) + offset;
-#endif
 	sclp->length = num;
 	mem_src_arr[k] = SG_USER_MEM;
 	rem_sz -= num;
@@ -1804,9 +1799,6 @@
             }
             sclp->page = virt_to_page(p);
             sclp->offset = (unsigned long)p & ~PAGE_MASK;
-#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
-            sclp->address = p;
-#endif
             sclp->length = ret_sz;
 	    mem_src_arr[k] = mem_src;
 
@@ -1967,9 +1959,6 @@
             sg_free(sg_scatg2virt(sclp), sclp->length, mem_src);
 	    sclp->page = NULL;
             sclp->offset = 0;
-#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
-	    sclp->address = 0;
-#endif
             sclp->length = 0;
         }
 	sg_free(schp->buffer, schp->sglist_len, schp->buffer_mem_src);
diff -urN linux-2.5.4-pre3/drivers/usb/ibmcam.h linux/drivers/usb/ibmcam.h
--- linux-2.5.4-pre3/drivers/usb/ibmcam.h	Mon Jan 21 15:44:21 2002
+++ linux/drivers/usb/ibmcam.h	Wed Dec 31 16:00:00 1969
@@ -1,240 +0,0 @@
-/*
- * Header file for USB IBM C-It Video Camera driver.
- *
- * Supports IBM C-It Video Camera.
- *
- * This driver is based on earlier work of:
- *
- * (C) Copyright 1999 Johannes Erdfelt
- * (C) Copyright 1999 Randy Dunlap
- */
-
-#ifndef __LINUX_IBMCAM_H
-#define __LINUX_IBMCAM_H
-
-#include <linux/list.h>
-
-#define USES_IBMCAM_PUTPIXEL    0       /* 0=Fast/oops 1=Slow/secure */
-
-/* Video Size 384 x 288 x 3 bytes for RGB */
-/* 384 because xawtv tries to grab 384 even though we tell it 352 is our max */
-#define V4L_FRAME_WIDTH         384
-#define V4L_FRAME_WIDTH_USED	352
-#define V4L_FRAME_HEIGHT        288
-#define V4L_BYTES_PER_PIXEL     3
-#define MAX_FRAME_SIZE          (V4L_FRAME_WIDTH * V4L_FRAME_HEIGHT * V4L_BYTES_PER_PIXEL)
-
-/* Camera capabilities (maximum) */
-#define CAMERA_IMAGE_WIDTH      352
-#define CAMERA_IMAGE_HEIGHT     288
-#define CAMERA_IMAGE_LINE_SZ    ((CAMERA_IMAGE_WIDTH * 3) / 2) /* Bytes */
-#define CAMERA_URB_FRAMES       32
-#define CAMERA_MAX_ISO_PACKET   1023 /* 1022 actually sent by camera */
-
-#define IBMCAM_NUMFRAMES	2
-#define IBMCAM_NUMSBUF		2
-
-#define FRAMES_PER_DESC		(CAMERA_URB_FRAMES)
-#define FRAME_SIZE_PER_DESC	(CAMERA_MAX_ISO_PACKET)
-
-/* This macro restricts an int variable to an inclusive range */
-#define RESTRICT_TO_RANGE(v,mi,ma) { if ((v) < (mi)) (v) = (mi); else if ((v) > (ma)) (v) = (ma); }
-
-/*
- * This macro performs bounds checking - use it when working with
- * new formats, or else you may get oopses all over the place.
- * If pixel falls out of bounds then it gets shoved back (as close
- * to place of offence as possible) and is painted bright red.
- */
-#define IBMCAM_PUTPIXEL(fr, ix, iy, vr, vg, vb) { \
-	register unsigned char *pf; \
-	int limiter = 0, mx, my; \
-	mx = ix; \
-	my = iy; \
-	if (mx < 0) { \
-		mx=0; \
-		limiter++; \
-	} else if (mx >= 352) { \
-		mx=351; \
-		limiter++; \
-	} \
-	if (my < 0) { \
-		my = 0; \
-		limiter++; \
-	} else if (my >= V4L_FRAME_HEIGHT) { \
-		my = V4L_FRAME_HEIGHT - 1; \
-		limiter++; \
-	} \
-	pf = (fr)->data + V4L_BYTES_PER_PIXEL*((iy)*352 + (ix)); \
-	if (limiter) { \
-		*pf++ = 0; \
-		*pf++ = 0; \
-		*pf++ = 0xFF; \
-	} else { \
-		*pf++ = (vb); \
-		*pf++ = (vg); \
-		*pf++ = (vr); \
-	} \
-}
-
-/*
- * We use macros to do YUV -> RGB conversion because this is
- * very important for speed and totally unimportant for size.
- *
- * YUV -> RGB Conversion
- * ---------------------
- *
- * B = 1.164*(Y-16)		    + 2.018*(V-128)
- * G = 1.164*(Y-16) - 0.813*(U-128) - 0.391*(V-128)
- * R = 1.164*(Y-16) + 1.596*(U-128)
- *
- * If you fancy integer arithmetics (as you should), hear this:
- *
- * 65536*B = 76284*(Y-16)		  + 132252*(V-128)
- * 65536*G = 76284*(Y-16) -  53281*(U-128) -  25625*(V-128)
- * 65536*R = 76284*(Y-16) + 104595*(U-128)
- *
- * Make sure the output values are within [0..255] range.
- */
-#define LIMIT_RGB(x) (((x) < 0) ? 0 : (((x) > 255) ? 255 : (x)))
-#define YUV_TO_RGB_BY_THE_BOOK(my,mu,mv,mr,mg,mb) { \
-    int mm_y, mm_yc, mm_u, mm_v, mm_r, mm_g, mm_b; \
-    mm_y = (my) - 16;  \
-    mm_u = (mu) - 128; \
-    mm_v = (mv) - 128; \
-    mm_yc= mm_y * 76284; \
-    mm_b = (mm_yc		+ 132252*mm_v	) >> 16; \
-    mm_g = (mm_yc -  53281*mm_u -  25625*mm_v	) >> 16; \
-    mm_r = (mm_yc + 104595*mm_u			) >> 16; \
-    mb = LIMIT_RGB(mm_b); \
-    mg = LIMIT_RGB(mm_g); \
-    mr = LIMIT_RGB(mm_r); \
-}
-
-/* Debugging aid */
-#define IBMCAM_SAY_AND_WAIT(what) { \
-	wait_queue_head_t wq; \
-	init_waitqueue_head(&wq); \
-	printk(KERN_INFO "Say: %s\n", what); \
-	interruptible_sleep_on_timeout (&wq, HZ*3); \
-}
-
-/*
- * This macro checks if ibmcam is still operational. The 'ibmcam'
- * pointer must be valid, ibmcam->dev must be valid, we are not
- * removing the device and the device has not erred on us.
- */
-#define IBMCAM_IS_OPERATIONAL(ibm_cam) (\
-	(ibm_cam != NULL) && \
-	((ibm_cam)->dev != NULL) && \
-	((ibm_cam)->last_error == 0) && \
-	(!(ibm_cam)->remove_pending))
-
-enum {
-	STATE_SCANNING,		/* Scanning for header */
-	STATE_LINES,		/* Parsing lines */
-};
-
-enum {
-	FRAME_UNUSED,		/* Unused (no MCAPTURE) */
-	FRAME_READY,		/* Ready to start grabbing */
-	FRAME_GRABBING,		/* In the process of being grabbed into */
-	FRAME_DONE,		/* Finished grabbing, but not been synced yet */
-	FRAME_ERROR,		/* Something bad happened while processing */
-};
-
-struct usb_device;
-
-struct ibmcam_sbuf {
-	char *data;
-	struct urb *urb;
-};
-
-struct ibmcam_frame {
-	char *data;		/* Frame buffer */
-	int order_uv;		/* True=UV False=VU */
-	int order_yc;		/* True=Yc False=cY ('c'=either U or V) */
-	unsigned char hdr_sig;	/* "00 FF 00 ??" where 'hdr_sig' is '??' */
-
-	int width;		/* Width application is expecting */
-	int height;		/* Height */
-
-	int frmwidth;		/* Width the frame actually is */
-	int frmheight;		/* Height */
-
-	volatile int grabstate;	/* State of grabbing */
-	int scanstate;		/* State of scanning */
-
-	int curline;		/* Line of frame we're working on */
-
-	long scanlength;	/* uncompressed, raw data length of frame */
-	long bytes_read;	/* amount of scanlength that has been read from *data */
-
-	wait_queue_head_t wq;	/* Processes waiting */
-};
-
-#define	IBMCAM_MODEL_1	1	/* XVP-501, 3 interfaces, rev. 0.02 */
-#define IBMCAM_MODEL_2	2	/* KSX-X9903, 2 interfaces, rev. 3.0a */
-
-struct usb_ibmcam {
-	struct video_device vdev;
-
-	/* Device structure */
-	struct usb_device *dev;
-
-	unsigned char iface;                            /* Video interface number */
-	unsigned char ifaceAltActive, ifaceAltInactive; /* Alt settings */
-
-	struct semaphore lock;
-	int user;		/* user count for exclusive use */
-
-	int ibmcam_used;        /* Is this structure in use? */
-	int initialized;	/* Had we already sent init sequence? */
-	int camera_model;	/* What type of IBM camera we got? */
-	int streaming;		/* Are we streaming Isochronous? */
-	int grabbing;		/* Are we grabbing? */
-	int last_error;		/* What calamity struck us? */
-
-	int compress;		/* Should the next frame be compressed? */
-
-	char *fbuf;		/* Videodev buffer area */
-	int fbuf_size;		/* Videodev buffer size */
-
-	int curframe;
-	struct ibmcam_frame frame[IBMCAM_NUMFRAMES];	/* Double buffering */
-
-	int cursbuf;		/* Current receiving sbuf */
-	struct ibmcam_sbuf sbuf[IBMCAM_NUMSBUF];	/* Double buffering */
-	volatile int remove_pending;	/* If set then about to exit */
-
-        /*
-	 * Scratch space from the Isochronous pipe.
-	 * Scratch buffer should contain at least one pair of lines
-	 * (CAMERA_IMAGE_LINE_SZ). We set it to two pairs here.
-	 * This will be approximately 2 KB. HOWEVER in reality this
-	 * buffer must be as large as hundred of KB because otherwise
-	 * you'll get lots of overflows because V4L client may request
-	 * frames not as uniformly as USB sources them.
-	 */
-	unsigned char *scratch;
-	int scratchlen;
-
-	struct video_picture vpic, vpic_old;	/* Picture settings */
-	struct video_capability vcap;		/* Video capabilities */
-	struct video_channel vchan;	/* May be used for tuner support */
-	unsigned char video_endp;	/* 0x82 for IBM camera */
-        int has_hdr;
-        int frame_num;
-	int iso_packet_len;		/* Videomode-dependent, saves bus bandwidth */
-
-	/* Statistics that can be overlayed on screen */
-        unsigned long urb_count;        /* How many URBs we received so far */
-        unsigned long urb_length;       /* Length of last URB */
-        unsigned long data_count;       /* How many bytes we received */
-        unsigned long header_count;     /* How many frame headers we found */
-	unsigned long scratch_ovf_count;/* How many times we overflowed scratch */
-	unsigned long iso_skip_count;	/* How many empty ISO packets received */
-	unsigned long iso_err_count;	/* How many bad ISO packets received */
-};
-
-#endif /* __LINUX_IBMCAM_H */
diff -urN linux-2.5.4-pre3/fs/adfs/super.c linux/fs/adfs/super.c
--- linux-2.5.4-pre3/fs/adfs/super.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/adfs/super.c	Fri Feb  8 17:34:22 2002
@@ -346,7 +346,7 @@
 	return discsize;
 }
 
-struct super_block *adfs_read_super(struct super_block *sb, void *data, int silent)
+static int adfs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct adfs_discrecord *dr;
 	struct buffer_head *bh;
@@ -467,15 +467,26 @@
 		goto error;
 	} else
 		sb->s_root->d_op = &adfs_dentry_operations;
-	return sb;
+	return 0;
 
 error_free_bh:
 	brelse(bh);
 error:
-	return NULL;
+	return -EINVAL;
 }
 
-static DECLARE_FSTYPE_DEV(adfs_fs_type, "adfs", adfs_read_super);
+static struct super_block *adfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super);
+}
+
+static struct file_system_type adfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"adfs",
+	get_sb:		adfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_adfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/affs/super.c linux/fs/affs/super.c
--- linux-2.5.4-pre3/fs/affs/super.c	Mon Jan 21 15:37:32 2002
+++ linux/fs/affs/super.c	Fri Feb  8 17:34:22 2002
@@ -265,8 +265,7 @@
  * hopefully have the guts to do so. Until then: sorry for the mess.
  */
 
-static struct super_block *
-affs_read_super(struct super_block *sb, void *data, int silent)
+static int affs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct buffer_head	*root_bh = NULL;
 	struct buffer_head	*boot_bh;
@@ -294,7 +293,7 @@
 				&blocksize,&AFFS_SB->s_prefix,
 				AFFS_SB->s_volume, &mount_flags)) {
 		printk(KERN_ERR "AFFS: Error parsing options\n");
-		return NULL;
+		return -EINVAL;
 	}
 	/* N.B. after this point s_prefix must be released */
 
@@ -462,7 +461,7 @@
 	sb->s_root->d_op = &affs_dentry_operations;
 
 	pr_debug("AFFS: s_flags=%lX\n",sb->s_flags);
-	return sb;
+	return 0;
 
 	/*
 	 * Begin the cascaded cleanup ...
@@ -475,7 +474,7 @@
 	affs_brelse(root_bh);
 	if (AFFS_SB->s_prefix)
 		kfree(AFFS_SB->s_prefix);
-	return NULL;
+	return -EINVAL;
 }
 
 static int
@@ -533,7 +532,18 @@
 	return 0;
 }
 
-static DECLARE_FSTYPE_DEV(affs_fs_type, "affs", affs_read_super);
+static struct super_block *affs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super);
+}
+
+static struct file_system_type affs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"affs",
+	get_sb:		affs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_affs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/bfs/inode.c linux/fs/bfs/inode.c
--- linux-2.5.4-pre3/fs/bfs/inode.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/bfs/inode.c	Fri Feb  8 17:34:22 2002
@@ -279,8 +279,7 @@
 #endif
 }
 
-static struct super_block * bfs_read_super(struct super_block * s, 
-	void * data, int silent)
+static int bfs_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct buffer_head * bh;
 	struct bfs_super_block * bfs_sb;
@@ -355,14 +354,25 @@
 		s->s_dirt = 1;
 	} 
 	dump_imap("read_super", s);
-	return s;
+	return 0;
 
 out:
 	brelse(bh);
-	return NULL;
+	return -EINVAL;
 }
 
-static DECLARE_FSTYPE_DEV(bfs_fs_type, "bfs", bfs_read_super);
+static struct super_block *bfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super);
+}
+
+static struct file_system_type bfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"bfs",
+	get_sb:		bfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_bfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/cramfs/inode.c linux/fs/cramfs/inode.c
--- linux-2.5.4-pre3/fs/cramfs/inode.c	Thu Jan  3 12:20:18 2002
+++ linux/fs/cramfs/inode.c	Fri Feb  8 17:34:22 2002
@@ -188,12 +188,11 @@
 }
 			
 
-static struct super_block * cramfs_read_super(struct super_block *sb, void *data, int silent)
+static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	int i;
 	struct cramfs_super super;
 	unsigned long root_offset;
-	struct super_block * retval = NULL;
 
 	sb_set_blocksize(sb, PAGE_CACHE_SIZE);
 
@@ -252,9 +251,9 @@
 	/* Set it all up.. */
 	sb->s_op = &cramfs_ops;
 	sb->s_root = d_alloc_root(get_cramfs_inode(sb, &super.root));
-	retval = sb;
+	return 0;
 out:
-	return retval;
+	return -EINVAL;
 }
 
 static int cramfs_statfs(struct super_block *sb, struct statfs *buf)
@@ -442,7 +441,18 @@
 	statfs:		cramfs_statfs,
 };
 
-static DECLARE_FSTYPE_DEV(cramfs_fs_type, "cramfs", cramfs_read_super);
+static struct super_block *cramfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super);
+}
+
+static struct file_system_type cramfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"cramfs",
+	get_sb:		cramfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_cramfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/driverfs/inode.c linux/fs/driverfs/inode.c
--- linux-2.5.4-pre3/fs/driverfs/inode.c	Fri Feb  8 17:34:19 2002
+++ linux/fs/driverfs/inode.c	Fri Feb  8 17:34:22 2002
@@ -245,6 +245,9 @@
 	if (!entry->show)
 		return 0;
 
+	if (count > PAGE_SIZE)
+		count = PAGE_SIZE;
+
 	dev = list_entry(entry->parent,struct device, dir);
 
 	page = (unsigned char*)__get_free_page(GFP_KERNEL);
@@ -260,7 +263,8 @@
 			if (len < 0)
 				retval = len;
 			break;
-		}
+		} else if (len > count)
+			len = count;
 
 		if (copy_to_user(buf,page,len)) {
 			retval = -EFAULT;
diff -urN linux-2.5.4-pre3/fs/efs/super.c linux/fs/efs/super.c
--- linux-2.5.4-pre3/fs/efs/super.c	Mon Jan 21 15:37:32 2002
+++ linux/fs/efs/super.c	Fri Feb  8 17:34:22 2002
@@ -14,7 +14,18 @@
 #include <linux/efs_fs_sb.h>
 #include <linux/slab.h>
 
-static DECLARE_FSTYPE_DEV(efs_fs_type, "efs", efs_read_super);
+static struct super_block *efs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super);
+}
+
+static struct file_system_type efs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"efs",
+	get_sb:		efs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static kmem_cache_t * efs_inode_cachep;
 
@@ -188,7 +199,8 @@
 	return 0;    
 }
 
-struct super_block *efs_read_super(struct super_block *s, void *d, int silent) {
+int efs_fill_super(struct super_block *s, void *d, int silent)
+{
 	struct efs_sb_info *sb;
 	struct buffer_head *bh;
 
@@ -246,11 +258,11 @@
 		goto out_no_fs;
 	}
 
-	return(s);
+	return 0;
 
 out_no_fs_ul:
 out_no_fs:
-	return(NULL);
+	return -EINVAL;
 }
 
 int efs_statfs(struct super_block *s, struct statfs *buf) {
diff -urN linux-2.5.4-pre3/fs/ext3/super.c linux/fs/ext3/super.c
--- linux-2.5.4-pre3/fs/ext3/super.c	Mon Jan 21 15:37:32 2002
+++ linux/fs/ext3/super.c	Fri Feb  8 17:34:22 2002
@@ -934,8 +934,7 @@
 	return res;
 }
 
-struct super_block * ext3_read_super (struct super_block * sb, void * data,
-				      int silent)
+static int ext3_fill_super (struct super_block *sb, void *data, int silent)
 {
 	struct buffer_head * bh;
 	struct ext3_super_block *es = 0;
@@ -1054,7 +1053,7 @@
 		if (!bh) {
 			printk(KERN_ERR 
 			       "EXT3-fs: Can't read superblock on 2nd try.\n");
-			return NULL;
+			return -EINVAL;
 		}
 		es = (struct ext3_super_block *)(((char *)bh->b_data) + offset);
 		sbi->s_es = es;
@@ -1252,7 +1251,7 @@
 		test_opt(sb,DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA ? "ordered":
 		"writeback");
 
-	return sb;
+	return 0;
 
 failed_mount3:
 	journal_destroy(sbi->s_journal);
@@ -1264,7 +1263,7 @@
 	ext3_blkdev_remove(sbi);
 	brelse(bh);
 out_fail:
-	return NULL;
+	return -EINVAL;
 }
 
 static journal_t *ext3_get_journal(struct super_block *sb, int journal_inum)
@@ -1769,7 +1768,18 @@
 	return 0;
 }
 
-static DECLARE_FSTYPE_DEV(ext3_fs_type, "ext3", ext3_read_super);
+static struct super_block *ext3_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super);
+}
+
+static struct file_system_type ext3_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"ext3",
+	get_sb:		ext3_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_ext3_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/freevxfs/vxfs_super.c linux/fs/freevxfs/vxfs_super.c
--- linux-2.5.4-pre3/fs/freevxfs/vxfs_super.c	Fri Jan  4 18:09:42 2002
+++ linux/fs/freevxfs/vxfs_super.c	Fri Feb  8 17:34:22 2002
@@ -135,8 +135,7 @@
  * Locking:
  *   We are under the bkl and @sbp->s_lock.
  */
-static struct super_block *
-vxfs_read_super(struct super_block *sbp, void *dp, int silent)
+static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
 {
 	struct vxfs_sb_info	*infp;
 	struct vxfs_sb		*rsbp;
@@ -146,7 +145,7 @@
 	infp = kmalloc(sizeof(*infp), GFP_KERNEL);
 	if (!infp) {
 		printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n");
-		return NULL;
+		return -ENOMEM;
 	}
 	memset(infp, 0, sizeof(*infp));
 
@@ -213,7 +212,7 @@
 		goto out_free_ilist;
 	}
 
-	return (sbp);
+	return 0;
 	
 out_free_ilist:
 	vxfs_put_fake_inode(infp->vsi_fship);
@@ -222,13 +221,24 @@
 out:
 	brelse(bp);
 	kfree(infp);
-	return NULL;
+	return -EINVAL;
 }
 
 /*
  * The usual module blurb.
  */
-static DECLARE_FSTYPE_DEV(vxfs_fs_type, "vxfs", vxfs_read_super);
+static struct super_block *vxfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super);
+}
+
+static struct file_system_type vxfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"vxfs",
+	get_sb:		vxfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init
 vxfs_init(void)
diff -urN linux-2.5.4-pre3/fs/hfs/super.c linux/fs/hfs/super.c
--- linux-2.5.4-pre3/fs/hfs/super.c	Mon Jan 28 13:20:34 2002
+++ linux/fs/hfs/super.c	Fri Feb  8 17:34:22 2002
@@ -95,7 +95,18 @@
 
 /*================ File-local variables ================*/
 
-static DECLARE_FSTYPE_DEV(hfs_fs, "hfs", hfs_read_super);
+static struct super_block *hfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super);
+}
+
+static struct file_system_type hfs_fs = {
+	owner:		THIS_MODULE,
+	name:		"hfs",
+	get_sb:		hfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 /*================ File-local functions ================*/
 
@@ -429,8 +440,7 @@
  * hfs_btree_init() to get the necessary data about the extents and
  * catalog B-trees and, finally, reading the root inode into memory.
  */
-struct super_block *hfs_read_super(struct super_block *s, void *data,
-				   int silent)
+int hfs_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct hfs_mdb *mdb;
 	struct hfs_cat_key key;
@@ -501,7 +511,7 @@
 	s->s_root->d_op = &hfs_dentry_operations;
 
 	/* everything's okay */
-	return s;
+	return 0;
 
 bail_no_root: 
 	hfs_warn("hfs_fs: get root inode failed.\n");
@@ -511,7 +521,7 @@
 bail2:
 	set_blocksize(dev, BLOCK_SIZE);
 bail3:
-	return NULL;	
+	return -EINVAL;	
 }
 
 static int __init init_hfs_fs(void)
diff -urN linux-2.5.4-pre3/fs/hpfs/super.c linux/fs/hpfs/super.c
--- linux-2.5.4-pre3/fs/hpfs/super.c	Fri Feb  8 17:34:19 2002
+++ linux/fs/hpfs/super.c	Fri Feb  8 17:34:22 2002
@@ -405,8 +405,7 @@
 	return 0;
 }
 
-struct super_block *hpfs_read_super(struct super_block *s, void *options,
-				    int silent)
+static int hpfs_fill_super(struct super_block *s, void *options, int silent)
 {
 	struct buffer_head *bh0, *bh1, *bh2;
 	struct hpfs_boot_block *bootblock;
@@ -598,7 +597,7 @@
 	}
 	if (de) hpfs_brelse4(&qbh);
 
-	return s;
+	return 0;
 
 bail4:	brelse(bh2);
 bail3:	brelse(bh1);
@@ -607,10 +606,21 @@
 bail0:
 	if (s->s_hpfs_bmp_dir) kfree(s->s_hpfs_bmp_dir);
 	if (s->s_hpfs_cp_table) kfree(s->s_hpfs_cp_table);
-	return NULL;
+	return -EINVAL;
 }
 
-DECLARE_FSTYPE_DEV(hpfs_fs_type, "hpfs", hpfs_read_super);
+static struct super_block *hpfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
+}
+
+static struct file_system_type hpfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"hpfs",
+	get_sb:		hpfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_hpfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/isofs/inode.c linux/fs/isofs/inode.c
--- linux-2.5.4-pre3/fs/isofs/inode.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/isofs/inode.c	Fri Feb  8 17:34:22 2002
@@ -510,8 +510,7 @@
  * Note: a check_disk_change() has been done immediately prior
  * to this call, so we don't need to check again.
  */
-static struct super_block *isofs_read_super(struct super_block *s, void *data,
-					    int silent)
+static int isofs_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct buffer_head	      * bh = NULL, *pri_bh = NULL;
 	struct hs_primary_descriptor  * h_pri = NULL;
@@ -843,16 +842,16 @@
 	if (opt.check == 'r') table++;
 	s->s_root->d_op = &isofs_dentry_ops[table];
 
-	return s;
+	return 0;
 
 	/*
 	 * Display error messages and free resources.
 	 */
 out_bad_root:
-	printk(KERN_WARNING "isofs_read_super: root inode not initialized\n");
+	printk(KERN_WARNING "isofs_fill_super: root inode not initialized\n");
 	goto out_iput;
 out_no_root:
-	printk(KERN_WARNING "isofs_read_super: get root inode failed\n");
+	printk(KERN_WARNING "isofs_fill_super: get root inode failed\n");
 out_iput:
 	iput(inode);
 #ifdef CONFIG_JOLIET
@@ -861,7 +860,7 @@
 #endif
 	goto out_unlock;
 out_no_read:
-	printk(KERN_WARNING "isofs_read_super: "
+	printk(KERN_WARNING "isofs_fill_super: "
 		"bread failed, dev=%s, iso_blknum=%d, block=%d\n",
 		s->s_id, iso_blknum, block);
 	goto out_unlock;
@@ -885,7 +884,7 @@
 out_freebh:
 	brelse(bh);
 out_unlock:
-	return NULL;
+	return -EINVAL;
 }
 
 static int isofs_statfs (struct super_block *sb, struct statfs *buf)
@@ -1395,7 +1394,18 @@
 
 #endif
 
-static DECLARE_FSTYPE_DEV(iso9660_fs_type, "iso9660", isofs_read_super);
+static struct super_block *isofs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
+}
+
+static struct file_system_type iso9660_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"iso9660",
+	get_sb:		isofs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_iso9660_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c
--- linux-2.5.4-pre3/fs/jffs/inode-v23.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/jffs/inode-v23.c	Fri Feb  8 17:34:22 2002
@@ -71,8 +71,7 @@
 kmem_cache_t     *fm_cache = NULL;
 
 /* Called by the VFS at mount time to initialize the whole file system.  */
-static struct super_block *
-jffs_read_super(struct super_block *sb, void *data, int silent)
+static int jffs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	kdev_t dev = sb->s_dev;
 	struct inode *root_inode;
@@ -84,7 +83,7 @@
 	if (major(dev) != MTD_BLOCK_MAJOR) {
 		printk(KERN_WARNING "JFFS: Trying to mount a "
 		       "non-mtd device.\n");
-		return 0;
+		return -EINVAL;
 	}
 
 	sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -145,7 +144,7 @@
 
 	D1(printk(KERN_NOTICE "JFFS: Successfully mounted device %s.\n",
 	       sb->s_id));
-	return sb;
+	return 0;
 
 jffs_sb_err3:
 	iput(root_inode);
@@ -154,7 +153,7 @@
 jffs_sb_err1:
 	printk(KERN_WARNING "JFFS: Failed to mount device %s.\n",
 	       sb->s_id);
-	return 0;
+	return -EINVAL;
 }
 
 
@@ -1730,8 +1729,18 @@
 	statfs:       jffs_statfs,
 };
 
+static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, jffs_fill_super);
+}
 
-static DECLARE_FSTYPE_DEV(jffs_fs_type, "jffs", jffs_read_super);
+static struct file_system_type jffs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"jffs",
+	get_sb:		jffs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init
 init_jffs_fs(void)
diff -urN linux-2.5.4-pre3/fs/jffs2/super.c linux/fs/jffs2/super.c
--- linux-2.5.4-pre3/fs/jffs2/super.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/jffs2/super.c	Fri Feb  8 17:34:22 2002
@@ -195,7 +195,7 @@
 	return 0;
 }
 
-static struct super_block *jffs2_read_super(struct super_block *sb, void *data, int silent)
+static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct jffs2_sb_info *c;
 	struct inode *root_i;
@@ -206,7 +206,7 @@
 	if (major(sb->s_dev) != MTD_BLOCK_MAJOR) {
 		if (!silent)
 			printk(KERN_DEBUG "jffs2: attempt to mount non-MTD device %s\n", kdevname(sb->s_dev));
-		return NULL;
+		return -EINVAL;
 	}
 
 	c = JFFS2_SB_INFO(sb);
@@ -215,7 +215,7 @@
 	c->mtd = get_mtd_device(NULL, minor(sb->s_dev));
 	if (!c->mtd) {
 		D1(printk(KERN_DEBUG "jffs2: MTD device #%u doesn't appear to exist\n", MINOR(sb->s_dev)));
-		return NULL;
+		return -EINVAL;
 	}
 	c->sector_size = c->mtd->erasesize;
 	c->free_size = c->flash_size = c->mtd->size;
@@ -275,7 +275,7 @@
 	sb->s_magic = JFFS2_SUPER_MAGIC;
 	if (!(sb->s_flags & MS_RDONLY))
 		jffs2_start_garbage_collect_thread(c);
-	return sb;
+	return 0;
 
  out_root_i:
 	iput(root_i);
@@ -285,7 +285,7 @@
 	kfree(c->blocks);
  out_mtd:
 	put_mtd_device(c->mtd);
-	return NULL;
+	return -EINVAL;
 }
 
 void jffs2_put_super (struct super_block *sb)
@@ -340,8 +340,18 @@
 	jffs2_mark_erased_blocks(c);
 }
 
+static struct super_block *jffs2_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, jffs2_fill_super);
+}
 
-static DECLARE_FSTYPE_DEV(jffs2_fs_type, "jffs2", jffs2_read_super);
+static struct file_system_type jffs2_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"jffs2",
+	get_sb:		jffs2_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_jffs2_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/msdos/msdosfs_syms.c linux/fs/msdos/msdosfs_syms.c
--- linux-2.5.4-pre3/fs/msdos/msdosfs_syms.c	Wed Jan 16 10:20:23 2002
+++ linux/fs/msdos/msdosfs_syms.c	Fri Feb  8 17:34:22 2002
@@ -25,7 +25,18 @@
 EXPORT_SYMBOL(msdos_unlink);
 EXPORT_SYMBOL(msdos_put_super);
 
-static DECLARE_FSTYPE_DEV(msdos_fs_type, "msdos", msdos_read_super);
+static struct super_block *msdos_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super);
+}
+
+static struct file_system_type msdos_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"msdos",
+	get_sb:		msdos_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_msdos_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/msdos/namei.c linux/fs/msdos/namei.c
--- linux-2.5.4-pre3/fs/msdos/namei.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/msdos/namei.c	Fri Feb  8 17:34:22 2002
@@ -579,21 +579,21 @@
 	setattr:	fat_notify_change,
 };
 
-struct super_block *msdos_read_super(struct super_block *sb,void *data, int silent)
+int msdos_fill_super(struct super_block *sb,void *data, int silent)
 {
 	struct super_block *res;
 
 	MSDOS_SB(sb)->options.isvfat = 0;
 	res = fat_read_super(sb, data, silent, &msdos_dir_inode_operations);
 	if (IS_ERR(res))
-		return NULL;
+		return PTR_ERR(res);
 	if (res == NULL) {
 		if (!silent)
 			printk(KERN_INFO "VFS: Can't find a valid"
 			       " MSDOS filesystem on dev %s.\n", sb->s_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	sb->s_root->d_op = &msdos_dentry_operations;
-	return res;
+	return 0;
 }
diff -urN linux-2.5.4-pre3/fs/nfs/nfsroot.c linux/fs/nfs/nfsroot.c
--- linux-2.5.4-pre3/fs/nfs/nfsroot.c	Fri Jan  4 09:37:49 2002
+++ linux/fs/nfs/nfsroot.c	Fri Feb  8 17:34:22 2002
@@ -453,7 +453,7 @@
 
 /*
  *  Get the NFS port numbers and file handle, and return the prepared 'data'
- *  argument for ->read_super() if everything went OK. Return NULL otherwise.
+ *  argument for mount() if everything went OK. Return NULL otherwise.
  */
 void * __init nfs_root_data(void)
 {
diff -urN linux-2.5.4-pre3/fs/nfsd/export.c linux/fs/nfsd/export.c
--- linux-2.5.4-pre3/fs/nfsd/export.c	Fri Feb  8 17:34:19 2002
+++ linux/fs/nfsd/export.c	Fri Feb  8 17:34:22 2002
@@ -32,10 +32,9 @@
 typedef struct svc_client	svc_client;
 typedef struct svc_export	svc_export;
 
-static svc_export *	exp_find(svc_client *clp, kdev_t dev);
-static svc_export *	exp_parent(svc_client *clp, kdev_t dev,
+static svc_export *	exp_parent(svc_client *clp, struct super_block *sb,
 					struct dentry *dentry);
-static svc_export *	exp_child(svc_client *clp, kdev_t dev,
+static svc_export *	exp_child(svc_client *clp, struct super_block *sb,
 					struct dentry *dentry);
 static void		exp_unexport_all(svc_client *clp);
 static void		exp_do_unexport(svc_export *unexp);
@@ -66,40 +65,37 @@
 static int			hash_count;
 static DECLARE_WAIT_QUEUE_HEAD(	hash_wait );
 
-
 /*
- * Find a client's export for a device.
+ * Find the client's export entry matching xdev/xino.
  */
-static inline svc_export *
-exp_find(svc_client *clp, kdev_t dev)
+svc_export *
+exp_get(svc_client *clp, kdev_t dev, ino_t ino)
 {
 	svc_export *	exp;
 
-	exp = clp->cl_export[EXPORT_HASH(dev)];
-	while (exp && !kdev_same(exp->ex_dev, dev))
-		exp = exp->ex_next;
+	if (!clp)
+		return NULL;
+
+	for (exp = clp->cl_export[EXPORT_HASH(dev)]; exp; exp = exp->ex_next) {
+		if (exp->ex_ino == ino && kdev_same(exp->ex_dev, dev))
+			break;
+	}
 	return exp;
 }
 
-/*
- * Find the client's export entry matching xdev/xino.
- */
 svc_export *
-exp_get(svc_client *clp, kdev_t dev, ino_t ino)
+exp_get_by_name(svc_client *clp, struct vfsmount *mnt, struct dentry *dentry)
 {
-	svc_export *	exp;
+	int hash = EXPORT_HASH(mnt->mnt_sb->s_dev);
+	svc_export *exp;
 
 	if (!clp)
 		return NULL;
 
-	exp = clp->cl_export[EXPORT_HASH(dev)];
-	if (exp)
-		do {
-			if (exp->ex_ino == ino && kdev_same(exp->ex_dev, dev))
-				goto out;
-		} while (NULL != (exp = exp->ex_next));
-	exp = NULL;
-out:
+	for (exp = clp->cl_export[hash]; exp; exp = exp->ex_next) {
+		if (exp->ex_dentry == dentry && exp->ex_mnt == mnt)
+			break;
+	}
 	return exp;
 }
 
@@ -107,14 +103,14 @@
  * Find the export entry for a given dentry.  <gam3@acm.org>
  */
 static svc_export *
-exp_parent(svc_client *clp, kdev_t dev, struct dentry *dentry)
+exp_parent(svc_client *clp, struct super_block *sb, struct dentry *dentry)
 {
 	svc_export      *exp;
 
 	if (clp == NULL)
 		return NULL;
 
-	for (exp = clp->cl_export[EXPORT_HASH(dev)]; exp; exp = exp->ex_next)
+	for (exp = clp->cl_export[EXPORT_HASH(sb->s_dev)]; exp; exp = exp->ex_next)
 		if (is_subdir(dentry, exp->ex_dentry))
 			break;
 	return exp;
@@ -126,14 +122,14 @@
  * <gam3@acm.org>
  */
 static svc_export *
-exp_child(svc_client *clp, kdev_t dev, struct dentry *dentry)
+exp_child(svc_client *clp, struct super_block *sb, struct dentry *dentry)
 {
 	svc_export      *exp;
 
 	if (clp == NULL)
 		return NULL;
 
-	for (exp = clp->cl_export[EXPORT_HASH(dev)]; exp; exp = exp->ex_next) {
+	for (exp = clp->cl_export[EXPORT_HASH(sb->s_dev)]; exp; exp = exp->ex_next) {
 		struct dentry	*ndentry = exp->ex_dentry;
 		if (ndentry && is_subdir(ndentry->d_parent, dentry))
 			break;
@@ -221,12 +217,12 @@
 		goto finish;
 	}
 
-	if ((parent = exp_child(clp, dev, nd.dentry)) != NULL) {
+	if ((parent = exp_child(clp, inode->i_sb, nd.dentry)) != NULL) {
 		dprintk("exp_export: export not valid (Rule 3).\n");
 		goto finish;
 	}
 	/* Is this is a sub-export, must be a proper subset of FS */
-	if ((parent = exp_parent(clp, dev, nd.dentry)) != NULL) {
+	if ((parent = exp_parent(clp, inode->i_sb, nd.dentry)) != NULL) {
 		dprintk("exp_export: sub-export not valid (Rule 2).\n");
 		goto finish;
 	}
@@ -380,53 +376,32 @@
  * since its harder to fool a kernel module than a user space program.
  */
 int
-exp_rootfh(struct svc_client *clp, kdev_t dev, ino_t ino,
-	   char *path, struct knfsd_fh *f, int maxsize)
+exp_rootfh(struct svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
 {
 	struct svc_export	*exp;
 	struct nameidata	nd;
 	struct inode		*inode;
 	struct svc_fh		fh;
+	kdev_t			dev;
 	int			err;
 
 	err = -EPERM;
-	if (path) {
-		if (path_init(path, LOOKUP_POSITIVE, &nd) &&
-		    path_walk(path, &nd)) {
-			printk("nfsd: exp_rootfh path not found %s", path);
-			return err;
-		}
-		dev = nd.dentry->d_inode->i_dev;
-		ino = nd.dentry->d_inode->i_ino;
-	
-		dprintk("nfsd: exp_rootfh(%s [%p] %s:%02x:%02x/%ld)\n",
-		         path, nd.dentry, clp->cl_ident,
-		         major(dev), minor(dev), (long) ino);
-		exp = exp_parent(clp, dev, nd.dentry);
-	} else {
-		dprintk("nfsd: exp_rootfh(%s:%02x:%02x/%ld)\n",
-		         clp->cl_ident, major(dev), minor(dev), (long) ino);
-		if ((exp = exp_get(clp, dev, ino))) {
-			nd.mnt = mntget(exp->ex_mnt);
-			nd.dentry = dget(exp->ex_dentry);
-		}
+	/* NB: we probably ought to check that it's NUL-terminated */
+	if (path_init(path, LOOKUP_POSITIVE, &nd) &&
+	    path_walk(path, &nd)) {
+		printk("nfsd: exp_rootfh path not found %s", path);
+		return err;
 	}
+	inode = nd.dentry->d_inode;
+	dev = inode->i_dev;
+
+	dprintk("nfsd: exp_rootfh(%s [%p] %s:%02x:%02x/%ld)\n",
+		 path, nd.dentry, clp->cl_ident,
+		 major(dev), minor(dev), (long) inode->i_ino);
+	exp = exp_parent(clp, inode->i_sb, nd.dentry);
 	if (!exp) {
 		dprintk("nfsd: exp_rootfh export not found.\n");
 		goto out;
-	}
-
-	inode = nd.dentry->d_inode;
-	if (!inode) {
-		printk("exp_rootfh: Aieee, NULL d_inode\n");
-		goto out;
-	}
-	if (!kdev_same(inode->i_dev, dev) || inode->i_ino != ino) {
-		printk("exp_rootfh: Aieee, ino/dev mismatch\n");
-		printk("exp_rootfh: arg[dev(%02x:%02x):ino(%ld)]"
-		       " inode[dev(%02x:%02x):ino(%ld)]\n",
-		       major(dev), minor(dev), (long) ino,
-		       major(inode->i_dev), minor(inode->i_dev), (long) inode->i_ino);
 	}
 
 	/*
diff -urN linux-2.5.4-pre3/fs/nfsd/nfsctl.c linux/fs/nfsd/nfsctl.c
--- linux-2.5.4-pre3/fs/nfsd/nfsctl.c	Tue Jan  1 12:21:20 2002
+++ linux/fs/nfsd/nfsctl.c	Fri Feb  8 17:34:22 2002
@@ -37,7 +37,6 @@
 static int	nfsctl_delclient(struct nfsctl_client *data);
 static int	nfsctl_export(struct nfsctl_export *data);
 static int	nfsctl_unexport(struct nfsctl_export *data);
-static int	nfsctl_getfh(struct nfsctl_fhparm *, __u8 *);
 static int	nfsctl_getfd(struct nfsctl_fdparm *, __u8 *);
 static int	nfsctl_getfs(struct nfsctl_fsparm *, struct knfsd_fh *);
 #ifdef notyet
@@ -125,7 +124,7 @@
 	if (!(clp = exp_getclient(sin)))
 		err = -EPERM;
 	else
-		err = exp_rootfh(clp, NODEV, 0, data->gd_path, res, data->gd_maxlen);
+		err = exp_rootfh(clp, data->gd_path, res, data->gd_maxlen);
 	exp_unlock();
 	return err;
 }
@@ -148,40 +147,7 @@
 	if (!(clp = exp_getclient(sin)))
 		err = -EPERM;
 	else
-		err = exp_rootfh(clp, NODEV, 0, data->gd_path, &fh, NFS_FHSIZE);
-	exp_unlock();
-
-	if (err == 0) {
-		if (fh.fh_size > NFS_FHSIZE)
-			err = -EINVAL;
-		else {
-			memset(res,0, NFS_FHSIZE);
-			memcpy(res, &fh.fh_base, fh.fh_size);
-		}
-	}
-
-	return err;
-}
-
-static inline int
-nfsctl_getfh(struct nfsctl_fhparm *data, __u8 *res)
-{
-	struct sockaddr_in	*sin;
-	struct svc_client	*clp;
-	int			err = 0;
-	struct knfsd_fh		fh;
-
-	if (data->gf_addr.sa_family != AF_INET)
-		return -EPROTONOSUPPORT;
-	if (data->gf_version < 2 || data->gf_version > NFSSVC_MAXVERS)
-		return -EINVAL;
-	sin = (struct sockaddr_in *)&data->gf_addr;
-
-	exp_readlock();
-	if (!(clp = exp_getclient(sin)))
-		err = -EPERM;
-	else
-		err = exp_rootfh(clp, to_kdev_t(data->gf_dev), data->gf_ino, NULL, &fh, NFS_FHSIZE);
+		err = exp_rootfh(clp, data->gd_path, &fh, NFS_FHSIZE);
 	exp_unlock();
 
 	if (err == 0) {
@@ -277,9 +243,6 @@
 		err = nfsctl_ugidupdate(&arg->ca_umap);
 		break;
 #endif
-	case NFSCTL_GETFH:
-		err = nfsctl_getfh(&arg->ca_getfh, res->cr_getfh);
-		break;
 	case NFSCTL_GETFD:
 		err = nfsctl_getfd(&arg->ca_getfd, res->cr_getfh);
 		break;
diff -urN linux-2.5.4-pre3/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c
--- linux-2.5.4-pre3/fs/nfsd/vfs.c	Tue Jan 15 10:52:11 2002
+++ linux/fs/nfsd/vfs.c	Fri Feb  8 17:34:22 2002
@@ -114,35 +114,30 @@
 	if (isdotent(name, len)) {
 		if (len==1)
 			dentry = dget(dparent);
-		else  { /* must be ".." */
+		else if (dparent != exp->ex_dentry)
+			dentry = dget(dparent->d_parent);
+		else  if (!EX_CROSSMNT(exp))
+			dentry = dget(dparent); /* .. == . just like at / */
+		else {
 			/* checking mountpoint crossing is very different when stepping up */
-			if (dparent == exp->ex_dentry) {
-				if (!EX_CROSSMNT(exp))
-					dentry = dget(dparent); /* .. == . just like at / */
-				else
-				{
-					struct svc_export *exp2 = NULL;
-					struct dentry *dp;
-					struct vfsmount *mnt = mntget(exp->ex_mnt);
-					dentry = dget(dparent);
-					while(follow_up(&mnt, &dentry))
-						;
-					dp = dget(dentry->d_parent);
-					dput(dentry);
-					dentry = dp;
-					for ( ; exp2 == NULL && dp->d_parent != dp;
-					      dp=dp->d_parent)
-						exp2 = exp_get(exp->ex_client, dp->d_inode->i_dev, dp->d_inode->i_ino);
-					if (exp2==NULL) {
-						dput(dentry);
-						dentry = dget(dparent);
-					} else {
-						exp = exp2;
-					}
-					mntput(mnt);
-				}
-			} else
-				dentry = dget(dparent->d_parent);
+			struct svc_export *exp2 = NULL;
+			struct dentry *dp;
+			struct vfsmount *mnt = mntget(exp->ex_mnt);
+			dentry = dget(dparent);
+			while(follow_up(&mnt, &dentry))
+				;
+			dp = dget(dentry->d_parent);
+			dput(dentry);
+			dentry = dp;
+			for ( ; !exp2 && dp->d_parent != dp; dp=dp->d_parent)
+				exp2 = exp_get_by_name(exp->ex_client, mnt, dp);
+			if (!exp2) {
+				dput(dentry);
+				dentry = dget(dparent);
+			} else {
+				exp = exp2;
+			}
+			mntput(mnt);
 		}
 	} else {
 		fh_lock(fhp);
@@ -159,9 +154,7 @@
 			struct dentry *mounts = dget(dentry);
 			while (follow_down(&mnt,&mounts)&&d_mountpoint(mounts))
 				;
-			exp2 = exp_get(rqstp->rq_client,
-				       mounts->d_inode->i_dev,
-				       mounts->d_inode->i_ino);
+			exp2 = exp_get_by_name(rqstp->rq_client, mnt, mounts);
 			if (exp2 && EX_CROSSMNT(exp2)) {
 				/* successfully crossed mount point */
 				exp = exp2;
@@ -591,6 +584,7 @@
 	mm_segment_t	oldfs;
 	int		err;
 	struct file	file;
+	struct inode	*inode;
 
 	err = nfsd_open(rqstp, fhp, S_IFREG, MAY_READ, &file);
 	if (err)
@@ -598,14 +592,15 @@
 	err = nfserr_perm;
 	if (!file.f_op->read)
 		goto out_close;
+	inode = file.f_dentry->d_inode;
 #ifdef MSNFS
 	if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
-		(!lock_may_read(file.f_dentry->d_inode, offset, *count)))
+		(!lock_may_read(inode, offset, *count)))
 		goto out_close;
 #endif
 
 	/* Get readahead parameters */
-	ra = nfsd_get_raparms(fhp->fh_export->ex_dev, fhp->fh_dentry->d_inode->i_ino);
+	ra = nfsd_get_raparms(inode->i_dev, inode->i_ino);
 	if (ra) {
 		file.f_reada = ra->p_reada;
 		file.f_ramax = ra->p_ramax;
diff -urN linux-2.5.4-pre3/fs/ntfs/fs.c linux/fs/ntfs/fs.c
--- linux-2.5.4-pre3/fs/ntfs/fs.c	Fri Feb  8 17:34:19 2002
+++ linux/fs/ntfs/fs.c	Fri Feb  8 17:34:22 2002
@@ -1050,8 +1050,7 @@
  *
  * NOTE : A context switch can happen in kernel code only if the code blocks
  * (= calls schedule() in kernel/sched.c). */
-struct super_block *ntfs_read_super(struct super_block *sb, void *options,
-		int silent)
+static int ntfs_fill_super(struct super_block *sb, void *options, int silent)
 {
 	ntfs_volume *vol;
 	struct buffer_head *bh;
@@ -1142,19 +1141,28 @@
 		ntfs_error("Could not get root dir inode\n");
 		goto ntfs_read_super_mft;
 	}
-ntfs_read_super_ret:
-	ntfs_debug(DEBUG_OTHER, "read_super: done\n");
-	return sb;
+	return 0;
 ntfs_read_super_mft:
 	ntfs_free(vol->mft);
 ntfs_read_super_unl:
 ntfs_read_super_vol:
-	sb = NULL;
-	goto ntfs_read_super_ret;
+	ntfs_debug(DEBUG_OTHER, "read_super: done\n");
+	return -EINVAL;
 }
 
 /* Define the filesystem */
-static DECLARE_FSTYPE_DEV(ntfs_fs_type, "ntfs", ntfs_read_super);
+static struct super_block *ntfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, ntfs_fill_super);
+}
+
+static struct file_system_type ntfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"ntfs",
+	get_sb:		ntfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_ntfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/proc/base.c linux/fs/proc/base.c
--- linux-2.5.4-pre3/fs/proc/base.c	Fri Feb  8 17:34:19 2002
+++ linux/fs/proc/base.c	Fri Feb  8 17:34:22 2002
@@ -1003,8 +1003,7 @@
 		ei = PROC_I(inode);
 		inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
 		inode->i_ino = fake_ino(0, PROC_PID_INO);
-		ei->file = NULL;
-		ei->task = NULL;
+		ei->pde = NULL;
 		inode->i_mode = S_IFLNK|S_IRWXUGO;
 		inode->i_uid = inode->i_gid = 0;
 		inode->i_size = 64;
diff -urN linux-2.5.4-pre3/fs/qnx4/inode.c linux/fs/qnx4/inode.c
--- linux-2.5.4-pre3/fs/qnx4/inode.c	Mon Jan 21 15:37:32 2002
+++ linux/fs/qnx4/inode.c	Fri Feb  8 17:34:22 2002
@@ -119,7 +119,6 @@
 
 #endif
 
-static struct super_block *qnx4_read_super(struct super_block *, void *, int);
 static void qnx4_put_super(struct super_block *sb);
 static struct inode *qnx4_alloc_inode(struct super_block *sb);
 static void qnx4_destroy_inode(struct inode *inode);
@@ -337,8 +336,7 @@
 	return NULL;
 }
 
-static struct super_block *qnx4_read_super(struct super_block *s,
-					   void *data, int silent)
+static int qnx4_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct buffer_head *bh;
 	struct inode *root;
@@ -396,7 +394,7 @@
 
 	brelse(bh);
 
-	return s;
+	return 0;
 
       outi:
 	iput(root);
@@ -404,7 +402,7 @@
 	brelse(bh);
       outnobh:
 
-	return NULL;
+	return -EINVAL;
 }
 
 static void qnx4_put_super(struct super_block *sb)
@@ -541,7 +539,18 @@
 		       "qnx4_inode_cache: not all structures were freed\n");
 }
 
-static DECLARE_FSTYPE_DEV(qnx4_fs_type, "qnx4", qnx4_read_super);
+static struct super_block *qnx4_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, qnx4_fill_super);
+}
+
+static struct file_system_type qnx4_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"qnx4",
+	get_sb:		qnx4_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_qnx4_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/reiserfs/super.c linux/fs/reiserfs/super.c
--- linux-2.5.4-pre3/fs/reiserfs/super.c	Fri Feb  8 17:34:20 2002
+++ linux/fs/reiserfs/super.c	Fri Feb  8 17:34:22 2002
@@ -965,7 +965,7 @@
 // at the ext2 code and comparing. It's subfunctions contain no code
 // used as a template unless they are so labeled.
 //
-static struct super_block * reiserfs_read_super (struct super_block * s, void * data, int silent)
+static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 {
     int size;
     struct inode *root_inode;
@@ -981,12 +981,12 @@
     memset (&s->u.reiserfs_sb, 0, sizeof (struct reiserfs_sb_info));
     jdev_name = NULL;
     if (parse_options ((char *) data, &(s->u.reiserfs_sb.s_mount_opt), &blocks, &jdev_name) == 0) {
-	return NULL;
+	return -EINVAL;
     }
 
     if (blocks) {
   	printk("reserfs: resize option for remount only\n");
-	return NULL;
+	return -EINVAL;
     }	
 
     size = block_size(s->s_dev);
@@ -997,14 +997,14 @@
       old_format = 1;
     /* try new format (64-th 1k block), which can contain reiserfs super block */
     else if (read_super_block (s, REISERFS_DISK_OFFSET_IN_BYTES)) {
-      printk("sh-2021: reiserfs_read_super: can not find reiserfs on %s\n", s->s_id);
+      printk("sh-2021: reiserfs_fill_super: can not find reiserfs on %s\n", s->s_id);
       goto error;    
     }
     s->u.reiserfs_sb.s_mount_state = SB_REISERFS_STATE(s);
     s->u.reiserfs_sb.s_mount_state = REISERFS_VALID_FS ;
 
     if (old_format ? read_old_bitmaps(s) : read_bitmaps(s)) { 
-	printk ("reiserfs_read_super: unable to read bitmap\n");
+	printk ("reiserfs_fill_super: unable to read bitmap\n");
 	goto error;
     }
 #ifdef CONFIG_REISERFS_CHECK
@@ -1014,7 +1014,7 @@
 
     // set_device_ro(s->s_dev, 1) ;
     if( journal_init(s, jdev_name, old_format) ) {
-	printk("sh-2022: reiserfs_read_super: unable to initialize journal space\n") ;
+	printk("sh-2022: reiserfs_fill_super: unable to initialize journal space\n") ;
 	goto error ;
     } else {
 	jinit_done = 1 ; /* once this is set, journal_release must be called
@@ -1022,7 +1022,7 @@
 			 */
     }
     if (reread_meta_blocks(s)) {
-	printk("reiserfs_read_super: unable to reread meta blocks after journal init\n") ;
+	printk("reiserfs_fill_super: unable to reread meta blocks after journal init\n") ;
 	goto error ;
     }
 
@@ -1036,7 +1036,7 @@
     args.objectid = REISERFS_ROOT_PARENT_OBJECTID ;
     root_inode = iget4 (s, REISERFS_ROOT_OBJECTID, 0, (void *)(&args));
     if (!root_inode) {
-	printk ("reiserfs_read_super: get root inode failed\n");
+	printk ("reiserfs_fill_super: get root inode failed\n");
 	goto error;
     }
 
@@ -1115,7 +1115,7 @@
     reiserfs_proc_register( s, "journal", reiserfs_journal_in_proc );
     init_waitqueue_head (&(s->u.reiserfs_sb.s_wait));
 
-    return s;
+    return 0;
 
  error:
     if (jinit_done) { /* kill the commit thread, free journal ram */
@@ -1132,7 +1132,7 @@
     if (SB_BUFFER_WITH_SB (s))
 	brelse(SB_BUFFER_WITH_SB (s));
 
-    return NULL;
+    return -EINVAL;
 }
 
 
@@ -1159,7 +1159,18 @@
   return 0;
 }
 
-static DECLARE_FSTYPE_DEV(reiserfs_fs_type,"reiserfs",reiserfs_read_super);
+static struct super_block *reiserfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super);
+}
+
+static struct file_system_type reiserfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"reiserfs",
+	get_sb:		reiserfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 //
 // this is exactly what 2.3.99-pre9's init_ext2_fs is
diff -urN linux-2.5.4-pre3/fs/romfs/inode.c linux/fs/romfs/inode.c
--- linux-2.5.4-pre3/fs/romfs/inode.c	Fri Jan  4 09:42:12 2002
+++ linux/fs/romfs/inode.c	Fri Feb  8 17:34:22 2002
@@ -92,8 +92,7 @@
 
 static struct super_operations romfs_ops;
 
-static struct super_block *
-romfs_read_super(struct super_block *s, void *data, int silent)
+static int romfs_fill_super(struct super_block *s, void *data, int silent)
 {
 	struct buffer_head *bh;
 	struct romfs_super_block *rsb;
@@ -150,10 +149,10 @@
 out:
 		brelse(bh);
 outnobh:
-		s = NULL;
+		return -EINVAL;
 	}
 
-	return s;
+	return 0;
 }
 
 /* That's simple too. */
@@ -529,7 +528,18 @@
 	statfs:		romfs_statfs,
 };
 
-static DECLARE_FSTYPE_DEV(romfs_fs_type, "romfs", romfs_read_super);
+static struct super_block *romfs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, romfs_fill_super);
+}
+
+static struct file_system_type romfs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"romfs",
+	get_sb:		romfs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_romfs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/super.c linux/fs/super.c
--- linux-2.5.4-pre3/fs/super.c	Fri Feb  8 17:34:20 2002
+++ linux/fs/super.c	Fri Feb  8 17:34:22 2002
@@ -597,11 +597,8 @@
  *
  *	Rather than duplicating all that logics every time when
  *	we want something that doesn't fit "nodev" and "single" we pull
- *	the relevant code into common helper and let get_sb_...() call
+ *	the relevant code into common helper and let ->get_sb() call
  *	it.
- *
- *	NB: get_sb_...() is going to become an fs type method, with
- *	current ->read_super() becoming a callback used by common instances.
  */
 struct super_block *get_anon_super(struct file_system_type *type,
 	int (*compare)(struct super_block *,void *), void *data)
@@ -787,17 +784,6 @@
 	return s;
 }
 
-/* Will go away */
-static int fill_super(struct super_block *sb, void *data, int verbose)
-{
-	return sb->s_type->read_super(sb, data, verbose) ? 0 : -EINVAL;
-}
-static struct super_block *__get_sb_bdev(struct file_system_type *fs_type,
-	int flags, char *dev_name, void * data)
-{
-	return get_sb_bdev(fs_type, flags, dev_name, data, fill_super);
-}
-
 struct vfsmount *
 do_kern_mount(const char *fstype, int flags, char *name, void *data)
 {
@@ -811,10 +797,7 @@
 	mnt = alloc_vfsmnt(name);
 	if (!mnt)
 		goto out;
-	if (type->get_sb)
-		sb = type->get_sb(type, flags, name, data);
-	else if (type->fs_flags & FS_REQUIRES_DEV)
-		sb = __get_sb_bdev(type, flags, name, data);
+	sb = type->get_sb(type, flags, name, data);
 	if (IS_ERR(sb))
 		goto out_mnt;
 	if (type->fs_flags & FS_NOMOUNT)
diff -urN linux-2.5.4-pre3/fs/udf/super.c linux/fs/udf/super.c
--- linux-2.5.4-pre3/fs/udf/super.c	Fri Feb  8 17:34:20 2002
+++ linux/fs/udf/super.c	Fri Feb  8 17:34:22 2002
@@ -76,7 +76,7 @@
 static char error_buf[1024];
 
 /* These are the "meat" - everything else is stuffing */
-static struct super_block *udf_read_super(struct super_block *, void *, int);
+static int udf_fill_super(struct super_block *, void *, int);
 static void udf_put_super(struct super_block *);
 static void udf_write_super(struct super_block *);
 static int udf_remount_fs(struct super_block *, int *, char *);
@@ -96,7 +96,18 @@
 static int udf_statfs(struct super_block *, struct statfs *);
 
 /* UDF filesystem type */
-static DECLARE_FSTYPE_DEV(udf_fstype, "udf", udf_read_super);
+static struct super_block *udf_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, udf_fill_super);
+}
+
+static struct file_system_type udf_fstype = {
+	owner:		THIS_MODULE,
+	name:		"udf",
+	get_sb:		udf_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static kmem_cache_t * udf_inode_cachep;
 
@@ -1387,8 +1398,7 @@
  *	July 1, 1997 - Andrew E. Mileski
  *	Written, tested, and released.
  */
-static struct super_block *
-udf_read_super(struct super_block *sb, void *options, int silent)
+static int udf_fill_super(struct super_block *sb, void *options, int silent)
 {
 	int i;
 	struct inode *inode=NULL;
@@ -1545,7 +1555,7 @@
 		goto error_out;
 	}
 	sb->s_maxbytes = MAX_LFS_FILESIZE;
-	return sb;
+	return 0;
 
 error_out:
 	if (UDF_SB_VAT(sb))
@@ -1588,7 +1598,7 @@
 		udf_close_lvid(sb);
 	udf_release_data(UDF_SB_LVIDBH(sb));
 	UDF_SB_FREE(sb);
-	return NULL;
+	return -EINVAL;
 }
 
 void udf_error(struct super_block *sb, const char *function,
diff -urN linux-2.5.4-pre3/fs/ufs/super.c linux/fs/ufs/super.c
--- linux-2.5.4-pre3/fs/ufs/super.c	Mon Jan 28 13:29:48 2002
+++ linux/fs/ufs/super.c	Fri Feb  8 17:34:22 2002
@@ -434,8 +434,7 @@
 	UFSD(("EXIT\n"))
 }
 
-struct super_block * ufs_read_super (struct super_block * sb, void * data,
-	int silent)
+static int ufs_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct ufs_sb_private_info * uspi;
 	struct ufs_super_block_first * usb1;
@@ -807,7 +806,7 @@
 			goto failed;
 
 	UFSD(("EXIT\n"))
-	return(sb);
+	return 0;
 
 dalloc_failed:
 	iput(inode);
@@ -815,7 +814,7 @@
 	if (ubh) ubh_brelse_uspi (uspi);
 	if (uspi) kfree (uspi);
 	UFSD(("EXIT (FAILED)\n"))
-	return(NULL);
+	return -EINVAL;
 }
 
 void ufs_write_super (struct super_block * sb) {
@@ -1009,7 +1008,18 @@
 	remount_fs:	ufs_remount,
 };
 
-static DECLARE_FSTYPE_DEV(ufs_fs_type, "ufs", ufs_read_super);
+static struct super_block *ufs_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, ufs_fill_super);
+}
+
+static struct file_system_type ufs_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"ufs",
+	get_sb:		ufs_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 static int __init init_ufs_fs(void)
 {
diff -urN linux-2.5.4-pre3/fs/vfat/namei.c linux/fs/vfat/namei.c
--- linux-2.5.4-pre3/fs/vfat/namei.c	Mon Jan 28 13:20:44 2002
+++ linux/fs/vfat/namei.c	Fri Feb  8 17:34:22 2002
@@ -1254,20 +1254,19 @@
 	setattr:	fat_notify_change,
 };
 
-struct super_block *vfat_read_super(struct super_block *sb,void *data,
-				    int silent)
+int vfat_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct super_block *res;
   
 	MSDOS_SB(sb)->options.isvfat = 1;
 	res = fat_read_super(sb, data, silent, &vfat_dir_inode_operations);
 	if (IS_ERR(res))
-		return NULL;
+		return PTR_ERR(res);
 	if (res == NULL) {
 		if (!silent)
 			printk(KERN_INFO "VFS: Can't find a valid"
 			       " VFAT filesystem on dev %s.\n", sb->s_id);
-		return NULL;
+		return -EINVAL;
 	}
 
 	if (parse_options((char *) data, &(MSDOS_SB(sb)->options))) {
@@ -1281,6 +1280,5 @@
 			sb->s_root->d_op = &vfat_dentry_ops[2];
 		}
 	}
-
-	return res;
+	return 0;
 }
diff -urN linux-2.5.4-pre3/fs/vfat/vfatfs_syms.c linux/fs/vfat/vfatfs_syms.c
--- linux-2.5.4-pre3/fs/vfat/vfatfs_syms.c	Sun Dec 30 16:59:00 2001
+++ linux/fs/vfat/vfatfs_syms.c	Fri Feb  8 17:34:22 2002
@@ -11,14 +11,24 @@
 #include <linux/mm.h>
 #include <linux/msdos_fs.h>
 
-DECLARE_FSTYPE_DEV(vfat_fs_type, "vfat", vfat_read_super);
+static struct super_block *vfat_get_sb(struct file_system_type *fs_type,
+	int flags, char *dev_name, void *data)
+{
+	return get_sb_bdev(fs_type, flags, dev_name, data, vfat_fill_super);
+}
+
+static struct file_system_type vfat_fs_type = {
+	owner:		THIS_MODULE,
+	name:		"vfat",
+	get_sb:		vfat_get_sb,
+	fs_flags:	FS_REQUIRES_DEV,
+};
 
 EXPORT_SYMBOL(vfat_create);
 EXPORT_SYMBOL(vfat_unlink);
 EXPORT_SYMBOL(vfat_mkdir);
 EXPORT_SYMBOL(vfat_rmdir);
 EXPORT_SYMBOL(vfat_rename);
-EXPORT_SYMBOL(vfat_read_super);
 EXPORT_SYMBOL(vfat_lookup);
 
 static int __init init_vfat_fs(void)
diff -urN linux-2.5.4-pre3/include/asm-i386/i387.h linux/include/asm-i386/i387.h
--- linux-2.5.4-pre3/include/asm-i386/i387.h	Fri Feb  8 17:34:20 2002
+++ linux/include/asm-i386/i387.h	Fri Feb  8 17:34:22 2002
@@ -28,17 +28,17 @@
 
 
 #define unlazy_fpu( tsk ) do { \
-	if (test_thread_flag(TIF_USEDFPU)) \
+	if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) \
 		save_init_fpu( tsk ); \
 } while (0)
 
-#define clear_fpu( tsk )			\
-do {						\
-	if (test_thread_flag(TIF_USEDFPU)) {	\
-		asm volatile("fwait");		\
-		clear_thread_flag(TIF_USEDFPU);	\
-		stts();				\
-	}					\
+#define clear_fpu( tsk )					\
+do {								\
+	if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {		\
+		asm volatile("fwait");				\
+		clear_tsk_thread_flag(tsk, TIF_USEDFPU);	\
+		stts();						\
+	}							\
 } while (0)
 
 /*
diff -urN linux-2.5.4-pre3/include/asm-i386/thread_info.h linux/include/asm-i386/thread_info.h
--- linux-2.5.4-pre3/include/asm-i386/thread_info.h	Fri Feb  8 17:34:20 2002
+++ linux/include/asm-i386/thread_info.h	Fri Feb  8 17:34:22 2002
@@ -73,8 +73,8 @@
 #define THREAD_SIZE (2*PAGE_SIZE)
 #define alloc_thread_info() ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
 #define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
-#define get_thread_info(ti) get_task_struct((ti)->l_task)
-#define put_thread_info(ti) put_task_struct((ti)->l_task)
+#define get_thread_info(ti) get_task_struct((ti)->task)
+#define put_thread_info(ti) put_task_struct((ti)->task)
 
 #else /* !__ASSEMBLY__ */
 
diff -urN linux-2.5.4-pre3/include/linux/efs_fs.h linux/include/linux/efs_fs.h
--- linux-2.5.4-pre3/include/linux/efs_fs.h	Mon Jan 21 15:37:32 2002
+++ linux/include/linux/efs_fs.h	Fri Feb  8 17:34:22 2002
@@ -47,7 +47,7 @@
 extern struct file_operations efs_dir_operations;
 extern struct address_space_operations efs_symlink_aops;
 
-extern struct super_block *efs_read_super(struct super_block *, void *, int);
+extern int efs_fill_super(struct super_block *, void *, int);
 extern int efs_statfs(struct super_block *, struct statfs *);
 
 extern void efs_read_inode(struct inode *);
diff -urN linux-2.5.4-pre3/include/linux/ext3_fs.h linux/include/linux/ext3_fs.h
--- linux-2.5.4-pre3/include/linux/ext3_fs.h	Mon Jan 21 15:37:32 2002
+++ linux/include/linux/ext3_fs.h	Fri Feb  8 17:34:22 2002
@@ -671,7 +671,6 @@
 extern void ext3_write_super_lockfs (struct super_block *);
 extern void ext3_unlockfs (struct super_block *);
 extern int ext3_remount (struct super_block *, int *, char *);
-extern struct super_block * ext3_read_super (struct super_block *,void *,int);
 extern int ext3_statfs (struct super_block *, struct statfs *);
 
 #define ext3_std_error(sb, errno)				\
diff -urN linux-2.5.4-pre3/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.5.4-pre3/include/linux/fs.h	Fri Feb  8 17:34:20 2002
+++ linux/include/linux/fs.h	Fri Feb  8 17:34:22 2002
@@ -934,21 +934,10 @@
 	int (*transfer) (struct inode *, struct iattr *);
 };
 
-/*
- *		NOTE NOTE NOTE
- *
- *	->read_super() is going to die.  New method (->get_sb) should replace
- * it.  The only reason why ->read_super() is left for _SHORT_ transition
- * period is to avoid a single patch touching every fs.  They will be
- * converted one-by-one and ONCE THAT IS DONE OR TWO WEEKS HAD PASSED
- * (whatever sooner) ->read_super() WILL DISAPPEAR.  
- */
-
 struct file_system_type {
 	const char *name;
 	int fs_flags;
 	struct super_block *(*get_sb) (struct file_system_type *, int, char *, void *);
-	struct super_block *(*read_super) (struct super_block *, void *, int);
 	struct module *owner;
 	struct file_system_type * next;
 	struct list_head fs_supers;
@@ -963,14 +952,6 @@
 struct super_block *get_sb_nodev(struct file_system_type *fs_type,
 	int flags, void *data,
 	int (*fill_super)(struct super_block *, void *, int));
-
-#define DECLARE_FSTYPE_DEV(var,type,read) \
-struct file_system_type var = { \
-	name:		type, \
-	read_super:	read, \
-	fs_flags:	FS_REQUIRES_DEV, \
-	owner:		THIS_MODULE, \
-}
 
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
 #define fops_get(fops) \
diff -urN linux-2.5.4-pre3/include/linux/hfs_fs.h linux/include/linux/hfs_fs.h
--- linux-2.5.4-pre3/include/linux/hfs_fs.h	Mon Jan 28 13:20:35 2002
+++ linux/include/linux/hfs_fs.h	Fri Feb  8 17:34:22 2002
@@ -301,7 +301,7 @@
 extern void hfs_sngl_ifill(struct inode *, ino_t, const int);
 
 /* super.c */
-extern struct super_block *hfs_read_super(struct super_block *,void *,int);
+extern int hfs_fill_super(struct super_block *,void *,int);
 
 /* trans.c */
 extern void hfs_colon2mac(struct hfs_name *, const char *, int);
diff -urN linux-2.5.4-pre3/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h
--- linux-2.5.4-pre3/include/linux/msdos_fs.h	Mon Jan 28 13:20:44 2002
+++ linux/include/linux/msdos_fs.h	Fri Feb  8 17:34:22 2002
@@ -330,8 +330,7 @@
 extern int msdos_unlink(struct inode *dir, struct dentry *dentry);
 extern int msdos_rename(struct inode *old_dir, struct dentry *old_dentry,
 			struct inode *new_dir, struct dentry *new_dentry);
-extern struct super_block *msdos_read_super(struct super_block *sb,
-					    void *data, int silent);
+extern int msdos_fill_super(struct super_block *sb, void *data, int silent);
 
 /* vfat/namei.c - these are for dmsdos */
 extern struct dentry *vfat_lookup(struct inode *dir, struct dentry *);
@@ -341,8 +340,7 @@
 extern int vfat_mkdir(struct inode *dir, struct dentry *dentry, int mode);
 extern int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
 		       struct inode *new_dir, struct dentry *new_dentry);
-extern struct super_block *vfat_read_super(struct super_block *sb, void *data,
-					   int silent);
+extern int vfat_fill_super(struct super_block *sb, void *data, int silent);
 
 /* vfat/vfatfs_syms.c */
 extern struct file_system_type vfat_fs_type;
diff -urN linux-2.5.4-pre3/include/linux/nfsd/export.h linux/include/linux/nfsd/export.h
--- linux-2.5.4-pre3/include/linux/nfsd/export.h	Tue Jan 29 21:42:01 2002
+++ linux/include/linux/nfsd/export.h	Fri Feb  8 17:34:22 2002
@@ -90,7 +90,10 @@
 struct svc_client *	exp_getclient(struct sockaddr_in *sin);
 void			exp_putclient(struct svc_client *clp);
 struct svc_export *	exp_get(struct svc_client *clp, kdev_t dev, ino_t ino);
-int			exp_rootfh(struct svc_client *, kdev_t, ino_t,
+struct svc_export *	exp_get_by_name(struct svc_client *clp,
+					struct vfsmount *mnt,
+					struct dentry *dentry);
+int			exp_rootfh(struct svc_client *, 
 					char *path, struct knfsd_fh *, int maxsize);
 int			nfserrno(int errno);
 void			exp_nlmdetach(void);
diff -urN linux-2.5.4-pre3/include/linux/pci_ids.h linux/include/linux/pci_ids.h
--- linux-2.5.4-pre3/include/linux/pci_ids.h	Tue Jan  8 09:34:50 2002
+++ linux/include/linux/pci_ids.h	Fri Feb  8 17:34:22 2002
@@ -1486,6 +1486,9 @@
 #define PCI_DEVICE_ID_PANACOM_QUADMODEM	0x0400
 #define PCI_DEVICE_ID_PANACOM_DUALMODEM	0x0402
 
+#define PCI_VENDOR_ID_AFAVLAB		0x14db
+#define PCI_DEVICE_ID_AFAVLAB_P028	0x2180
+
 #define PCI_VENDOR_ID_BROADCOM		0x14e4
 #define PCI_DEVICE_ID_TIGON3_5700	0x1644
 #define PCI_DEVICE_ID_TIGON3_5701	0x1645
diff -urN linux-2.5.4-pre3/include/linux/proc_fs_i.h linux/include/linux/proc_fs_i.h
--- linux-2.5.4-pre3/include/linux/proc_fs_i.h	Fri Apr  7 13:38:00 2000
+++ linux/include/linux/proc_fs_i.h	Wed Dec 31 16:00:00 1969
@@ -1,9 +0,0 @@
-struct proc_inode_info {
-	struct task_struct *task;
-	int type;
-	union {
-		int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
-		int (*proc_read)(struct task_struct *task, char *page);
-	} op;
-	struct file *file;
-};
diff -urN linux-2.5.4-pre3/include/linux/swap.h linux/include/linux/swap.h
--- linux-2.5.4-pre3/include/linux/swap.h	Tue Jan 29 21:41:10 2002
+++ linux/include/linux/swap.h	Fri Feb  8 17:34:22 2002
@@ -50,8 +50,12 @@
 
 #include <asm/atomic.h>
 
-#define SWP_USED	1
-#define SWP_WRITEOK	3
+enum {
+	SWP_USED	= (1 << 0),	/* is slot in swap_info[] used? */
+	SWP_WRITEOK	= (1 << 1),	/* ok to write to this swap?	*/
+	SWP_BLOCKDEV	= (1 << 2),	/* is this swap a block device? */
+	SWP_ACTIVE	= (SWP_USED | SWP_WRITEOK),
+};
 
 #define SWAP_CLUSTER_MAX 32
 
@@ -63,7 +67,6 @@
  */
 struct swap_info_struct {
 	unsigned int flags;
-	kdev_t swap_device;
 	spinlock_t sdev_lock;
 	struct file *swap_file;
 	unsigned short * swap_map;
diff -urN linux-2.5.4-pre3/include/linux/thread_info.h linux/include/linux/thread_info.h
--- linux-2.5.4-pre3/include/linux/thread_info.h	Fri Feb  8 17:34:20 2002
+++ linux/include/linux/thread_info.h	Fri Feb  8 17:34:22 2002
@@ -74,7 +74,7 @@
 
 static inline void clear_need_resched(void)
 {
-	set_thread_flag(TIF_NEED_RESCHED);
+	clear_thread_flag(TIF_NEED_RESCHED);
 }
 
 #endif
diff -urN linux-2.5.4-pre3/mm/swapfile.c linux/mm/swapfile.c
--- linux-2.5.4-pre3/mm/swapfile.c	Mon Jan 21 15:59:00 2002
+++ linux/mm/swapfile.c	Fri Feb  8 17:34:22 2002
@@ -114,7 +114,7 @@
 
 	while (1) {
 		p = &swap_info[type];
-		if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
+		if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) {
 			swap_device_lock(p);
 			offset = scan_swap_map(p);
 			swap_device_unlock(p);
@@ -729,7 +729,7 @@
 	swap_list_lock();
 	for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
 		p = swap_info + type;
-		if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
+		if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) {
 			if (p->swap_file->f_dentry == nd.dentry)
 				break;
 		}
@@ -752,7 +752,7 @@
 	}
 	nr_swap_pages -= p->pages;
 	total_swap_pages -= p->pages;
-	p->flags = SWP_USED;
+	p->flags &= ~SWP_WRITEOK;
 	swap_list_unlock();
 	unlock_kernel();
 	err = try_to_unuse(type);
@@ -770,7 +770,7 @@
 			swap_info[prev].next = p - swap_info;
 		nr_swap_pages += p->pages;
 		total_swap_pages += p->pages;
-		p->flags = SWP_WRITEOK;
+		p->flags |= SWP_WRITEOK;
 		swap_list_unlock();
 		goto out_dput;
 	}
@@ -778,7 +778,6 @@
 	swap_device_lock(p);
 	swap_file = p->swap_file;
 	p->swap_file = NULL;
-	p->swap_device = NODEV;
 	p->max = 0;
 	swap_map = p->swap_map;
 	p->swap_map = NULL;
@@ -822,7 +821,8 @@
 				}
 			len += sprintf(buf + len, "%-39s %s\t%d\t%d\t%d\n",
 				       path,
-				       !kdev_none(ptr->swap_device) ? "partition" : "file\t",
+				       (ptr->flags & SWP_BLOCKDEV) ?
+				       		"partition" : "file\t",
 				       ptr->pages << (PAGE_SHIFT - 10),
 				       usedswap << (PAGE_SHIFT - 10),
 				       ptr->prio);
@@ -837,9 +837,10 @@
 	int i;
 
 	for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
-		if (ptr->flags & SWP_USED)
-			if (kdev_same(ptr->swap_device, dev))
-				return 1;
+		if ((ptr->flags & SWP_USED) &&
+		    (ptr->flags & SWP_BLOCKDEV) &&
+		    (kdev_same(ptr->swap_file->f_dentry->d_inode->i_rdev, dev)))
+			return 1;
 	}
 	return 0;
 }
@@ -883,7 +884,6 @@
 		nr_swapfiles = type+1;
 	p->flags = SWP_USED;
 	p->swap_file = NULL;
-	p->swap_device = NODEV;
 	p->swap_map = NULL;
 	p->lowest_bit = 0;
 	p->highest_bit = 0;
@@ -911,8 +911,10 @@
 
 	error = -EINVAL;
 	if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode)) {
-		p->swap_device = swap_file->f_dentry->d_inode->i_rdev;
-		set_blocksize(p->swap_device, PAGE_SIZE);
+		error = set_blocksize(swap_file->f_dentry->d_inode->i_rdev,
+				      PAGE_SIZE);
+		if (error < 0)
+			goto bad_swap;
 	} else if (!S_ISREG(swap_file->f_dentry->d_inode->i_mode))
 		goto bad_swap;
 
@@ -1035,7 +1037,9 @@
 	swap_list_lock();
 	swap_device_lock(p);
 	p->max = maxpages;
-	p->flags = SWP_WRITEOK;
+	p->flags = SWP_ACTIVE;
+	if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode))
+		p->flags |= SWP_BLOCKDEV;
 	p->pages = nr_good_pages;
 	nr_swap_pages += nr_good_pages;
 	total_swap_pages += nr_good_pages;
@@ -1064,7 +1068,6 @@
 bad_swap_2:
 	swap_list_lock();
 	swap_map = p->swap_map;
-	p->swap_device = NODEV;
 	p->swap_file = NULL;
 	p->swap_map = NULL;
 	p->flags = 0;
@@ -1090,7 +1093,7 @@
 	swap_list_lock();
 	for (i = 0; i < nr_swapfiles; i++) {
 		unsigned int j;
-		if (swap_info[i].flags != SWP_USED)
+		if (!(swap_info[i].flags & SWP_USED))
 			continue;
 		for (j = 0; j < swap_info[i].max; ++j) {
 			switch (swap_info[i].swap_map[j]) {
