## Automatically generated incremental diff
## From:   linux-2.2.17-pre9
## To:     linux-2.2.17-pre10
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.2.17-pre9/CREDITS linux/CREDITS
--- linux-2.2.17-pre9/CREDITS	Mon Dec  3 22:08:22 2001
+++ linux/CREDITS	Mon Dec  3 22:08:35 2001
@@ -2169,10 +2169,10 @@
 N: Tim Waugh
 E: tim@cyberelk.demon.co.uk
 D: Co-architect of the parallel-port sharing system
-S: 34 Bladon Close
+S: 17 Curling Vale
 S: GUILDFORD
 S: Surrey
-S: GU1 1TY
+S: GU2 7PJ
 S: United Kingdom
 
 N: Juergen Weigert
diff -urN linux-2.2.17-pre9/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-2.2.17-pre9/Documentation/Configure.help	Mon Dec  3 22:08:22 2001
+++ linux/Documentation/Configure.help	Mon Dec  3 22:08:36 2001
@@ -5,8 +5,8 @@
 #
 # Translations of this file available on the WWW:
 #
-#   - Japanese, by Tetsuyasu YAMADA (tetsu@cauchy.nslab.ntt.co.jp), at
-#     http://jf.gee.kyoto-u.ac.jp/JF/JF-ftp/euc/Configure.help.euc
+#   - Japanese, maintained by the JF Project (JF@linux.or.jp), at
+#     http://www.linux.or.jp/JF/JFdocs/Configure.help/
 #   - Russian, by kaf@linux.nevod.perm.su, at
 #     http://nevod.perm.su/service/linux/doc/kernel/Configure.help
 #   - French, by Pierre Tane (tanep@bigfoot.com), at
diff -urN linux-2.2.17-pre9/Makefile linux/Makefile
--- linux-2.2.17-pre9/Makefile	Mon Dec  3 22:08:22 2001
+++ linux/Makefile	Mon Dec  3 22:08:36 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 17
-EXTRAVERSION = pre9
+EXTRAVERSION = pre10
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.17-pre9/drivers/char/n_tty.c linux/drivers/char/n_tty.c
--- linux-2.2.17-pre9/drivers/char/n_tty.c	Wed Jun  7 14:26:42 2000
+++ linux/drivers/char/n_tty.c	Mon Dec  3 22:08:36 2001
@@ -1142,9 +1142,7 @@
 				nr -= num;
 				if (nr == 0)
 					break;
-				current->state = TASK_RUNNING;
 				get_user(c, b);
-				current->state = TASK_INTERRUPTIBLE;
 				if (opost(c, tty) < 0)
 					break;
 				b++; nr--;
@@ -1152,9 +1150,7 @@
 			if (tty->driver.flush_chars)
 				tty->driver.flush_chars(tty);
 		} else {
-			current->state = TASK_RUNNING;
 			c = tty->driver.write(tty, 1, b, nr);
-			current->state = TASK_INTERRUPTIBLE;
 			if (c < 0) {
 				retval = c;
 				goto break_out;
diff -urN linux-2.2.17-pre9/drivers/i2o/i2o_block.c linux/drivers/i2o/i2o_block.c
--- linux-2.2.17-pre9/drivers/i2o/i2o_block.c	Wed Jun  7 14:26:42 2000
+++ linux/drivers/i2o/i2o_block.c	Mon Dec  3 22:08:36 2001
@@ -1190,70 +1190,123 @@
 	return 0;
 }
 
-static void i2ob_probe(void)
+static int i2ob_scan(int bios)
 {
 	int i;
 	int unit = 0;
 	int warned = 0;
+	struct i2o_device *d, *b;
+	struct i2o_controller *c;
+	struct i2ob_device *dev;
 		
 	for(i=0; i< MAX_I2O_CONTROLLERS; i++)
 	{
-		struct i2o_controller *c=i2o_find_controller(i);
-		struct i2o_device *d;
-	
+		c=i2o_find_controller(i);
+
 		if(c==NULL)
 			continue;
 
-		for(d=c->devices;d!=NULL;d=d->next)
+		/* 
+		 * 	The device list connected to the I2O Controller is doubly linked
+		 *	Here we traverse the end of the list , and start claiming devices
+		 *	from that end. This assures that within an I2O controller atleast
+		 *	the newly created volumes get claimed after the older ones, thus
+		 *	mapping to same major/minor (and hence device file name) after 
+		 *	every reboot.
+		 *	The exception being: 
+		 *	1. If there was a TID reuse.
+		 *	2. There was more than one I2O controller. 
+		 */
+
+		if(!bios)
+		{
+			for (d=c->devices;d!=NULL;d=d->next)
+				if(d->next == NULL)
+					b = d;
+		}
+		else
+			b = c->devices;
+		
+		for (d=b;d!=NULL;d=d->next)
 		{
-		if(d->lct_data.class_id!=I2O_CLASS_RANDOM_BLOCK_STORAGE)
+			if(d->lct_data.class_id!=I2O_CLASS_RANDOM_BLOCK_STORAGE)
 				continue;
-
 			if(d->lct_data.user_tid != 0xFFF)
 				continue;
-
-			   if(i2o_claim_device(d, &i2o_block_handler))
-			   {
-				    printk(KERN_WARNING "i2o_block: Controller %d, TID %d\n", c->unit,
-					     d->lct_data.tid);
-				    printk(KERN_WARNING "\tDevice refused claim! Skipping installation\n");
-				    continue;
-			   }
-
+			if(bios)
+			{
+				if(d->lct_data.bios_info != 0x80)
+					continue;
+				printk(KERN_INFO "Claiming as Boot device: Controller %d, TID %d\n", c->unit, d->lct_data.tid);
+			}
+			else
+			{
+				if(d->lct_data.bios_info == 0x80)
+					continue;	/* Already claimed on pass 1 */
+			}
+			if(i2o_claim_device(d, &i2o_block_handler))
+			{
+				printk(KERN_WARNING "i2o_block: Controller %d, TID %d\n", c->unit, d->lct_data.tid);
+				printk(KERN_WARNING "\t%sevice refused claim! Skipping installation\n",
+					bios?"Boot d":"D");
+				continue;
+			}
 			if(unit<MAX_I2OB<<4)
 			{
- 				/*
+				/*
 				 * Get the device and fill in the
 				 * Tid and controller.
 				 */
-				struct i2ob_device *dev=&i2ob_dev[unit];
-				dev->i2odev = d; 
+				dev=&i2ob_dev[unit];
+				dev->i2odev = d;
 				dev->controller = c;
-				    dev->unit = c->unit;
+				dev->unit = c->unit;
 				dev->tid = d->lct_data.tid;
- 
-				    if(i2ob_install_device(c,d,unit))
-					     printk(KERN_WARNING "Could not install I2O block device\n");
-				    else
-				    {
-					     unit+=16;
-					     i2ob_dev_count++;
-
-					  /* We want to know when device goes away */
-					 i2o_device_notify_on(d, &i2o_block_handler);
-				    }
+				if(i2ob_install_device(c,d,unit))
+					printk(KERN_WARNING "Could not install I2O block device\n");
+				else
+				{
+					unit+=16;
+					i2ob_dev_count++;
+					/* We want to know when device goes away */
+					i2o_device_notify_on(d, &i2o_block_handler);
+				}
 			}
 			else
 			{
-			if(!warned++)
-				printk(KERN_WARNING "i2o_block: too many device, registering only %d.\n", unit>>4);
+				if(!warned++)
+					printk(KERN_WARNING "i2o_block: too many device, registering only %d.\n", unit>>4);
 			}
-			   i2o_release_device(d, &i2o_block_handler);
+			i2o_release_device(d, &i2o_block_handler);
 		}
 		i2o_unlock_controller(c);
 	}
 }
 
+static void i2ob_probe(void)
+{
+	/* 
+	 *	Some overhead/redundancy involved here, while trying to
+	 *	claim the first boot volume encountered as /dev/i2o/hda
+	 *	everytime. All the i2o_controllers are searched and the
+	 *	first i2o block device marked as bootable is claimed
+	 *	If an I2O block device was booted off , the bios sets
+	 *	its bios_info field to 0x80, this what we search for.
+ 	 *	Assuming that the bootable volume is /dev/i2o/hda
+	 *	everytime will prevent any kernel panic while mounting
+	 *	root partition
+	 */ 
+
+	printk(KERN_INFO "i2o_block: Checking for Boot device...\n");
+	i2ob_scan(1);
+	
+	/*
+	 *	Now the remainder.
+	 */
+	 
+	i2ob_scan(0);
+}
+
 /*
  * New device notification handler.  Called whenever a new
  * I2O block storage device is added to the system.
@@ -1282,14 +1335,6 @@
 		  if(!i2ob_dev[unit].i2odev)
 			   break;
 	 }
-
-	 /*
-	  * Creating a RAID 5 volume takes a little while and the UTIL_CLAIM
-	  * will fail if we don't give the card enough time to do it's magic,
-	  * so we just sleep for a little while and let it do it's thing
-	  */
-	 current->state = TASK_INTERRUPTIBLE;
-	 schedule_timeout(5*HZ);
 
 	 if(i2o_claim_device(d, &i2o_block_handler))
 	 {
diff -urN linux-2.2.17-pre9/drivers/i2o/i2o_core.c linux/drivers/i2o/i2o_core.c
--- linux-2.2.17-pre9/drivers/i2o/i2o_core.c	Mon Dec  3 22:08:22 2001
+++ linux/drivers/i2o/i2o_core.c	Mon Dec  3 22:08:36 2001
@@ -260,7 +260,7 @@
 	{
 		if (msg[4] >> 24)
 		{
-			i2o_report_status(KERN_WARNING, "i2o_core: post_wait reply", msg);
+			i2o_report_status(KERN_INFO, "i2o_core: post_wait reply", msg);
 			status = -(msg[4] & 0xFFFF);
 		}
 		else
@@ -352,6 +352,9 @@
 	d->controller=c;
 	d->owner=NULL;
 	d->next=c->devices;
+	d->prev=NULL;
+	if (c->devices != NULL)
+		c->devices->prev=d;
 	c->devices=d;
 	*d->dev_name = 0;
 
@@ -2981,7 +2984,6 @@
 void cleanup_module(void)
 {
 	 int stat;
-
 	 unregister_reboot_notifier(&i2o_reboot_notifier);
 
 	if(i2o_num_controllers)
diff -urN linux-2.2.17-pre9/drivers/net/eepro.c linux/drivers/net/eepro.c
--- linux-2.2.17-pre9/drivers/net/eepro.c	Mon Dec  3 22:08:22 2001
+++ linux/drivers/net/eepro.c	Mon Dec  3 22:08:36 2001
@@ -23,6 +23,10 @@
 	This is a compatibility hardware problem.
 
 	Versions:
+	0.12b	added reset when the tx interrupt is called and TX isn't done
+		and other minor fixes. this may fix a problem found after
+		initialization that delays tx until a transmit timeout is 
+		reported and the board is reset.
 	0.12a	fixed bug that would make impossible have ee10 boards and
 		other previous supported boards. (aris, 05/19/2000)
 	0.12    added support to 82595FX etherexpress 10 based cards
@@ -97,7 +101,7 @@
 */
 
 static const char *version =
-	"eepro.c: v0.12b 04/26/2000 aris@conectiva.com.br\n";
+	"eepro.c: v0.12b 06/20/2000 aris@conectiva.com.br\n";
 
 #include <linux/module.h>
 
@@ -470,7 +474,7 @@
 #define EEDO 0x08
 
 /* do a full reset */
-#define eepro_reset(ioaddr) outb(RESET_CMD, ioaddr)
+#define eepro_reset(ioaddr) outb(RESET_CMD, ioaddr); udelay(40);
 
 /* do a nice reset */
 #define eepro_sel_reset(ioaddr) 	{ \
@@ -531,8 +535,8 @@
 							(XMT_LOWER_LIMIT << 8);\
 						lp->tx_start = lp->tx_end;\
 						lp->tx_last = 0;\
+						dev->tbusy=0;\
 						dev->trans_start = jiffies;\
-						netif_wake_queue(dev);\
 						eepro_en_int(ioaddr);\
 						eepro_en_rx(ioaddr);\
 					}
@@ -1078,10 +1082,6 @@
 		if (tickssofar < 40)
 			return 1;
 		
-		/* let's disable interrupts so we can avoid confusion on SMP
-		 */
-		eepro_dis_int(ioaddr);
-		
 		/* if (net_debug > 1) */
 		printk(KERN_ERR "%s: transmit timed out, %s?\n", dev->name, 
 			"network cable problem");
@@ -1089,25 +1089,9 @@
 		   one for the the log file  */
 		printk(KERN_DEBUG "%s: transmit timed out, %s?\n", dev->name,
 			"network cable problem");
-		lp->stats.tx_errors++;
-
-		/* Try to restart the adaptor. */
-		/* We are supposed to wait for 2 us after a SEL_RESET */
-		eepro_sel_reset(ioaddr);
-
-		/* Do I also need to flush the transmit buffers here? YES? */
-		lp->tx_start = lp->tx_end = (XMT_LOWER_LIMIT << 8); 
-		lp->tx_last = 0;
-	
-		dev->tbusy=0;
-		dev->trans_start = jiffies;
-
-
-		/* re-enabling all interrupts */
-		eepro_en_int(ioaddr);
-
-		/* enable rx */
-		eepro_en_rx(ioaddr);
+		
+		/* let's do a complete sel reset */
+		eepro_complete_selreset(ioaddr);
 	}
 	spin_lock_irqsave(&lp->lock, flags);
 
@@ -1393,8 +1377,7 @@
 		eepro_en_int(ioaddr);
 	
 	}
-	/* enabling rx */
-	eepro_en_rx(ioaddr);
+	eepro_complete_selreset(ioaddr);
 }
 
 /* The horrible routine to read a word from the serial EEPROM. */
