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
#
# 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
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/)
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--;
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;
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.
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
{
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
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;
void cleanup_module(void)
{
int stat;
-
unregister_reboot_notifier(&i2o_reboot_notifier);
if(i2o_num_controllers)
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>
#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) { \
(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);\
}
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");
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);
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. */
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);
return;
}
- eepro_en_int(ioaddr);
dev->tbusy = 1;
if (net_debug > 5)
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"),
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
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);
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;
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:
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
#define SMBFS_PARANOIA 1
/* #define SMBFS_DEBUG_VERBOSE 1 */
+#include "smb_debug.h"
+
+
static inline struct inode *
get_cache_inode(struct cache_head *cachep)
{
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;
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,
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)
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);
}
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));
}
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 ...
*/
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;
}
/*
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
/*
{
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;
}
/*
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)
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;
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.
*/
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;
}
*/
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;
}
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;
dir->u.smbfs_i.cache_valid &= ~SMB_F_CACHEVALID;
dir->u.smbfs_i.oldmtime = 0;
}
-
#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 *);
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)
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;
*/
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);
{
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);
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;
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;
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;
__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)
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;
}
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 */
#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)
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;
}
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;
}
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);
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)
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;
#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);
{
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);
}
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;
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);
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;
}
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;
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;
}
{
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)
{
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)
#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 *);
{
struct inode *result;
- pr_debug("smb_iget: %p\n", fattr);
+ DEBUG1("smb_iget: %p\n", fattr);
result = get_empty_inode();
result->i_sb = sb;
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;
}
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));
}
* 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 */
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.
*/
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;
}
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);
}
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;
}
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);
}
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;
*/
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)
{
int
init_module(void)
{
- pr_debug("smbfs: init_module called\n");
+ DEBUG1("smbfs: init_module called\n");
#ifdef DEBUG_SMB_MALLOC
smb_malloced = 0;
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);
#include <asm/uaccess.h>
+
int
smb_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
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;
}
* 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 *);
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;
{
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;
}
{
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;
}
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)
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;
}
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;
}
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;
}
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;
}
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 ...
*/
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;
}
#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);
__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);
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;
}
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;
}
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;
}
/*
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:
*/
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);
}
}
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;
}
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);
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 */
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;
}
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.
*/
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);
{
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;
}
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;
}
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;
}
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;
}
if (server->rcls != 0)
{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_proc_getattr_trans2: for %s: result=%d, rcls=%d, err=%d\n",
-¶m[6], result, server->rcls, server->err);
-#endif
+ VERBOSE("smb_proc_getattr_trans2: for %s: result=%d, rcls=%d, err=%d\n",
+ ¶m[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",
-¶m[6], resp_data_len);
-#endif
+ PARANOIA("smb_proc_getattr_trans2: not enough data for %s, len=%d\n",
+ ¶m[6], resp_data_len);
goto out;
}
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);
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);
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);
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 */
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))
--- /dev/null
+/*
+ * 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
#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)
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;
}
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;
{
#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;
}
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 ...
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);
}
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;
}
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;
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])
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;
}
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;
*/
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;
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!
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);
}
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;
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(¤t->sigmask_lock, flags);
sigpipe = sigismember(¤t->signal, SIGPIPE);
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;
}
}
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;
}
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];
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??
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;
}
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;
struct i2o_controller *controller; /* Controlling IOP */
struct i2o_device *next; /* Chain */
+ struct i2o_device *prev;
char dev_name[8]; /* linux /dev name if available */
};
#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
#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;
#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);