]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.17pre10 2.2.17pre10
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:45 +0000 (15:21 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:45 +0000 (15:21 -0500)
o Fix up the eepro driver further (Aristeu Sergio Rozanski Filho)
o Update URL for Japanese Configure.help (Goto Masanori)
o Remove tty driver sleep race (Andrea Arcangeli)
| this backs out a fix but a fix we no longer need
o Tim Waugh moved (Tim Waugh)
o Urban Widmark becomes new smbfs maintainer (Urban Widmark)
| Also cleanup debug stuff
o Fix several cs46xx bugs  (Tom Woller, Alan Cox)
o Fix INET=n compile failure (Arjan van de Ven)
o Handle i2o boot volumes sanely (Boji Kannanthanam,
 Alan Cox)

23 files changed:
CREDITS
Documentation/Configure.help
Makefile
drivers/char/n_tty.c
drivers/i2o/i2o_block.c
drivers/i2o/i2o_core.c
drivers/net/eepro.c
drivers/pci/oldproc.c
drivers/sound/Makefile
drivers/sound/cs46xx.c
fs/smbfs/Makefile
fs/smbfs/cache.c
fs/smbfs/dir.c
fs/smbfs/file.c
fs/smbfs/inode.c
fs/smbfs/ioctl.c
fs/smbfs/proc.c
fs/smbfs/smb_debug.h [new file with mode: 0644]
fs/smbfs/sock.c
include/linux/i2o.h
include/linux/pci.h
net/core/sock.c
net/ipv4/af_inet.c

diff --git a/CREDITS b/CREDITS
index 3b58d722f4462dbe54510d8ad22a4bbfb585082c..fd81cef147ef46ccab8f83132483aa41d0e607a3 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -2169,10 +2169,10 @@ S: The Netherlands
 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
index ed3ed98d10c517c7b4a6be78a6bd21b3d48e5363..950f8a09ffde8d849970785f0ba4e3e6f7cf8419 100644 (file)
@@ -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
index 6c43900df7033fb4177a6767bdcea6d5ab597395..2927a578d4c9d8ba0706520573777561d4dd6e0e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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/)
 
index 416b0604c588f55d488f375125c117fa69de4f3c..895ed6b1e77911a5e1807b1ece74cf0ce649e59e 100644 (file)
@@ -1142,9 +1142,7 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file,
                                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 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file,
                        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;
index b31425264df142dc3f4c450f0bb4aef1db1416d2..f91b10e0845d56d54bdb969316eea8bbff17e33a 100644 (file)
@@ -1190,70 +1190,123 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
        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)
                {
-               if(d->lct_data.class_id!=I2O_CLASS_RANDOM_BLOCK_STORAGE)
+                       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)
                                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.