@@ -1506,7 +1489,8 @@
 				last = (XMT_LOWER_LIMIT << 8);
 				end = last + (((length + 3) >> 1) << 1) + XMT_HEADER;
 			}
-			else end = (XMT_LOWER_LIMIT << 8) + (end - XMT_RAM);
+			else end = (XMT_LOWER_LIMIT << 8) + (end - 
+						(XMT_UPPER_LIMIT << 8));
 		}
 
 		outw(last, ioaddr + HOST_ADDRESS_REG);
@@ -1568,7 +1552,6 @@
 		return;
 	}
 
-	eepro_en_int(ioaddr);
 	dev->tbusy = 1;
 
 	if (net_debug > 5)
diff -urN linux-2.2.17-pre9/drivers/pci/oldproc.c linux/drivers/pci/oldproc.c
--- linux-2.2.17-pre9/drivers/pci/oldproc.c	Mon Dec  3 22:08:22 2001
+++ linux/drivers/pci/oldproc.c	Mon Dec  3 22:08:36 2001
@@ -105,6 +105,7 @@
 	DEVICE( DEC,		DEC_21153,	"DC21153"),
 	DEVICE( DEC,		DEC_21154,	"DC21154"),
 	DEVICE( DEC,		DEC_21285,	"DC21285 Footbridge"),
+	DEVICE( DEC,		DEC_21554,	"DC21554 DrawBridge"),
 	DEVICE( CIRRUS,		CIRRUS_7548,	"GD 7548"),
 	DEVICE( CIRRUS,		CIRRUS_5430,	"GD 5430"),
 	DEVICE( CIRRUS,		CIRRUS_5434_4,	"GD 5434"),
diff -urN linux-2.2.17-pre9/drivers/sound/Makefile linux/drivers/sound/Makefile
--- linux-2.2.17-pre9/drivers/sound/Makefile	Mon Dec  3 22:08:23 2001
+++ linux/drivers/sound/Makefile	Mon Dec  3 22:08:36 2001
@@ -84,7 +84,7 @@
 obj-$(CONFIG_SOUND_ES1370)	+= es1370.o
 obj-$(CONFIG_SOUND_ES1371)	+= es1371.o
 obj-$(CONFIG_SOUND_ESSSOLO1)	+= esssolo1.o
-obj-$(CONFIG_SOUND_FUSION)	+= cs46xx.o
+obj-$(CONFIG_SOUND_FUSION)	+= cs46xx.o ac97_codec.o
 obj-$(CONFIG_SOUND_ICH)		+= i810_audio.o ac97_codec.o
 obj-$(CONFIG_SOUND_MAESTRO)	+= maestro.o
 obj-$(CONFIG_SOUND_SONICVIBES)	+= sonicvibes.o
diff -urN linux-2.2.17-pre9/drivers/sound/cs46xx.c linux/drivers/sound/cs46xx.c
--- linux-2.2.17-pre9/drivers/sound/cs46xx.c	Mon Dec  3 22:08:23 2001
+++ linux/drivers/sound/cs46xx.c	Mon Dec  3 22:08:36 2001
@@ -1247,16 +1247,12 @@
 			if (file->f_mode & FMODE_WRITE) {
 				stop_dac(state);
 				dmabuf->ready = 0;
-				spin_lock_irqsave(&state->card->lock, flags);
 				cs_set_dac_rate(state, val);
-				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 			if (file->f_mode & FMODE_READ) {
 				stop_adc(state);
 				dmabuf->ready = 0;
-				spin_lock_irqsave(&state->card->lock, flags);
 				cs_set_adc_rate(state, val);
-				spin_unlock_irqrestore(&state->card->lock, flags);
 			}
 		}
 		return put_user(dmabuf->rate, (int *)arg);
@@ -1342,7 +1338,7 @@
 		if (dmabuf->subdivision)
 			return -EINVAL;
 		get_user_ret(val, (int *)arg, -EFAULT);
-		if (val != 1 && val != 2 && val != 4)
+		if (val != 1 && val != 2)
 			return -EINVAL;
 		dmabuf->subdivision = val;
 		return 0;
@@ -1352,10 +1348,16 @@
 
 		dmabuf->ossfragshift = val & 0xffff;
 		dmabuf->ossmaxfrags = (val >> 16) & 0xffff;
-		/* Fragments must be 2K long */
-		dmabuf->ossfragshift = 9;
-		if (dmabuf->ossmaxfrags < 4)
-			dmabuf->ossmaxfrags = 4;
+		switch(dmabuf->ossmaxfrags)
+		{
+			case 1:
+				dmabuf->ossfragshift=12;
+				return 0;
+			default:
+				/* Fragments must be 2K long */
+				dmabuf->ossfragshift = 11;
+				dmabuf->ossmaxfrags=2;
+		}
 		return 0;
 
 	case SNDCTL_DSP_GETOSPACE:
diff -urN linux-2.2.17-pre9/fs/smbfs/Makefile linux/fs/smbfs/Makefile
--- linux-2.2.17-pre9/fs/smbfs/Makefile	Sun Oct 12 10:17:05 1997
+++ linux/fs/smbfs/Makefile	Mon Dec  3 22:08:37 2001
@@ -11,8 +11,13 @@
 O_OBJS   := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o 
 M_OBJS   := $(O_TARGET)
 
-# If you want debugging output, please uncomment the following line
+# If you want debugging output, you may add these flags to the EXTRA_CFLAGS
+# Note: SMBFS_PARANOIA is also defined in most smbfs source files.
+
+EXTRA_CFLAGS += -DSMBFS_PARANOIA
+#EXTRA_CFLAGS += -DSMBFS_DEBUG
+#EXTRA_CFLAGS += -DSMBFS_DEBUG_VERBOSE
+#EXTRA_CFLAGS += -DDEBUG_SMB_MALLOC
 
-# EXTRA_CFLAGS += -DDEBUG -DDEBUG_SMB_MALLOC=1
 
 include $(TOPDIR)/Rules.make
diff -urN linux-2.2.17-pre9/fs/smbfs/cache.c linux/fs/smbfs/cache.c
--- linux-2.2.17-pre9/fs/smbfs/cache.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/cache.c	Mon Dec  3 22:08:37 2001
@@ -20,6 +20,9 @@
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_VERBOSE 1 */
 
+#include "smb_debug.h"
+
+
 static inline struct inode * 
 get_cache_inode(struct cache_head *cachep)
 {
@@ -37,10 +40,8 @@
 	struct inode * inode = dentry->d_inode;
 	struct cache_head * cachep;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_get_dircache: finding cache for %s/%s\n",
-dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+	VERBOSE("smb_get_dircache: finding cache for %s/%s\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name);
 	cachep = (struct cache_head *) get_cached_page(inode, 0, 1);
 	if (!cachep)
 		goto out;
@@ -59,8 +60,9 @@
 		for (i = 0; i < cachep->pages; i++, index++) {
 #ifdef SMBFS_PARANOIA
 			if (index->block)
-				printk(KERN_DEBUG "smb_get_dircache: cache %s/%s has existing block!\n",
-				       dentry->d_parent->d_name.name, dentry->d_name.name);
+				PARANOIA("smb_get_dircache: cache %s/%s has existing block!\n",
+					 dentry->d_parent->d_name.name,
+					 dentry->d_name.name);
 #endif
 			offset = PAGE_SIZE + (i << PAGE_SHIFT);
 			block = (struct cache_block *) get_cached_page(inode,
@@ -84,9 +86,7 @@
 	struct cache_index * index = cachep->index;
 	int i;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_free_cache_blocks: freeing %d blocks\n", cachep->pages);
-#endif
+	VERBOSE("smb_free_cache_blocks: freeing %d blocks\n", cachep->pages);
 	for (i = 0; i < cachep->pages; i++, index++)
 	{
 		if (index->block)
@@ -103,9 +103,7 @@
 void
 smb_free_dircache(struct cache_head * cachep)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_free_dircache: freeing cache\n");
-#endif
+	VERBOSE("smb_free_dircache: freeing cache\n");
 	smb_free_cache_blocks(cachep);
 	put_cached_page((unsigned long) cachep);
 }
@@ -117,9 +115,8 @@
 void
 smb_init_dircache(struct cache_head * cachep)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_init_dircache: initializing cache, %d blocks\n", cachep->pages);
-#endif
+	VERBOSE("smb_init_dircache: initializing cache, %d blocks\n", 
+		cachep->pages);
 	smb_free_cache_blocks(cachep);
 	memset(cachep, 0, sizeof(struct cache_head));
 }
@@ -139,10 +136,8 @@
 	unsigned int nent, offset, len = entry->len;
 	unsigned int needed = len + sizeof(struct cache_entry);
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_add_to_cache: cache inode %p, status %d, adding %s at %ld\n",
-inode, cachep->status, entry->name, fpos);
-#endif
+	VERBOSE("smb_add_to_cache: cache inode %p, status %d, adding %s at %ld\n",
+		inode, cachep->status, entry->name, fpos);
 	/*
 	 * Don't do anything if we've had an error ...
 	 */
@@ -168,10 +163,8 @@
 		block->cb_data.table[nent].offset = offset;
 		block->cb_data.table[nent].ino = entry->ino;
 		cachep->entries++;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_add_to_cache: added entry %s, len=%d, pos=%ld, entries=%d\n",
-entry->name, len, fpos, cachep->entries);
-#endif
+		VERBOSE("smb_add_to_cache: added entry %s, len=%d, pos=%ld, entries=%d\n",
+			entry->name, len, fpos, cachep->entries);
 		return;
 	}
 	/*
@@ -183,7 +176,7 @@
 	index++;
 #ifdef SMBFS_PARANOIA
 	if (index->block)
-		printk(KERN_DEBUG "smb_add_to_cache: new index already has block!\n");
+		PARANOIA("smb_add_to_cache: new index already has block!\n");
 #endif
 
 	/*
@@ -197,10 +190,8 @@
 	{
 		index->block = block;
 		index->space = PAGE_SIZE;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_add_to_cache: inode=%p, pages=%d, block at %ld\n",
-inode, cachep->pages, page_off);
-#endif
+		VERBOSE("smb_add_to_cache: inode=%p, pages=%d, block at %ld\n",
+			inode, cachep->pages, page_off);
 		goto add_entry;
 	}
 	/*
@@ -221,9 +212,8 @@
 	unsigned int i, nent, offset = 0;
 	off_t next_pos = 2;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_find_in_cache: cache %p, looking for pos=%ld\n", cachep, pos);
-#endif
+	VERBOSE("smb_find_in_cache: cache %p, looking for pos=%ld\n", 
+		cachep, pos);
 	for (i = 0; i < cachep->pages; i++, index++)
 	{
 		if (pos < next_pos)
@@ -241,10 +231,8 @@
 		entry->len = block->cb_data.table[nent].namelen;
 		offset = block->cb_data.table[nent].offset;
 		entry->name = &block->cb_data.names[offset];
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_find_in_cache: found %s, len=%d, pos=%ld\n",
-entry->name, entry->len, pos);
-#endif
+		VERBOSE("smb_find_in_cache: found %s, len=%d, pos=%ld\n",
+			entry->name, entry->len, pos);
 		break;
 	}
 	return offset;
@@ -256,10 +244,9 @@
 	struct inode * inode = dentry->d_inode;
 	int result;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-	printk(KERN_DEBUG "smb_refill_dircache: cache %s/%s, blocks=%d\n",
-	       dentry->d_parent->d_name.name, dentry->d_name.name, cachep->pages);
-#endif
+	VERBOSE(KERN_DEBUG "smb_refill_dircache: cache %s/%s, blocks=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name, 
+		cachep->pages);
 	/*
 	 * Fill the cache, starting at position 2.
 	 */
@@ -268,9 +255,8 @@
 	result = smb_proc_readdir(dentry, 2, cachep);
 	if (result < 0)
 	{
-#ifdef SMBFS_PARANOIA
-		printk(KERN_DEBUG "smb_refill_dircache: readdir failed, result=%d\n", result);
-#endif
+		PARANOIA("smb_refill_dircache: readdir failed, result=%d\n", 
+			 result);
 		goto out;
 	}
 
@@ -280,9 +266,7 @@
 	 */
 	if (!(inode->u.smbfs_i.cache_valid & SMB_F_CACHEVALID))
 	{
-#ifdef SMBFS_PARANOIA
-		printk(KERN_DEBUG "smb_refill_dircache: cache invalidated, retrying\n");
-#endif
+		PARANOIA("smb_refill_dircache: cache invalidated, retrying\n");
 		goto retry;
 	}
 
@@ -292,11 +276,9 @@
 		cachep->valid = 1;
 		cachep->mtime = dentry->d_inode->i_mtime;
 	}
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_refill_cache: cache %s/%s status=%d, entries=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-cachep->status, cachep->entries);
-#endif
+	VERBOSE("smb_refill_cache: cache %s/%s status=%d, entries=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		cachep->status, cachep->entries);
 
 out:
 	return result;
@@ -313,4 +295,3 @@
 	dir->u.smbfs_i.cache_valid &= ~SMB_F_CACHEVALID;
 	dir->u.smbfs_i.oldmtime = 0;
 }
-
diff -urN linux-2.2.17-pre9/fs/smbfs/dir.c linux/fs/smbfs/dir.c
--- linux-2.2.17-pre9/fs/smbfs/dir.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/dir.c	Mon Dec  3 22:08:37 2001
@@ -15,7 +15,9 @@
 
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_VERBOSE 1 */
-/* #define pr_debug printk */
+
+#include "smb_debug.h"
+
 #define SMBFS_MAX_AGE 5*HZ
 
 static ssize_t smb_dir_read(struct file *, char *, size_t, loff_t *);
@@ -83,10 +85,9 @@
 	struct cache_head *cachep = NULL;
 	int result;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-	printk("smb_readdir: reading %s/%s, f_pos=%d\n",
-	       dentry->d_parent->d_name.name, dentry->d_name.name, (int) filp->f_pos);
-#endif
+	VERBOSE("smb_readdir: reading %s/%s, f_pos=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		(int) filp->f_pos);
 
 	result = 0;
 	switch ((unsigned int) filp->f_pos)
@@ -174,11 +175,9 @@
 	struct dentry *dentry = file->f_dentry;
 	struct smb_sb_info *server = server_from_dentry(dentry);
 	int error = 0;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_dir_open: (%s/%s)\n", dentry->d_parent->d_name.name, 
-file->f_dentry->d_name.name);
-#endif
 
+	VERBOSE("smb_dir_open: (%s/%s)\n", dentry->d_parent->d_name.name, 
+		file->f_dentry->d_name.name);
 	if (server->conn_pid)
 		error = smb_revalidate_inode(dentry);
 	return error;
@@ -217,19 +216,19 @@
 	 */
 	valid = (age <= SMBFS_MAX_AGE);
 #ifdef SMBFS_DEBUG_VERBOSE
-if (!valid)
-printk("smb_lookup_validate: %s/%s not valid, age=%lu\n", 
-dentry->d_parent->d_name.name, dentry->d_name.name, age);
+	if (!valid)
+		VERBOSE("smb_lookup_validate: %s/%s not valid, age=%lu\n", 
+			dentry->d_parent->d_name.name, dentry->d_name.name,
+			age);
 #endif
 
 	if (inode)
 	{
 		if (is_bad_inode(inode))
 		{
-#ifdef SMBFS_PARANOIA
-			printk(KERN_DEBUG "smb_lookup_validate: %s/%s has dud inode\n", 
-			       dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+			PARANOIA("smb_lookup_validate: %s/%s has dud inode\n", 
+				 dentry->d_parent->d_name.name,
+				 dentry->d_name.name);
 			valid = 0;
 		} else if (!valid)
 			valid = (smb_revalidate_inode(dentry) == 0);
@@ -290,10 +289,9 @@
 	{
 		if (is_bad_inode(dentry->d_inode))
 		{
-#ifdef SMBFS_PARANOIA
-			printk(KERN_DEBUG "smb_delete_dentry: bad inode, unhashing %s/%s\n", 
-			       dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+			PARANOIA("smb_delete_dentry: bad inode, unhashing %s/%s\n", 
+				 dentry->d_parent->d_name.name,
+				 dentry->d_name.name);
 			d_drop(dentry);
 		}
 		smb_close_dentry(dentry);
@@ -334,8 +332,9 @@
 	error = smb_proc_getattr(dentry, &finfo);
 #ifdef SMBFS_PARANOIA
 	if (error && error != -ENOENT)
-		printk(KERN_DEBUG "smb_lookup: find %s/%s failed, error=%d\n",
-		       dentry->d_parent->d_name.name, dentry->d_name.name, error);
+		PARANOIA("smb_lookup: find %s/%s failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 error);
 #endif
 
 	inode = NULL;
@@ -370,10 +369,8 @@
 	int error;
 	struct smb_fattr fattr;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_instantiate: file %s/%s, fileid=%u\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, fileid);
-#endif
+	VERBOSE("smb_instantiate: file %s/%s, fileid=%u\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name, fileid);
 	error = smb_proc_getattr(dentry, &fattr);
 	if (error)
 		goto out_close;
@@ -399,10 +396,9 @@
 out_close:
 	if (have_id)
 	{
-#ifdef SMBFS_PARANOIA
-		printk(KERN_DEBUG "smb_instantiate: %s/%s failed, error=%d, closing %u\n",
-		       dentry->d_parent->d_name.name, dentry->d_name.name, error, fileid);
-#endif
+		PARANOIA("smb_instantiate: %s/%s failed, error=%d, closing %u\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 error, fileid);
 		smb_close_fileid(dentry, fileid);
 	}
 	goto out;
@@ -415,10 +411,8 @@
 	__u16 fileid;
 	int error;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_create: creating %s/%s, mode=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, mode);
-#endif
+	VERBOSE("smb_create: creating %s/%s, mode=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name, mode);
 
 	error = smb_proc_create(dentry, 0, CURRENT_TIME, &fileid);
 	if (!error)
@@ -426,10 +420,9 @@
 		error = smb_instantiate(dentry, fileid, 1);
 	} else
 	{
-#ifdef SMBFS_PARANOIA
-		printk(KERN_DEBUG "smb_create: %s/%s failed, error=%d\n",
-		       dentry->d_parent->d_name.name, dentry->d_name.name, error);
-#endif
+		PARANOIA("smb_create: %s/%s failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 error);
 	}
 	return error;
 }
@@ -509,10 +502,9 @@
 		error = smb_proc_unlink(new_dentry);
 		if (error)
 		{
-#ifdef SMBFS_DEBUG_VERBOSE
-			printk(KERN_DEBUG "smb_rename: unlink %s/%s, error=%d\n",
-			       new_dentry->d_parent->d_name.name, new_dentry->d_name.name, error);
-#endif
+			VERBOSE("smb_rename: unlink %s/%s, error=%d\n",
+				new_dentry->d_parent->d_name.name,
+				new_dentry->d_name.name, error);
 			goto out;
 		}
 		/* FIXME */
diff -urN linux-2.2.17-pre9/fs/smbfs/file.c linux/fs/smbfs/file.c
--- linux-2.2.17-pre9/fs/smbfs/file.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/file.c	Mon Dec  3 22:08:37 2001
@@ -24,7 +24,8 @@
 
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_VERBOSE 1 */
-/* #define pr_debug printk */
+
+#include "smb_debug.h"
 
 static inline int
 min(int a, int b)
@@ -42,10 +43,8 @@
 static int
 smb_fsync(struct file *file, struct dentry * dentry)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_fsync: sync file %s/%s\n", 
-dentry->d_parent->d_name.name, dentry->d_name.name);
-#endif
+	VERBOSE("smb_fsync: sync file %s/%s\n", 
+		dentry->d_parent->d_name.name, dentry->d_name.name);
 	return 0;
 }
 
@@ -63,17 +62,15 @@
 
 	clear_bit(PG_error, &page->flags);
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_readpage_sync: file %s/%s, count=%d@%ld, rsize=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, rsize);
-#endif
+	VERBOSE("smb_readpage_sync: file %s/%s, count=%d@%ld, rsize=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name, count,
+		offset, rsize);
 	result = smb_open(dentry, SMB_O_RDONLY);
 	if (result < 0)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_readpage_sync: %s/%s open failed, error=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, result);
-#endif
+		PARANOIA("smb_readpage_sync: %s/%s open failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 result);
 		goto io_error;
 	}
 
@@ -109,10 +106,10 @@
 	struct dentry *dentry = file->f_dentry;
 	int		error;
 
-	pr_debug("SMB: smb_readpage %08lx\n", page_address(page));
+	DEBUG1("SMB: smb_readpage %08lx\n", page_address(page));
 #ifdef SMBFS_PARANOIA
 	if (test_bit(PG_locked, &page->flags))
-		printk(KERN_DEBUG "smb_readpage: page already locked!\n");
+		DEBUG1("smb_readpage: page already locked!\n");
 #endif
 	set_bit(PG_locked, &page->flags);
 	atomic_inc(&page->count);
@@ -135,10 +132,9 @@
 	int result, written = 0;
 
 	offset += page->offset;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_writepage_sync: file %s/%s, count=%d@%ld, wsize=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, wsize);