@@ -1283,14 +1336,6 @@ void i2ob_new_device(struct i2o_controller *c, struct i2o_device *d)
                           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))
         {
                  printk(KERN_INFO
index 97cffc0bffea57d9e648bf2a7a0e2d31e9abb792..f1d94dff83f89c36119dee68ce3493527d05cf0d 100644 (file)
@@ -260,7 +260,7 @@ void i2o_core_reply(struct i2o_handler *h, struct i2o_controller *c,
        {
                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 @@ int i2o_install_device(struct i2o_controller *c, struct i2o_device *d)
        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 @@ int init_module(void)
 void cleanup_module(void)
 {
         int stat;
-
         unregister_reboot_notifier(&i2o_reboot_notifier);
 
        if(i2o_num_controllers)
index ffa419402445018721c39612000f95c9f7ae9c84..42f5be4f86e1ab7fca598f3e43ecd63a06e839c4 100644 (file)
        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
 */
 
 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 @@ static unsigned eeprom_reg = EEPROM_REG_PRO;
 #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 @@ static unsigned eeprom_reg = EEPROM_REG_PRO;
                                                        (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 @@ static int eepro_send_packet(struct sk_buff *skb, struct device *dev)
                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 @@ static int eepro_send_packet(struct sk_buff *skb, struct device *dev)
                   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 @@ set_multicast_list(struct device *dev)
                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 @@ hardware_send_packet(struct device *dev, void *buf, short length)
                                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 @@ hardware_send_packet(struct device *dev, void *buf, short length)
                return;
        }
 
-       eepro_en_int(ioaddr);
        dev->tbusy = 1;
 
        if (net_debug > 5)
index ac43b28f9ebc82fc8a64478337d04e0a5474c0e7..3a0ef2e4b18a9a2bef34568aff429febd866422a 100644 (file)
@@ -105,6 +105,7 @@ struct pci_dev_info dev_info[] = {
        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"),
index f8824fbc0d29c753b9923482036b01b398e3c955..8176fcfc4aa7bbd0884ee49ecc6bd8436db9b62e 100644 (file)
@@ -84,7 +84,7 @@ obj-$(CONFIG_SOUND_CMPCI)     += cmpci.o
 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
index 791104fe2b884dded9fd385002e8d9f3026da00a..0228eff1b800634f21f7ed4656eefef51c18ae22 100644 (file)
@@ -1247,16 +1247,12 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                        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 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                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 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 
                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:
index 202cc5932b2d2e4c6bf0ee9b634453f095d3f2b5..4ea7954b04eba1603120b52fe65a11cf999f78eb 100644 (file)
@@ -11,8 +11,13 @@ O_TARGET := smbfs.o
 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
index f49c5751b5bc205eb6bdff9ed00b2b4b256f0959..4c60ecf3543a5f21cdc610b77f8e9fc6d40bd872 100644 (file)
@@ -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 @@ smb_get_dircache(struct dentry * dentry)
        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 @@ dentry->d_parent->d_name.name, dentry->d_name.name);
                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 @@ smb_free_cache_blocks(struct cache_head * cachep)
        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 @@ printk("smb_free_cache_blocks: freeing %d blocks\n", cachep->pages);
 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 @@ printk("smb_free_dircache: freeing cache\n");
 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 @@ smb_add_to_cache(struct cache_head * cachep, struct cache_dirent *entry,
        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 @@ inode, cachep->status, entry->name, fpos);
                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 @@ entry->name, len, fpos, cachep->entries);
        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 @@ get_block:
        {
                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 @@ smb_find_in_cache(struct cache_head * cachep, off_t pos,
        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 @@ printk("smb_find_in_cache: cache %p, looking for pos=%ld\n", cachep, pos);
                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 @@ smb_refill_dircache(struct cache_head * cachep, struct dentry *dentry)
        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 @@ retry:
        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 @@ retry:
         */
        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 @@ retry:
                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 @@ smb_invalid_dir_cache(struct inode * dir)
        dir->u.smbfs_i.cache_valid &= ~SMB_F_CACHEVALID;
        dir->u.smbfs_i.oldmtime = 0;
 }
-
index 293223a39673cf4ed0643e1fa472ca13606e8cec..0ac3762ec6858c441e57817bccd0c7783edb3dbd 100644 (file)
@@ -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 @@ smb_readdir(struct file *filp, void *dirent, filldir_t filldir)
        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 @@ smb_dir_open(struct inode *dir, struct file *file)
        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 @@ smb_lookup_validate(struct dentry * dentry, int flags)
         */
        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 @@ smb_delete_dentry(struct dentry * dentry)
        {
                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 @@ smb_lookup(struct inode *dir, struct dentry *dentry)
        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 @@ smb_instantiate(struct dentry *dentry, __u16 fileid, int have_id)
        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_no_inode:
 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 @@ smb_create(struct inode *dir, struct dentry *dentry, int mode)
        __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 @@ dentry->d_parent->d_name.name, dentry->d_name.name, mode);
                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 @@ smb_rename(struct inode *old_dir, struct dentry *old_dentry,
                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 */
index e1720e03174c3780074c5941737792daeb5c679a..0b0c4e3a7f190138a7748197d00a2d9711b501ec 100644 (file)
@@ -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 @@ smb_unlock_page(struct page *page)
 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 @@ smb_readpage_sync(struct dentry *dentry, struct page *page)
 
        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 @@ smb_readpage(struct file *file, struct page *page)
        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 @@ smb_writepage_sync(struct dentry *dentry, struct page *page,
        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 @@ dentry->d_parent->d_name.name, dentry->d_name.name, count, offset, wsize);
                        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 @@ smb_writepage(struct file *file, struct page *page)
 
 #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 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset, unsig
 {
        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 @@ smb_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
        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 @@ smb_file_mmap(struct file * file, struct vm_area_struct * vma)
        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 @@ smb_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
        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 @@ dentry->d_parent->d_name.name, dentry->d_name.name, result);
        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 @@ out:
 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 @@ smb_file_release(struct inode *inode, struct file * file)
 {
        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 @@ smb_file_permission(struct inode *inode, int mask)
        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)
index 1c6dbbfd7844180915d210d4d593761ee93183c7..dfc65f90e14fb3d064f02186d6e71fafc5cae0a8 100644 (file)
@@ -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 @@ smb_iget(struct super_block *sb, struct smb_fattr *fattr)
 {
        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 @@ static void
 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 @@ smb_read_inode(struct inode *inode)
 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 @@ smb_refresh_inode(struct dentry *dentry)
                         * 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 @@ smb_revalidate_inode(struct dentry *dentry)
        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 @@ smb_revalidate_inode(struct dentry *dentry)
         */
        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 @@ jiffies, inode->u.smbfs_i.oldmtime);
        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 @@ out:
 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 @@ smb_put_inode(struct inode *ino)
 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 @@ smb_notify_change(struct dentry *dentry, struct iattr *attr)
 
        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 @@ dentry->d_parent->d_name.name, dentry->d_name.name,
         */
        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 @@ EXPORT_NO_SYMBOLS;
 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 @@ init_module(void)
 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);
index f9e6fd4c2c6c457617bc82cbc60bbf24dd77ea96..b403c248ddaf058008042fb426ebed4c89a670f1 100644 (file)
@@ -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 @@ smb_ioctl(struct inode *inode, struct file *filp,
        {
                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;
 }
index df53957394aef00bd1a32f433fb6cba098f55d0f..4964ea38d5aefd89f7def99816fab99979a536a9 100644 (file)
@@ -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>
 
 #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))
 #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 @@ smb_verify(__u8 * packet, int command, int wct, int bcc)
        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 @@ smb_get_rsize(struct smb_sb_info *server)
 {
        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 @@ smb_get_wsize(struct smb_sb_info *server)
 {
        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 @@ smb_errno(struct smb_sb_info *server)
        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 @@ smb_errno(struct smb_sb_info *server)
                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 @@ smb_retry(struct smb_sb_info *server)
 
        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 @@ smb_retry(struct smb_sb_info *server)
        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 @@ smb_request_ok(struct smb_sb_info *s, int command, int wct, int bcc)
 
        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 @@ smb_newconn(struct smb_sb_info *server, struct smb_conn_opt *opt)
        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 @@ printk(KERN_DEBUG "smb_newconn: fd=%d, pid=%d\n", opt->fd, current->pid);
                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 @@ printk(KERN_DEBUG "smb_newconn: fd=%d, pid=%d\n", opt->fd, current->pid);
 #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 @@ smb_setup_header(struct smb_sb_info * server, __u8 command, __u16 wct, __u16 bcc
        __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 @@ smb_proc_open(struct smb_sb_info *server, struct dentry *dentry, int wish)
                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 @@ smb_open(struct dentry *dentry, int wish)
        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_open(struct dentry *dentry, int wish)
                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 @@ printk(KERN_DEBUG "smb_open: %s/%s open failed, result=%d\n",
        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 @@ smb_close_dentry(struct dentry * dentry)
                         */
                        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 @@ smb_proc_read(struct dentry *dentry, off_t offset, int count, char *data)
        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 @@ smb_proc_write(struct dentry *dentry, off_t offset, int count, const char *data)
        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 @@ smb_proc_unlink(struct dentry *dentry)
                           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 @@ smb_decode_long_dirent(struct smb_sb_info *server, char *p,
        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 @@ smb_proc_readdir_long(struct smb_sb_info *server, struct dentry *dir, int fpos,
        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 @@ printk(KERN_DEBUG "smb_proc_readdir_long: starting fpos=%d, mask=%s\n", fpos, ma
                        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 @@ ff_dir_handle, mask);
                {
                        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 @@ printk(KERN_DEBUG "smb_proc_readdir_long: error=%d, breaking\n", result);
 
                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 @@ mask, entries, server->rcls, server->err);
                        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 @@ smb_proc_getattr_core(struct smb_sb_info *server, struct dentry *dir,
        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 @@ smb_proc_getattr_trans2(struct smb_sb_info *server, struct dentry *dir,
        }
        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 @@ printk(KERN_DEBUG "smb_proc_getattr_trans2: not enough data for %s, len=%d\n",
        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 @@ smb_proc_setattr(struct dentry *dir, struct smb_fattr *fattr)
        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 @@ smb_proc_setattr_ext(struct smb_sb_info *server,
        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 @@ smb_proc_setattr_trans2(struct smb_sb_info *server,
        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 @@ smb_proc_settime(struct dentry *dentry, struct smb_fattr *fattr)
        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 --git a/fs/smbfs/smb_debug.h b/fs/smbfs/smb_debug.h
new file mode 100644 (file)
index 0000000..0a8d13f
--- /dev/null
@@ -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
index 16d853efa4adee96c615c961a5e96d51f6fc2a22..76d4a1709661d378f3ac6e0a10cba448a346d06c 100644 (file)
@@ -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 @@ smb_data_callback(void* ptr)
                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 @@ smb_data_callback(void* ptr)
                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 @@ server_sock(struct smb_sb_info *server)
        {
 #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 @@ smb_catch_keepalive(struct smb_sb_info *server)
        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 @@ smb_close_socket(struct smb_sb_info *server)
 
        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 @@ smb_send_raw(struct socket *socket, unsigned char *source, int length)
                }
                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 @@ smb_receive_raw(struct socket *socket, unsigned char *target, int length)
                }
                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 @@ smb_get_length(struct socket *socket, unsigned char *header)
 
        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 @@ printk(KERN_DEBUG "smb_get_length: recv error = %d\n", -result);
                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 @@ smb_receive(struct smb_sb_info *server)
        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 @@ smb_receive_trans2(struct smb_sb_info *server,
                         */
                        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 @@ parm_disp, parm_offset, parm_count, data_disp, data_offset, data_count);
                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 @@ parm_len, parm_tot, data_len, data_tot);
                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 @@ out:
        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 @@ smb_request(struct smb_sb_info *server)
                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 @@ smb_request(struct smb_sb_info *server)
                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 @@ smb_request(struct smb_sb_info *server)
        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 @@ smb_send_trans2(struct smb_sb_info *server, __u16 trans2_command,
 
        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 @@ smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command,
        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 @@ smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command,
        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 @@ out:
        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;
index 9b66f96569f2f843e787781d0ec3b823ca5a278d..57306246e2f9c956c5c13b21e732f5dd32a85cf7 100644 (file)
@@ -91,6 +91,7 @@ struct i2o_device
 
        struct i2o_controller *controller;      /* Controlling IOP */
        struct i2o_device *next;        /* Chain */
+       struct i2o_device *prev;
        char dev_name[8];               /* linux /dev name if available */
 };
 
index 6efe8651cbc611af6b58da37c9118fedfb2e5921..7c322763d9539f4c9dde79f1c3cdd1c26850e522 100644 (file)
 #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
index 8eeedcdded21b8b7530d6a8a1ad3c056c41abc04..c7f3495986e2edeafd20d62c45d9b26627e5a7fb 100644 (file)
 
 #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;
index fa058a234061f55837f2b05614bd3336bd3e026b..a581953dec78389c44e4115d318a0dbcc4cc7476 100644 (file)
 
 #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);