-#endif
+	VERBOSE("smb_writepage_sync: file %s/%s, count=%d@%ld, wsize=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		count, offset, wsize);
 
 	do {
 		if (count < wsize)
@@ -149,8 +145,8 @@
 			break;
 		/* N.B. what if result < wsize?? */
 #ifdef SMBFS_PARANOIA
-if (result < wsize)
-printk(KERN_DEBUG "smb_writepage_sync: short write, wsize=%d, result=%d\n", wsize, result);
+		if (result < wsize)
+			printk(KERN_DEBUG "smb_writepage_sync: short write, wsize=%d, result=%d\n", wsize, result);
 #endif
 		buffer += wsize;
 		offset += wsize;
@@ -179,7 +175,7 @@
 
 #ifdef SMBFS_PARANOIA
 	if (test_bit(PG_locked, &page->flags))
-		printk(KERN_DEBUG "smb_writepage: page already locked!\n");
+		DEBUG1("smb_writepage: page already locked!\n");
 #endif
 	set_bit(PG_locked, &page->flags);
 	atomic_inc(&page->count);
@@ -194,9 +190,9 @@
 {
 	struct dentry *dentry = file->f_dentry;
 
-	pr_debug("SMBFS: smb_updatepage(%s/%s %d@%ld, sync=%d)\n",
-		dentry->d_parent->d_name.name, dentry->d_name.name,
-	 	count, page->offset+offset, sync);
+	DEBUG1("SMBFS: smb_updatepage(%s/%s %d@%ld, sync=%d)\n",
+	       dentry->d_parent->d_name.name, dentry->d_name.name,
+	       count, page->offset+offset, sync);
 
 	return smb_writepage_sync(dentry, page, offset, count);
 }
@@ -207,27 +203,23 @@
 	struct dentry * dentry = file->f_dentry;
 	ssize_t	status;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_read: file %s/%s, count=%lu@%lu\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(unsigned long) count, (unsigned long) *ppos);
-#endif
+	VERBOSE("smb_file_read: file %s/%s, count=%lu@%lu\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		(unsigned long) count, (unsigned long) *ppos);
 
 	status = smb_revalidate_inode(dentry);
 	if (status)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_file_read: %s/%s validation failed, error=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, status);
-#endif
+		PARANOIA("smb_file_read: %s/%s validation failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 status);
 		goto out;
 	}
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_read: before read, size=%ld, pages=%ld, flags=%x, atime=%ld\n",
-dentry->d_inode->i_size, dentry->d_inode->i_nrpages, dentry->d_inode->i_flags,
-dentry->d_inode->i_atime);
-#endif
+	VERBOSE("smb_file_read: before read, size=%ld, pages=%ld, flags=%x, atime=%ld\n",
+		dentry->d_inode->i_size, dentry->d_inode->i_nrpages,
+		dentry->d_inode->i_flags,
+		dentry->d_inode->i_atime);
 	status = generic_file_read(file, buf, count, ppos);
 out:
 	return status;
@@ -239,18 +231,16 @@
 	struct dentry * dentry = file->f_dentry;
 	int	status;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_mmap: file %s/%s, address %lu - %lu\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, vma->vm_start, vma->vm_end);
-#endif
+	VERBOSE("smb_file_mmap: file %s/%s, address %lu - %lu\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		vma->vm_start, vma->vm_end);
 
 	status = smb_revalidate_inode(dentry);
 	if (status)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_file_mmap: %s/%s validation failed, error=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, status);
-#endif
+		PARANOIA("smb_file_mmap: %s/%s validation failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 status);
 		goto out;
 	}
 	status = generic_file_mmap(file, vma);
@@ -267,19 +257,17 @@
 	struct dentry * dentry = file->f_dentry;
 	ssize_t	result;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_write: file %s/%s, count=%lu@%lu, pages=%ld\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(unsigned long) count, (unsigned long) *ppos, dentry->d_inode->i_nrpages);
-#endif
+	VERBOSE("smb_file_write: file %s/%s, count=%lu@%lu, pages=%ld\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		(unsigned long) count, (unsigned long) *ppos,
+		dentry->d_inode->i_nrpages);
 
 	result = smb_revalidate_inode(dentry);
 	if (result)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_file_write: %s/%s validation failed, error=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, result);
-#endif
+		PARANOIA("smb_file_write: %s/%s validation failed, error=%d\n",
+			 dentry->d_parent->d_name.name, dentry->d_name.name,
+			 result);
 			goto out;
 	}
 
@@ -290,11 +278,9 @@
 	if (count > 0)
 	{
 		result = generic_file_write(file, buf, count, ppos);
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_write: pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
-(long) file->f_pos, dentry->d_inode->i_size, dentry->d_inode->i_mtime,
-dentry->d_inode->i_atime);
-#endif
+		VERBOSE("smb_file_write: pos=%ld, size=%ld, mtime=%ld, atime=%ld\n",
+			(long) file->f_pos, dentry->d_inode->i_size,
+			dentry->d_inode->i_mtime, dentry->d_inode->i_atime);
 	}
 out:
 	return result;
@@ -303,11 +289,9 @@
 static int
 smb_file_open(struct inode *inode, struct file * file)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_open: opening %s/%s, d_count=%d\n",
-file->f_dentry->d_parent->d_name.name, file->f_dentry->d_name.name,
-file->f_dentry->d_count);
-#endif
+	VERBOSE("smb_file_open: opening %s/%s, d_count=%d\n",
+		file->f_dentry->d_parent->d_name.name,
+		file->f_dentry->d_name.name, file->f_dentry->d_count);
 	return 0;
 }
 
@@ -316,10 +300,9 @@
 {
 	struct dentry * dentry = file->f_dentry;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_release: closing %s/%s, d_count=%d\n",
-dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count);
-#endif
+	VERBOSE("smb_file_release: closing %s/%s, d_count=%d\n",
+		dentry->d_parent->d_name.name, dentry->d_name.name,
+		dentry->d_count);
 	
 	if (dentry->d_count == 1)
 	{
@@ -339,9 +322,8 @@
 	int mode = inode->i_mode;
 	int error = 0;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_file_permission: mode=%x, mask=%x\n", mode, mask);
-#endif
+	VERBOSE("smb_file_permission: mode=%x, mask=%x\n", mode, mask);
+
 	/* Look at user permissions */
 	mode >>= 6;
 	if ((mode & 7 & mask) != mask)
diff -urN linux-2.2.17-pre9/fs/smbfs/inode.c linux/fs/smbfs/inode.c
--- linux-2.2.17-pre9/fs/smbfs/inode.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/inode.c	Mon Dec  3 22:08:37 2001
@@ -31,6 +31,8 @@
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_VERBOSE 1 */
 
+#include "smb_debug.h"
+
 static void smb_read_inode(struct inode *);
 static void smb_put_inode(struct inode *);
 static void smb_delete_inode(struct inode *);
@@ -74,7 +76,7 @@
 {
 	struct inode *result;
 
-	pr_debug("smb_iget: %p\n", fattr);
+	DEBUG1("smb_iget: %p\n", fattr);
 
 	result = get_empty_inode();
 	result->i_sb = sb;
@@ -155,7 +157,8 @@
 smb_read_inode(struct inode *inode)
 {
 	/* Now it can be called only by NFS */
-	printk("smb_read_inode called from invalid point\n");
+	/* FIXME! what does that comment mean!? */
+	PARANOIA("smb_read_inode called from invalid point\n");
 	return;
 }
 
@@ -166,9 +169,7 @@
 void
 smb_invalidate_inodes(struct smb_sb_info *server)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_invalidate_inodes\n");
-#endif
+	VERBOSE("smb_invalidate_inodes\n");
 	shrink_dcache_sb(SB_of(server));
 	invalidate_inodes(SB_of(server));
 }
@@ -203,11 +204,11 @@
 			 * To limit damage, mark the inode as bad so that
 			 * subsequent lookup validations will fail.
 			 */
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_refresh_inode: %s/%s changed mode, %07o to %07o\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-inode->i_mode, fattr.f_mode);
-#endif
+			PARANOIA("smb_refresh_inode: %s/%s changed mode, %07o to %07o\n",
+				 dentry->d_parent->d_name.name,
+				 dentry->d_name.name,
+				 inode->i_mode, fattr.f_mode);
+
 			fattr.f_mode = inode->i_mode; /* save mode */
 			make_bad_inode(inode);
 			inode->i_mode = fattr.f_mode; /* restore mode */
@@ -238,7 +239,8 @@
 	time_t last_time;
 	int error = 0;
 
-	pr_debug("smb_revalidate_inode\n");
+	DEBUG1("smb_revalidate_inode\n");
+
 	/*
 	 * If this is a file opened with write permissions,
 	 * the inode will be up-to-date.
@@ -254,10 +256,8 @@
 	 */
 	if (time_before(jiffies, inode->u.smbfs_i.oldmtime + HZ/10))
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_revalidate_inode: up-to-date, jiffies=%lu, oldtime=%lu\n",
-jiffies, inode->u.smbfs_i.oldmtime);
-#endif
+		VERBOSE("smb_revalidate_inode: up-to-date, jiffies=%lu, oldtime=%lu\n",
+			jiffies, inode->u.smbfs_i.oldmtime);
 		goto out;
 	}
 
@@ -269,11 +269,9 @@
 	error = smb_refresh_inode(dentry);
 	if (error || inode->i_mtime != last_time)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_revalidate: %s/%s changed, old=%ld, new=%ld\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(long) last_time, (long) inode->i_mtime);
-#endif
+		VERBOSE("smb_revalidate: %s/%s changed, old=%ld, new=%ld\n",
+			dentry->d_parent->d_name.name, dentry->d_name.name,
+			(long) last_time, (long) inode->i_mtime);
 		if (!S_ISDIR(inode->i_mode))
 			invalidate_inode_pages(inode);
 	}
@@ -288,7 +286,7 @@
 static void
 smb_put_inode(struct inode *ino)
 {
-	pr_debug("smb_put_inode: count = %d\n", ino->i_count);
+	DEBUG1("smb_put_inode: count = %d\n", ino->i_count);
 	if (ino->i_count == 1)
 		ino->i_nlink = 0;
 }
@@ -300,10 +298,10 @@
 static void
 smb_delete_inode(struct inode *ino)
 {
-	pr_debug("smb_delete_inode\n");
+	DEBUG1("smb_delete_inode\n");
 	if (smb_close(ino))
-		printk(KERN_DEBUG "smb_delete_inode: could not close inode %ld\n",
-			ino->i_ino);
+		PARANOIA("smb_delete_inode: could not close inode %ld\n",
+			 ino->i_ino);
 	clear_inode(ino);
 }
 
@@ -461,11 +459,9 @@
 
 	if ((attr->ia_valid & ATTR_SIZE) != 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_notify_change: changing %s/%s, old size=%ld, new size=%ld\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(long) inode->i_size, (long) attr->ia_size);
-#endif
+		VERBOSE("smb_notify_change: changing %s/%s, old size=%ld, new size=%ld\n",
+			dentry->d_parent->d_name.name, dentry->d_name.name,
+			(long) inode->i_size, (long) attr->ia_size);
 		error = smb_open(dentry, O_WRONLY);
 		if (error)
 			goto out;
@@ -517,10 +513,9 @@
 	 */
 	if ((attr->ia_valid & ATTR_MODE) != 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-		printk(KERN_DEBUG "smb_notify_change: %s/%s mode change, old=%x, new=%lx\n",
-		       dentry->d_parent->d_name.name, dentry->d_name.name, fattr.f_mode,attr->ia_mode);
-#endif
+		VERBOSE("smb_notify_change: %s/%s mode change, old=%x, new=%lx\n",
+			dentry->d_parent->d_name.name, dentry->d_name.name,
+			fattr.f_mode,attr->ia_mode);
 		changed = 0;
 		if (attr->ia_mode & S_IWUSR)
 		{
@@ -577,7 +572,7 @@
 int
 init_module(void)
 {
-	pr_debug("smbfs: init_module called\n");
+	DEBUG1("smbfs: init_module called\n");
 
 #ifdef DEBUG_SMB_MALLOC
 	smb_malloced = 0;
@@ -591,7 +586,7 @@
 void
 cleanup_module(void)
 {
-	pr_debug("smbfs: cleanup_module called\n");
+	DEBUG1("smbfs: cleanup_module called\n");
 	unregister_filesystem(&smb_fs_type);
 #ifdef DEBUG_SMB_MALLOC
 	printk(KERN_DEBUG "smb_malloced: %d\n", smb_malloced);
diff -urN linux-2.2.17-pre9/fs/smbfs/ioctl.c linux/fs/smbfs/ioctl.c
--- linux-2.2.17-pre9/fs/smbfs/ioctl.c	Thu Dec 11 11:25:54 1997
+++ linux/fs/smbfs/ioctl.c	Mon Dec  3 22:08:37 2001
@@ -17,6 +17,7 @@
 
 #include <asm/uaccess.h>
 
+
 int
 smb_ioctl(struct inode *inode, struct file *filp,
 	  unsigned int cmd, unsigned long arg)
@@ -34,24 +35,18 @@
 	{
 		struct smb_conn_opt opt;
 
-		if (arg)
-		{
-			result = -EFAULT;
-			if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
-				result = smb_newconn(server, &opt);
-		}
-		else
-		{
-#if 0
-			/* obsolete option ... print a warning */
-			printk("SMBFS: ioctl deprecated, please upgrade "
-				"smbfs package\n");
-#endif
-			result = 0;
-		}
+		/* require an argument == the mount data, else it is EINVAL */
+		if (!arg)
+			goto out;
+
+		result = -EFAULT;
+		if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
+			result = smb_newconn(server, &opt);
 		break;
 	}
 	default:
 	}
+
+out:
 	return result;
 }
diff -urN linux-2.2.17-pre9/fs/smbfs/proc.c linux/fs/smbfs/proc.c
--- linux-2.2.17-pre9/fs/smbfs/proc.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/proc.c	Mon Dec  3 22:08:37 2001
@@ -15,8 +15,8 @@
  *  Jan 2000, cpg@aladdin.de
  *           - added posix semantics for unlink
  *  March 2000, tridge
- *           - removed support for old protocol levels. It didn't work anyway and 
- *             was cluttering things up a lot. 
+ *           - removed support for old protocol levels. It didn't work anyway 
+ *             and was cluttering things up a lot. 
  */
 
 #include <linux/types.h>
@@ -35,11 +35,15 @@
 
 #include <asm/string.h>
 
+/* Features. Undefine if they cause problems, this should perhaps be a
+   config option. */
+#define SMBFS_POSIX_UNLINK 1
+
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_TIMESTAMP 1 */
 /* #define SMBFS_DEBUG_VERBOSE 1 */
-/* #define pr_debug printk */
-#define SMBFS_POSIX_UNLINK 1
+
+#include "smb_debug.h"
 
 #define SMB_VWV(packet)  ((packet) + SMB_HEADER_LEN)
 #define SMB_CMD(packet)  (*(packet+8))
@@ -50,8 +54,10 @@
 #define SMB_DIRINFO_SIZE 43
 #define SMB_STATUS_SIZE  21
 
-/* yes, this deliberately has two parts */
-#define DENTRY_PATH(dentry) (dentry)->d_parent->d_name.name,(dentry)->d_name.name
+/* This makes a dentry parent/child pair. Useful for debugging printk's */
+#define DENTRY_PATH(dentry) \
+	(dentry)->d_parent->d_name.name,(dentry)->d_name.name
+
 
 static int smb_proc_setattr_ext(struct smb_sb_info *, struct inode *,
 				struct smb_fattr *);
@@ -273,15 +279,15 @@
 	return 0;
 
 bad_command:
-	printk("smb_verify: command=%x, SMB_CMD=%x??\n",
+	printk(KERN_ERR "smb_verify: command=%x, SMB_CMD=%x??\n",
 		command, SMB_CMD(packet));
 	goto fail;
 bad_wct:
-	printk("smb_verify: command=%x, wct=%d, SMB_WCT=%d??\n",
+	printk(KERN_ERR "smb_verify: command=%x, wct=%d, SMB_WCT=%d??\n",
 		command, wct, SMB_WCT(packet));
 	goto fail;
 bad_bcc:
-	printk("smb_verify: command=%x, bcc=%d, SMB_BCC=%d??\n",
+	printk(KERN_ERR "smb_verify: command=%x, bcc=%d, SMB_BCC=%d??\n",
 		command, bcc, SMB_BCC(packet));
 fail:
 	return -EIO;
@@ -314,10 +320,8 @@
 {
 	int overhead = SMB_HEADER_LEN + 5 * sizeof(__u16) + 2 + 1 + 2;
 	int size = smb_get_xmitsize(server, overhead);
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_get_rsize: packet=%d, xmit=%d, size=%d\n",
-server->packet_size, server->opt.max_xmit, size);
-#endif
+	VERBOSE("smb_get_rsize: packet=%d, xmit=%d, size=%d\n",
+		server->packet_size, server->opt.max_xmit, size);
 	return size;
 }
 
@@ -329,10 +333,8 @@
 {
 	int overhead = SMB_HEADER_LEN + 5 * sizeof(__u16) + 2 + 1 + 2;
 	int size = smb_get_xmitsize(server, overhead);
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_get_wsize: packet=%d, xmit=%d, size=%d\n",
-server->packet_size, server->opt.max_xmit, size);
-#endif
+	VERBOSE("smb_get_wsize: packet=%d, xmit=%d, size=%d\n",
+		server->packet_size, server->opt.max_xmit, size);
 	return size;
 }
 
@@ -343,10 +345,8 @@
 	int error  = server->err;
 	char *class = "Unknown";
 
-#ifdef SMBFS_DEBUG_VERBOSE
-	printk("smb_errno: errcls %d  code %d  from command 0x%x\n",
+	VERBOSE("smb_errno: errcls %d  code %d  from command 0x%x\n",
 		errcls, error, SMB_CMD(server->packet));
-#endif
 
 	if (errcls == ERRDOS)
 		switch (error)
@@ -449,8 +449,8 @@
 		class = "ERRCMD";
 
 err_unknown:
-	printk("smb_errno: class %s, code %d from command 0x%x\n",
-		class, error, SMB_CMD(server->packet));
+	printk(KERN_ERR "smb_errno: class %s, code %d from command 0x%x\n",
+	       class, error, SMB_CMD(server->packet));
 	return EIO;
 }
 
@@ -487,7 +487,7 @@
 
 	if (pid == 0)
 	{
-		printk("smb_retry: no connection process\n");
+		printk(KERN_ERR "smb_retry: no connection process\n");
 		server->state = CONN_RETRIED;
 		goto out;
 	}
@@ -503,29 +503,26 @@
 	error = kill_proc(pid, SIGUSR1, 1);
 	if (error)
 	{
-		printk("smb_retry: signal failed, error=%d\n", error);
+		printk(KERN_ERR "smb_retry: signal failed, error=%d\n", error);
 		goto out_restore;
 	}
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_retry: signalled pid %d, waiting for new connection\n",
-server->conn_pid);
-#endif
+	VERBOSE("smb_retry: signalled pid %d, waiting for new connection\n",
+		server->conn_pid);
+
 	/*
 	 * Wait for the new connection.
 	 */
 	interruptible_sleep_on_timeout(&server->wait,  5*HZ);
 	if (signal_pending(current))
-		printk("smb_retry: caught signal\n");
+		printk(KERN_INFO "smb_retry: caught signal\n");
 
 	/*
 	 * Check for a valid connection.
 	 */
 	if (server->state == CONN_VALID)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_retry: new pid=%d, generation=%d\n",
-server->conn_pid, server->generation);
-#endif
+		PARANOIA("smb_retry: new pid=%d, generation=%d\n",
+			 server->conn_pid, server->generation);
 		result = 1;
 	}
 
@@ -562,14 +559,12 @@
 
 	if (smb_request(s) < 0)
 	{
-		pr_debug("smb_request failed\n");
+		DEBUG1("smb_request failed\n");
 		goto out;
 	}
 	if (smb_valid_packet(s->packet) != 0)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_request_ok: invalid packet!\n");
-#endif
+		PARANOIA("smb_request_ok: invalid packet!\n");
 		goto out;
 	}
 
@@ -610,9 +605,8 @@
 	struct file *filp;
 	int error;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_newconn: fd=%d, pid=%d\n", opt->fd, current->pid);
-#endif
+	VERBOSE("smb_newconn: fd=%d, pid=%d\n", opt->fd, current->pid);
+
 	/*
 	 * Make sure we don't already have a pid ...
 	 */
@@ -626,7 +620,7 @@
 		goto out;
 
 	if (opt->protocol < SMB_PROTOCOL_NT1) {
-		printk(KERN_NOTICE " smbfs: protocols older than NT1 are not suppported\n");
+		printk(KERN_NOTICE "smbfs: protocols older than NT1 are not suppported\n");
 		goto out;
 	}
 
@@ -660,11 +654,9 @@
 #endif
 	}
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_newconn: protocol=%d, max_xmit=%d, pid=%d capabilities=0x%x\n",
-       server->opt.protocol, server->opt.max_xmit, server->conn_pid,
-       server->opt.capabilities);
-#endif
+	VERBOSE("smb_newconn: protocol=%d, max_xmit=%d, pid=%d capabilities=0x%x\n",
+		server->opt.protocol, server->opt.max_xmit, server->conn_pid,
+		server->opt.capabilities);
 
 out:
 	wake_up_interruptible(&server->wait);
@@ -685,9 +677,9 @@
 	__u8 *p = server->packet;
 	__u8 *buf = server->packet;
 
-if (xmit_len > server->packet_size)
-printk(KERN_DEBUG "smb_setup_header: Aieee, xmit len > packet! len=%d, size=%d\n",
-xmit_len, server->packet_size);
+	if (xmit_len > server->packet_size)
+		printk(KERN_DEBUG "smb_setup_header: Aieee, xmit len > packet! len=%d, size=%d\n",
+		       xmit_len, server->packet_size);
 
 	p = smb_encode_smb_length(p, xmit_len - 4);
 
@@ -765,10 +757,8 @@
 		if (mode == read_write &&
 		    (error == -EACCES || error == -ETXTBSY || error == -EROFS))
 		{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_open: %s/%s R/W failed, error=%d, retrying R/O\n",
-       DENTRY_PATH(dentry), error);
-#endif
+			VERBOSE("smb_proc_open: %s/%s R/W failed, error=%d, retrying R/O\n",
+				DENTRY_PATH(dentry), error);
 			mode = read_only;
 			goto retry;
 		}
@@ -800,7 +790,7 @@
 	result = -ENOENT;
 	if (!inode)
 	{
-		printk(KERN_DEBUG "smb_open: no inode for dentry %s/%s\n",
+		printk(KERN_ERR "smb_open: no inode for dentry %s/%s\n",
 		       DENTRY_PATH(dentry));
 		goto out;
 	}
@@ -820,10 +810,8 @@
 		smb_unlock_server(server);
 		if (result)
 		{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_open: %s/%s open failed, result=%d\n",
-       DENTRY_PATH(dentry), result);
-#endif
+			PARANOIA("smb_open: %s/%s open failed, result=%d\n",
+				 DENTRY_PATH(dentry), result);
 			goto out;
 		}
 		/*
@@ -839,10 +827,8 @@
 	if (inode->u.smbfs_i.access != wish && 
 	    inode->u.smbfs_i.access != SMB_O_RDWR)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_open: %s/%s access denied, access=%x, wish=%x\n",
-       DENTRY_PATH(dentry), inode->u.smbfs_i.access, wish);
-#endif
+		PARANOIA("smb_open: %s/%s access denied, access=%x, wish=%x\n",
+			 DENTRY_PATH(dentry), inode->u.smbfs_i.access, wish);
 		result = -EACCES;
 	}
 out:
@@ -950,18 +936,14 @@
 			 */
 			if (dentry->d_count <= 1)
 			{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_close_dentry: closing %s/%s, count=%d\n",
-       DENTRY_PATH(dentry), dentry->d_count);
-#endif
+				VERBOSE("smb_close_dentry: closing %s/%s, count=%d\n",
+					DENTRY_PATH(dentry), dentry->d_count);
 				smb_proc_close_inode(server, ino);
 			}
 			smb_unlock_server(server);
 		}
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_close_dentry: closed %s/%s, count=%d\n",
-       DENTRY_PATH(dentry), dentry->d_count);
-#endif
+		VERBOSE("smb_close_dentry: closed %s/%s, count=%d\n",
+			DENTRY_PATH(dentry), dentry->d_count);
 	}
 }
 
@@ -1018,10 +1000,8 @@
 	result = data_len;
 
 out:
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_read: file %s/%s, count=%d, result=%d\n",
-       DENTRY_PATH(dentry), count, result);
-#endif
+	VERBOSE("smb_proc_read: file %s/%s, count=%d, result=%d\n",
+		DENTRY_PATH(dentry), count, result);
 	smb_unlock_server(server);
 	return result;
 }
@@ -1033,10 +1013,9 @@
 	int result;
 	__u8 *p;
 
-#if SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_write: file %s/%s, count=%d@%ld, packet_size=%d\n",
-       DENTRY_PATH(dentry), count, offset, server->packet_size);
-#endif
+	VERBOSE("smb_proc_write: file %s/%s, count=%d@%ld, packet_size=%d\n",
+		DENTRY_PATH(dentry), count, offset, server->packet_size);
+
 	smb_lock_server(server);
 	p = smb_setup_header(server, SMBwrite, 5, count + 3);
 	WSET(server->packet, smb_vwv0, dentry->d_inode->u.smbfs_i.fileid);
@@ -1218,7 +1197,9 @@
 			   lead to a file being written by someone who
 			   shouldn't have access, but as far as I can
 			   tell that is unavoidable */
-                        result = smb_set_rw(dentry,server); /* remove RONLY attribute */
+
+			/* remove RONLY attribute */
+                        result = smb_set_rw(dentry,server);
                         if (result == 0) {
                                 flag = 1;
                                 goto retry;                 /* and try again */
@@ -1338,10 +1319,9 @@
 	if (len && entry->name[len-1] == '\0')
 		len--;
 	entry->len = len;
-#ifdef SMBFS_DEBUG_VERBOSE
-	printk(KERN_DEBUG "smb_decode_long_dirent: info 260 at %p, len=%d, name=%s\n",
-	       p, entry->len, entry->name);
-#endif
+
+	VERBOSE("smb_decode_long_dirent: info 260 at %p, len=%d, name=%s\n",
+		p, entry->len, entry->name);
 
 	return result;
 }
@@ -1389,9 +1369,10 @@
 	mask = param + 12;
 	mask_len = smb_encode_path(server, mask, dir, &star) - mask;
 	first = 1;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_readdir_long: starting fpos=%d, mask=%s\n", fpos, mask);
-#endif
+
+	VERBOSE("smb_proc_readdir_long: starting fpos=%d, mask=%s\n",
+		fpos, mask);
+
 	/*
 	 * We must reinitialize the dircache when retrying.
 	 */
@@ -1427,10 +1408,10 @@
 			mask[0] = 0;
 
 			command = TRANSACT2_FINDNEXT;
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_readdir_long: handle=0x%X, mask=%s\n",
-ff_dir_handle, mask);
-#endif
+
+			VERBOSE("smb_proc_readdir_long: handle=0x%X, mask=%s\n",
+				ff_dir_handle, mask);
+
 			WSET(param, 0, ff_dir_handle);	/* search handle */
 			WSET(param, 2, max_matches);	/* max count */
 			WSET(param, 4, info_level);
@@ -1448,14 +1429,10 @@
 		{
 			if (smb_retry(server))
 			{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_proc_readdir_long: error=%d, retrying\n", result);
-#endif
+				PARANOIA("smb_proc_readdir_long: error=%d, retrying\n", result);
 				goto retry;
 			}
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_proc_readdir_long: error=%d, breaking\n", result);
-#endif
+			PARANOIA("smb_proc_readdir_long: error=%d, breaking\n", result);
 			entries = result;
 			break;
 		}
@@ -1471,10 +1448,8 @@
 
 		if (server->rcls != 0)
 		{ 
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_proc_readdir_long: name=%s, entries=%d, rcls=%d, err=%d\n",
-mask, entries, server->rcls, server->err);
-#endif
+			PARANOIA("smb_proc_readdir_long: name=%s, entries=%d, rcls=%d, err=%d\n",
+				 mask, entries, server->rcls, server->err);
 			entries = -smb_errno(server);
 			break;
 		}
@@ -1522,10 +1497,9 @@
  			entries_seen++;
 		}
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_readdir_long: received %d entries, eos=%d\n",
-       ff_searchcount, ff_eos);
-#endif
+		VERBOSE("smb_proc_readdir_long: received %d entries, eos=%d\n",
+			ff_searchcount, ff_eos);
+
 		first = 0;
 		loop_count = 0;
 	}
@@ -1580,8 +1554,8 @@
 	fattr->f_atime = fattr->f_mtime; 
 	fattr->f_size  = DVAL(server->packet, smb_vwv3);
 #ifdef SMBFS_DEBUG_TIMESTAMP
-printk(KERN_DEBUG "getattr_core: %s/%s, mtime=%ld\n",
-       DENTRY_PATH(dir), fattr->f_mtime);
+	printk(KERN_DEBUG "getattr_core: %s/%s, mtime=%ld\n",
+	       DENTRY_PATH(dir), fattr->f_mtime);
 #endif
 	result = 0;
 
@@ -1625,20 +1599,16 @@
 	}
 	if (server->rcls != 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_getattr_trans2: for %s: result=%d, rcls=%d, err=%d\n",
-&param[6], result, server->rcls, server->err);
-#endif
+		VERBOSE("smb_proc_getattr_trans2: for %s: result=%d, rcls=%d, err=%d\n",
+			&param[6], result, server->rcls, server->err);
 		result = -smb_errno(server);
 		goto out;
 	}
 	result = -ENOENT;
 	if (resp_data_len < 22)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_proc_getattr_trans2: not enough data for %s, len=%d\n",
-&param[6], resp_data_len);
-#endif
+		PARANOIA("smb_proc_getattr_trans2: not enough data for %s, len=%d\n",
+			 &param[6], resp_data_len);
 		goto out;
 	}
 
@@ -1662,8 +1632,8 @@
 	time = WVAL(resp_data, 8 + off_time);
 	attr->f_mtime = date_dos2unix(server, date, time);
 #ifdef SMBFS_DEBUG_TIMESTAMP
-printk(KERN_DEBUG "getattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n",
-       DENTRY_PATH(dir), date, time, attr->f_mtime);
+	printk(KERN_DEBUG "getattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n",
+	       DENTRY_PATH(dir), date, time, attr->f_mtime);
 #endif
 	attr->f_size = DVAL(resp_data, 12);
 	attr->attr = WVAL(resp_data, 20);
@@ -1770,10 +1740,9 @@
 	struct smb_sb_info *server = server_from_dentry(dir);
 	int result;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_setattr: setting %s/%s, open=%d\n", 
-       DENTRY_PATH(dir), smb_is_open(dir->d_inode));
-#endif
+	VERBOSE("smb_proc_setattr: setting %s/%s, open=%d\n", 
+		DENTRY_PATH(dir), smb_is_open(dir->d_inode));
+
 	smb_lock_server(server);
 	result = smb_proc_setattr_core(server, dir, fattr->attr);
 	smb_unlock_server(server);
@@ -1803,9 +1772,10 @@
 	date_unix2dos(server, fattr->f_mtime, &date, &time);
 	WSET(server->packet, smb_vwv5, date);
 	WSET(server->packet, smb_vwv6, time);
+
 #ifdef SMBFS_DEBUG_TIMESTAMP
-printk(KERN_DEBUG "smb_proc_setattr_ext: date=%d, time=%d, mtime=%ld\n", 
-date, time, fattr->f_mtime);
+	printk(KERN_DEBUG "smb_proc_setattr_ext: date=%d, time=%d, mtime=%ld\n", 
+	       date, time, fattr->f_mtime);
 #endif
 
 	result = smb_request_ok(server, SMBsetattrE, 0, 0);
@@ -1853,10 +1823,12 @@
 	date_unix2dos(server, fattr->f_mtime, &date, &time);
 	WSET(data, 8, date);
 	WSET(data, 10, time);
+
 #ifdef SMBFS_DEBUG_TIMESTAMP
-printk(KERN_DEBUG "setattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n", 
-       DENTRY_PATH(dir), date, time, fattr->f_mtime);
+	printk(KERN_DEBUG "setattr_trans2: %s/%s, date=%x, time=%x, mtime=%ld\n", 
+	       DENTRY_PATH(dir), date, time, fattr->f_mtime);
 #endif
+
 	DSET(data, 12, 0); /* size */
 	DSET(data, 16, 0); /* blksize */
 	WSET(data, 20, 0); /* attr */
@@ -1900,10 +1872,9 @@
 	struct inode *inode = dentry->d_inode;
 	int result;
 
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_settime: setting %s/%s, open=%d\n", 
-       DENTRY_PATH(dentry), smb_is_open(inode));
-#endif
+	VERBOSE("smb_proc_settime: setting %s/%s, open=%d\n", 
+		DENTRY_PATH(dentry), smb_is_open(inode));
+
 	smb_lock_server(server);
 	/* setting the time on a Win95 server fails (tridge) */
 	if (!(server->mnt->version & SMB_FIX_WIN95))
diff -urN linux-2.2.17-pre9/fs/smbfs/smb_debug.h linux/fs/smbfs/smb_debug.h
--- linux-2.2.17-pre9/fs/smbfs/smb_debug.h	Wed Dec 31 16:00:00 1969
+++ linux/fs/smbfs/smb_debug.h	Mon Dec  3 22:08:37 2001
@@ -0,0 +1,30 @@
+/*
+ * Defines some debug macros for smbfs.
+ */
+
+/*
+ * safety checks that should never happen ??? 
+ * these are normally enabled.
+ */
+#ifdef SMBFS_PARANOIA
+#define PARANOIA(x...) printk(KERN_NOTICE ## x);
+#else
+#define PARANOIA(x...) do { ; } while(0)
+#endif
+
+/* lots of debug messages */
+#ifdef SMBFS_DEBUG_VERBOSE
+#define VERBOSE(x...) printk(KERN_DEBUG ## x);
+#else
+#define VERBOSE(x...) do { ; } while(0)
+#endif
+
+/*
+ * "normal" debug messages, but not with a normal DEBUG define ... way
+ * too common name.
+ */
+#ifdef SMBFS_DEBUG
+#define DEBUG1(x...) printk(KERN_DEBUG ## x);
+#else
+#define DEBUG1(x...) do { ; } while(0)
+#endif
diff -urN linux-2.2.17-pre9/fs/smbfs/sock.c linux/fs/smbfs/sock.c
--- linux-2.2.17-pre9/fs/smbfs/sock.c	Wed Jun  7 14:26:44 2000
+++ linux/fs/smbfs/sock.c	Mon Dec  3 22:08:37 2001
@@ -28,6 +28,8 @@
 #define SMBFS_PARANOIA 1
 /* #define SMBFS_DEBUG_VERBOSE 1 */
 
+#include "smb_debug.h"
+
 static int
 _recvfrom(struct socket *socket, unsigned char *ubuf, int size,
 	  unsigned flags)
@@ -118,9 +120,7 @@
 		result = -EIO;
 		if (job->sk->dead)
 		{
-#ifdef SMBFS_PARANOIA
-			printk(KERN_DEBUG "smb_data_callback: sock dead!\n");
-#endif
+			PARANOIA("smb_data_callback: sock dead!\n");
 			break;
 		}
 
@@ -135,7 +135,7 @@
 		result = _recvfrom(socket, (void *) peek_buf, 4,
 				   MSG_DONTWAIT);
 
-		pr_debug("smb_data_callback: got SESSION KEEPALIVE\n");
+		DEBUG1("smb_data_callback: got SESSION KEEPALIVE\n");
 
 		if (result == -EAGAIN)
 			break;
@@ -182,7 +182,7 @@
 	{
 #ifdef SMBFS_PARANOIA
 		if (!smb_valid_socket(file->f_dentry->d_inode))
-			printk(KERN_DEBUG "smb_server_sock: bad socket!\n");
+			PARANOIA("smb_server_sock: bad socket!\n");
 #endif
 		return &file->f_dentry->d_inode->u.socket_i;
 	}
@@ -209,13 +209,13 @@
 	sk = socket->sk;
 	if (sk == NULL)
 	{
-		pr_debug("smb_catch_keepalive: sk == NULL");
+		DEBUG1("smb_catch_keepalive: sk == NULL");
 		server->data_ready = NULL;
 		goto out;
 	}
-	pr_debug("smb_catch_keepalive.: sk->d_r = %x, server->d_r = %x\n",
-		 (unsigned int) (sk->data_ready),
-		 (unsigned int) (server->data_ready));
+	DEBUG1("smb_catch_keepalive.: sk->d_r = %x, server->d_r = %x\n",
+	       (unsigned int) (sk->data_ready),
+	       (unsigned int) (server->data_ready));
 
 	/*
 	 * Install the callback atomically to avoid races ...
@@ -290,12 +290,11 @@
 
 	if (file)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_close_socket: closing socket %p\n", server_sock(server));
-#endif
+		VERBOSE("smb_close_socket: closing socket %p\n",
+			server_sock(server));
 #ifdef SMBFS_PARANOIA
-if (server_sock(server)->sk->data_ready == smb_data_ready)
-printk(KERN_DEBUG "smb_close_socket: still catching keepalives!\n");
+		if (server_sock(server)->sk->data_ready == smb_data_ready)
+			PARANOIA("smb_close_socket: still catching keepalives!\n");
 #endif
 		server->sock_file = NULL;
 		fput(file);
@@ -320,8 +319,7 @@
 		}
 		if (result < 0)
 		{
-			pr_debug("smb_send_raw: sendto error = %d\n",
-				 -result);
+			DEBUG1("smb_send_raw: sendto error = %d\n", -result);
 			return result;
 		}
 		already_sent += result;
@@ -347,8 +345,8 @@
 		}
 		if (result < 0)
 		{
-			pr_debug("smb_receive_raw: recvfrom error = %d\n",
-				 -result);
+			DEBUG1("smb_receive_raw: recvfrom error = %d\n",
+			       -result);
 			return result;
 		}
 		already_read += result;
@@ -371,9 +369,7 @@
 
 	if (result < 0)
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_get_length: recv error = %d\n", -result);
-#endif
+		PARANOIA("smb_get_length: recv error = %d\n", -result);
 		return result;
 	}
 	switch (peek_buf[0])
@@ -383,13 +379,12 @@
 		break;
 
 	case 0x85:
-		pr_debug("smb_get_length: Got SESSION KEEP ALIVE\n");
+		DEBUG1("smb_get_length: Got SESSION KEEP ALIVE\n");
 		goto re_recv;
 
 	default:
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_get_length: Invalid NBT packet, code=%x\n", peek_buf[0]);
-#endif
+		PARANOIA("smb_get_length: Invalid NBT packet, code=%x\n",
+			 peek_buf[0]);
 		return -EIO;
 	}
 
@@ -448,17 +443,16 @@
 	result = smb_receive_raw(socket, packet + 4, len);
 	if (result < 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_receive: receive error: %d\n", result);
-#endif
+		VERBOSE("smb_receive: receive error: %d\n", result);
 		goto out;
 	}
 	server->rcls = *(packet + smb_rcls);
 	server->err  = WVAL(packet, smb_err);
 
 #ifdef SMBFS_DEBUG_VERBOSE
-if (server->rcls != 0)
-printk(KERN_DEBUG "smb_receive: rcls=%d, err=%d\n", server->rcls, server->err);
+	if (server->rcls != 0)
+		VERBOSE("smb_receive: rcls=%d, err=%d\n",
+			server->rcls, server->err);
 #endif
 out:
 	return result;
@@ -521,10 +515,10 @@
 			 */
 			if (parm_count == parm_tot && data_count == data_tot)
 			{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_receive_trans2: fast track, parm=%u %u %u, data=%u %u %u\n",
-parm_disp, parm_offset, parm_count, data_disp, data_offset, data_count);
-#endif
+				VERBOSE("smb_receive_trans2: fast track, parm=%u %u %u, data=%u %u %u\n",
+					parm_disp, parm_offset, parm_count, 
+					data_disp, data_offset, data_count);
+
 				*parm  = base + parm_offset;
 				*data  = base + data_offset;
 				goto success;
@@ -561,10 +555,9 @@
 		memcpy(*parm + parm_disp, base + parm_offset, parm_count);
 		memcpy(*data + data_disp, base + data_offset, data_count);
 
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_receive_trans2: copied, parm=%u of %u, data=%u of %u\n",
-parm_len, parm_tot, data_len, data_tot);
-#endif
+		PARANOIA("smb_receive_trans2: copied, parm=%u of %u, data=%u of %u\n",
+			 parm_len, parm_tot, data_len, data_tot);
+
 		/*
 		 * Check whether we've received all of the data. Note that
 		 * we use the packet totals -- total lengths might shrink!
@@ -586,10 +579,8 @@
 		rcv_buf = inbuf;
 	} else
 	{
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_receive_trans2: copying data, old size=%d, new size=%u\n",
-server->packet_size, buf_len);
-#endif
+		PARANOIA("smb_receive_trans2: copying data, old size=%d, new size=%u\n",
+			 server->packet_size, buf_len);
 		memcpy(inbuf, rcv_buf, parm_len + data_len);
 	}
 
@@ -602,25 +593,23 @@
 	return result;
 
 out_no_mem:
-#ifdef SMBFS_PARANOIA
-	printk(KERN_DEBUG "smb_receive_trans2: couldn't allocate data area\n");
-#endif
+	PARANOIA("smb_receive_trans2: couldn't allocate data area\n");
 	result = -ENOMEM;
 	goto out;
 out_too_long:
-	printk(KERN_DEBUG "smb_receive_trans2: data/param too long, data=%d, parm=%d\n",
-		data_tot, parm_tot);
+	printk(KERN_ERR "smb_receive_trans2: data/param too long, data=%d, parm=%d\n",
+	       data_tot, parm_tot);
 	goto out_error;
 out_data_grew:
-	printk(KERN_DEBUG "smb_receive_trans2: data/params grew!\n");
+	printk(KERN_ERR "smb_receive_trans2: data/params grew!\n");
 	goto out_error;
 out_bad_parm:
-	printk(KERN_DEBUG "smb_receive_trans2: invalid parms, disp=%d, cnt=%d, tot=%d\n",
-		parm_disp, parm_count, parm_tot);
+	printk(KERN_ERR "smb_receive_trans2: invalid parms, disp=%d, cnt=%d, tot=%d\n",
+	       parm_disp, parm_count, parm_tot);
 	goto out_error;
 out_bad_data:
-	printk(KERN_DEBUG "smb_receive_trans2: invalid data, disp=%d, cnt=%d, tot=%d\n",
-		data_disp, data_count, data_tot);
+	printk(KERN_ERR "smb_receive_trans2: invalid data, disp=%d, cnt=%d, tot=%d\n",
+	       data_disp, data_count, data_tot);
 out_error:
 	result = -EIO;
 	goto out;
@@ -651,7 +640,7 @@
 		goto bad_conn;
 
 	len = smb_len(buffer) + 4;
-	pr_debug("smb_request: len = %d cmd = 0x%X\n", len, buffer[8]);
+	DEBUG1("smb_request: len = %d cmd = 0x%X\n", len, buffer[8]);
 
 	spin_lock_irqsave(&current->sigmask_lock, flags);
 	sigpipe = sigismember(&current->signal, SIGPIPE);
@@ -684,7 +673,7 @@
 		int result2 = smb_catch_keepalive(server);
 		if (result2 < 0)
 		{
-			printk(KERN_DEBUG "smb_request: catch keepalive failed\n");
+			printk(KERN_ERR "smb_request: catch keepalive failed\n");
 			result = result2;
 		}
 	}
@@ -696,28 +685,27 @@
 	if (server->rcls) {
 		int error = smb_errno(server);
 		if (error == EBADSLT) {
-			printk(KERN_DEBUG "smb_request: tree ID invalid\n");
+			printk(KERN_ERR "smb_request: tree ID invalid\n");
 			result = error;
 			goto bad_conn;
 		}
 	}
 
 out:
-	pr_debug("smb_request: result = %d\n", result);
+	DEBUG1("smb_request: result = %d\n", result);
 	return result;
 	
 bad_conn:
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_request: result %d, setting invalid\n", result);
-#endif
+	PARANOIA("smb_request: result %d, setting invalid\n", result);
 	server->state = CONN_INVALID;
 	smb_invalidate_inodes(server);
 	goto out;		
 bad_no_packet:
-	printk(KERN_DEBUG "smb_request: no packet!\n");
+	printk(KERN_ERR "smb_request: no packet!\n");
 	goto out;
 bad_no_conn:
-	printk(KERN_DEBUG "smb_request: connection %d not valid!\n", server->state);
+	printk(KERN_ERR "smb_request: connection %d not valid!\n",
+	       server->state);
 	goto out;
 }
 
@@ -736,16 +724,15 @@
 
 	const int smb_parameters = 15;
 	const int oparam =
-	ROUND_UP(SMB_HEADER_LEN + 2 * smb_parameters + 2 + 3);
+		ROUND_UP(SMB_HEADER_LEN + 2 * smb_parameters + 2 + 3);
 	const int odata =
-	ROUND_UP(oparam + lparam);
+		ROUND_UP(oparam + lparam);
 	const int bcc =
-	odata + ldata - (SMB_HEADER_LEN + 2 * smb_parameters + 2);
+		odata + ldata - (SMB_HEADER_LEN + 2 * smb_parameters + 2);
 	const int packet_length =
-	SMB_HEADER_LEN + 2 * smb_parameters + bcc + 2;
+		SMB_HEADER_LEN + 2 * smb_parameters + bcc + 2;
 
-	unsigned char padding[4] =
-	{0,};
+	unsigned char padding[4] = {0,};
 	char *p;
 
 	struct iovec iov[4];
@@ -819,8 +806,8 @@
 	mm_segment_t fs;
 	int result;
 
-	pr_debug("smb_trans2_request: com=%d, ld=%d, lp=%d\n",
-		 trans2_command, ldata, lparam);
+	DEBUG1("smb_trans2_request: com=%d, ld=%d, lp=%d\n",
+	       trans2_command, ldata, lparam);
 
 	/*
 	 * These are initialized in smb_request_ok, but not here??
@@ -879,7 +866,7 @@
 	if (server->rcls) {
 		int error = smb_errno(server);
 		if (error == EBADSLT) {
-			printk(KERN_DEBUG "smb_request: tree ID invalid\n");
+			printk(KERN_ERR "smb_request: tree ID invalid\n");
 			result = error;
 			goto bad_conn;
 		}
@@ -889,9 +876,7 @@
 	return result;
 
 bad_conn:
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_trans2_request: result=%d, setting invalid\n", result);
-#endif
+	PARANOIA("smb_trans2_request: result=%d, setting invalid\n", result);
 	server->state = CONN_INVALID;
 	smb_invalidate_inodes(server);
 	goto out;
diff -urN linux-2.2.17-pre9/include/linux/i2o.h linux/include/linux/i2o.h
--- linux-2.2.17-pre9/include/linux/i2o.h	Wed Jun  7 14:26:44 2000
+++ linux/include/linux/i2o.h	Mon Dec  3 22:08:37 2001
@@ -91,6 +91,7 @@
 
 	struct i2o_controller *controller;	/* Controlling IOP */
 	struct i2o_device *next;	/* Chain */
+	struct i2o_device *prev;
 	char dev_name[8];		/* linux /dev name if available */
 };
 
diff -urN linux-2.2.17-pre9/include/linux/pci.h linux/include/linux/pci.h
--- linux-2.2.17-pre9/include/linux/pci.h	Mon Dec  3 22:08:23 2001
+++ linux/include/linux/pci.h	Mon Dec  3 22:08:37 2001
@@ -377,6 +377,7 @@
 #define PCI_DEVICE_ID_DEC_21153		0x0025
 #define PCI_DEVICE_ID_DEC_21154		0x0026
 #define PCI_DEVICE_ID_DEC_21285		0x1065
+#define PCI_DEVICE_ID_DEC_21554		0x0046
 #define PCI_DEVICE_ID_COMPAQ_42XX	0x0046
 
 #define PCI_VENDOR_ID_CIRRUS		0x1013
diff -urN linux-2.2.17-pre9/net/core/sock.c linux/net/core/sock.c
--- linux-2.2.17-pre9/net/core/sock.c	Mon Dec  3 22:08:23 2001
+++ linux/net/core/sock.c	Mon Dec  3 22:08:37 2001
@@ -132,6 +132,8 @@
 
 #define min(a,b)	((a)<(b)?(a):(b))
 
+struct linux_mib net_statistics;
+
 /* Run time adjustable parameters. */
 __u32 sysctl_wmem_max = SK_WMEM_MAX;
 __u32 sysctl_rmem_max = SK_RMEM_MAX;
diff -urN linux-2.2.17-pre9/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- linux-2.2.17-pre9/net/ipv4/af_inet.c	Mon Dec  3 22:08:23 2001
+++ linux/net/ipv4/af_inet.c	Mon Dec  3 22:08:37 2001
@@ -118,8 +118,6 @@
 
 #define min(a,b)	((a)<(b)?(a):(b))
 
-struct linux_mib net_statistics;
-
 extern int raw_get_info(char *, char **, off_t, int, int);
 extern int snmp_get_info(char *, char **, off_t, int, int);
 extern int netstat_get_info(char *, char **, off_t, int, int);
