Commit e825d678 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/davem/BK/net-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents b665133b c9d82cbf
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/cpufreq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/cpufreq.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
extern rwlock_t xtime_lock;
#ifndef CONFIG_PCI #ifndef CONFIG_PCI
asmlinkage int sys_pciconfig_read(unsigned long bus, asmlinkage int sys_pciconfig_read(unsigned long bus,
...@@ -737,8 +739,10 @@ static void pcic_clear_clock_irq(void) ...@@ -737,8 +739,10 @@ static void pcic_clear_clock_irq(void)
static void pcic_timer_handler (int irq, void *h, struct pt_regs *regs) static void pcic_timer_handler (int irq, void *h, struct pt_regs *regs)
{ {
write_lock(&xtime_lock); /* Dummy, to show that we remember */
pcic_clear_clock_irq(); pcic_clear_clock_irq();
do_timer(regs); do_timer(regs);
write_unlock(&xtime_lock);
} }
#define USECS_PER_JIFFY 10000 /* We have 100HZ "standard" timer for sparc */ #define USECS_PER_JIFFY 10000 /* We have 100HZ "standard" timer for sparc */
...@@ -776,25 +780,17 @@ void __init pci_time_init(void) ...@@ -776,25 +780,17 @@ void __init pci_time_init(void)
static __inline__ unsigned long do_gettimeoffset(void) static __inline__ unsigned long do_gettimeoffset(void)
{ {
struct tasklet_struct *t; /*
unsigned long offset = 0;
/*
* We devide all to 100 * We devide all to 100
* to have microsecond resolution and to avoid overflow * to have microsecond resolution and to avoid overflow
*/ */
unsigned long count = unsigned long count =
readl(pcic0.pcic_regs+PCI_SYS_COUNTER) & ~PCI_SYS_COUNTER_OVERFLOW; readl(pcic0.pcic_regs+PCI_SYS_COUNTER) & ~PCI_SYS_COUNTER_OVERFLOW;
count = ((count/100)*USECS_PER_JIFFY) / (TICK_TIMER_LIMIT/100); count = ((count/100)*USECS_PER_JIFFY) / (TICK_TIMER_LIMIT/100);
return count;
t = &bh_task_vec[TIMER_BH];
if (test_bit(TASKLET_STATE_SCHED, &t->state))
offset = 1000000;
return offset + count;
} }
extern unsigned long wall_jiffies; extern unsigned long wall_jiffies;
extern rwlock_t xtime_lock;
static void pci_do_gettimeofday(struct timeval *tv) static void pci_do_gettimeofday(struct timeval *tv)
{ {
......
...@@ -129,6 +129,8 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -129,6 +129,8 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
sparc_do_profile(regs->pc, regs->u_regs[UREG_RETPC]); sparc_do_profile(regs->pc, regs->u_regs[UREG_RETPC]);
#endif #endif
/* Protect counter clear so that do_gettimeoffset works */
write_lock(&xtime_lock);
#ifdef CONFIG_SUN4 #ifdef CONFIG_SUN4
if((idprom->id_machtype == (SM_SUN4 | SM_4_260)) || if((idprom->id_machtype == (SM_SUN4 | SM_4_260)) ||
(idprom->id_machtype == (SM_SUN4 | SM_4_110))) { (idprom->id_machtype == (SM_SUN4 | SM_4_110))) {
...@@ -140,8 +142,6 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -140,8 +142,6 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
#endif #endif
clear_clock_irq(); clear_clock_irq();
write_lock(&xtime_lock);
do_timer(regs); do_timer(regs);
/* Determine when to update the Mostek clock. */ /* Determine when to update the Mostek clock. */
...@@ -459,17 +459,7 @@ void __init time_init(void) ...@@ -459,17 +459,7 @@ void __init time_init(void)
extern __inline__ unsigned long do_gettimeoffset(void) extern __inline__ unsigned long do_gettimeoffset(void)
{ {
struct tasklet_struct *t; return (*master_l10_counter >> 10) & 0x1fffff;
unsigned long offset = 0;
unsigned int count;
count = (*master_l10_counter >> 10) & 0x1fffff;
t = &bh_task_vec[TIMER_BH];
if (test_bit(TASKLET_STATE_SCHED, &t->state))
offset = 1000000;
return offset + count;
} }
/* Ok, my cute asm atomicity trick doesn't work anymore. /* Ok, my cute asm atomicity trick doesn't work anymore.
......
...@@ -32,6 +32,7 @@ CONFIG_HW_CONSOLE=y ...@@ -32,6 +32,7 @@ CONFIG_HW_CONSOLE=y
# CONFIG_HUGETLB_PAGE is not set # CONFIG_HUGETLB_PAGE is not set
CONFIG_SMP=y CONFIG_SMP=y
# CONFIG_PREEMPT is not set # CONFIG_PREEMPT is not set
CONFIG_NR_CPUS=4
CONFIG_SPARC64=y CONFIG_SPARC64=y
CONFIG_HOTPLUG=y CONFIG_HOTPLUG=y
CONFIG_HAVE_DEC_LOCK=y CONFIG_HAVE_DEC_LOCK=y
...@@ -59,7 +60,6 @@ CONFIG_BINFMT_ELF=y ...@@ -59,7 +60,6 @@ CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
# CONFIG_SUNOS_EMUL is not set # CONFIG_SUNOS_EMUL is not set
CONFIG_SOLARIS_EMUL=m CONFIG_SOLARIS_EMUL=m
CONFIG_NR_CPUS=64
# #
# Parallel port support # Parallel port support
...@@ -220,6 +220,8 @@ CONFIG_BLK_DEV_IDEPCI=y ...@@ -220,6 +220,8 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_GENERIC is not set # CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_IDEPCI_SHARE_IRQ is not set # CONFIG_IDEPCI_SHARE_IRQ is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
# CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
...@@ -1025,15 +1027,20 @@ CONFIG_USB_TEST=m ...@@ -1025,15 +1027,20 @@ CONFIG_USB_TEST=m
CONFIG_BLUEZ=m CONFIG_BLUEZ=m
CONFIG_BLUEZ_L2CAP=m CONFIG_BLUEZ_L2CAP=m
CONFIG_BLUEZ_SCO=m CONFIG_BLUEZ_SCO=m
CONFIG_BLUEZ_RFCOMM=m
CONFIG_BLUEZ_RFCOMM_TTY=y
CONFIG_BLUEZ_BNEP=m
CONFIG_BLUEZ_BNEP_MC_FILTER=y
CONFIG_BLUEZ_BNEP_PROTO_FILTER=y
# #
# Bluetooth device drivers # Bluetooth device drivers
# #
CONFIG_BLUEZ_HCIUSB=m CONFIG_BLUEZ_HCIUSB=m
CONFIG_BLUEZ_USB_FW_LOAD=y
CONFIG_BLUEZ_USB_ZERO_PACKET=y CONFIG_BLUEZ_USB_ZERO_PACKET=y
CONFIG_BLUEZ_HCIUART=m CONFIG_BLUEZ_HCIUART=m
CONFIG_BLUEZ_HCIUART_H4=y CONFIG_BLUEZ_HCIUART_H4=y
CONFIG_BLUEZ_HCIUART_BCSP=y
# CONFIG_BLUEZ_HCIDTL1 is not set # CONFIG_BLUEZ_HCIDTL1 is not set
# CONFIG_BLUEZ_HCIBT3C is not set # CONFIG_BLUEZ_HCIBT3C is not set
# CONFIG_BLUEZ_HCIBLUECARD is not set # CONFIG_BLUEZ_HCIBLUECARD is not set
......
...@@ -247,7 +247,7 @@ static inline void *ebus_alloc(size_t size) ...@@ -247,7 +247,7 @@ static inline void *ebus_alloc(size_t size)
mem = kmalloc(size, GFP_ATOMIC); mem = kmalloc(size, GFP_ATOMIC);
if (!mem) if (!mem)
panic(__FUNCTION__ ": out of memory"); panic("ebus_alloc: out of memory");
memset((char *)mem, 0, size); memset((char *)mem, 0, size);
return mem; return mem;
} }
......
...@@ -1158,18 +1158,6 @@ static int rx_pkt(struct atm_dev *dev) ...@@ -1158,18 +1158,6 @@ static int rx_pkt(struct atm_dev *dev)
} }
if (!(skb = atm_alloc_charge(vcc, len, GFP_ATOMIC))) { if (!(skb = atm_alloc_charge(vcc, len, GFP_ATOMIC))) {
/* lets allocate an skb for now */
skb = alloc_skb(len, GFP_ATOMIC);
if (!skb)
{
IF_ERR(printk("can't allocate memory for recv, drop pkt!\n");)
atomic_inc(&vcc->stats->rx_drop);
atm_return(vcc, atm_pdu2truesize(len));
goto out_free_desc;
}
}
else {
IF_EVENT(printk("IA: Rx over the rx_quota %ld\n", vcc->rx_quota);)
if (vcc->vci < 32) if (vcc->vci < 32)
printk("Drop control packets\n"); printk("Drop control packets\n");
goto out_free_desc; goto out_free_desc;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define __NO_VERSION__ #define __NO_VERSION__
#include "drmP.h" #include "drmP.h"
int DRM(irq_busid)(struct inode *inode, struct file *filp, int DRM(irq_busid)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
...@@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp, ...@@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp,
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p))) if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
return -EFAULT; return -EFAULT;
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum)); dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
if (dev) p.irq = dev->irq; if (!dev) {
else p.irq = 0; DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
p.busnum, p.devnum, p.funcnum);
p.irq = 0;
goto out;
}
if (pci_enable_device(dev) != 0) {
DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
p.busnum, p.devnum, p.funcnum);
p.irq = 0;
goto out;
}
p.irq = dev->irq;
out:
DRM_DEBUG("%d:%d:%d => IRQ %d\n", DRM_DEBUG("%d:%d:%d => IRQ %d\n",
p.busnum, p.devnum, p.funcnum, p.irq); p.busnum, p.devnum, p.funcnum, p.irq);
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p))) if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
......
...@@ -74,7 +74,7 @@ do { \ ...@@ -74,7 +74,7 @@ do { \
ret = -EBUSY; \ ret = -EBUSY; \
break; \ break; \
} \ } \
schedule_timeout(max(HZ/100,1)); \ schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
if (signal_pending(current)) { \ if (signal_pending(current)) { \
ret = -EINTR; \ ret = -EINTR; \
break; \ break; \
......
...@@ -157,9 +157,18 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv ) ...@@ -157,9 +157,18 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv )
{ {
drm_mga_primary_buffer_t *primary = &dev_priv->prim; drm_mga_primary_buffer_t *primary = &dev_priv->prim;
u32 head, tail; u32 head, tail;
DMA_LOCALS; u32 status = 0;
int i;
DMA_LOCALS;
DRM_DEBUG( "\n" ); DRM_DEBUG( "\n" );
/* We need to wait so that we can do an safe flush */
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
status = MGA_READ( MGA_STATUS ) & MGA_ENGINE_IDLE_MASK;
if ( status == MGA_ENDPRDMASTS ) break;
udelay( 1 );
}
if ( primary->tail == primary->last_flush ) { if ( primary->tail == primary->last_flush ) {
DRM_DEBUG( " bailing out...\n" ); DRM_DEBUG( " bailing out...\n" );
return; return;
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
#define CHECK_TTY_COUNT 1 #define CHECK_TTY_COUNT 1
struct termios tty_std_termios; /* for the benefit of tty drivers */ struct termios tty_std_termios; /* for the benefit of tty drivers */
struct tty_driver *tty_drivers; /* linked list of tty drivers */ LIST_HEAD(tty_drivers); /* linked list of tty drivers */
struct tty_ldisc ldiscs[NR_LDISCS]; /* line disc dispatch table */ struct tty_ldisc ldiscs[NR_LDISCS]; /* line disc dispatch table */
#ifdef CONFIG_UNIX98_PTYS #ifdef CONFIG_UNIX98_PTYS
...@@ -338,7 +338,7 @@ struct tty_driver *get_tty_driver(kdev_t device) ...@@ -338,7 +338,7 @@ struct tty_driver *get_tty_driver(kdev_t device)
minor = minor(device); minor = minor(device);
major = major(device); major = major(device);
for (p = tty_drivers; p; p = p->next) { list_for_each_entry(p, &tty_drivers, tty_drivers) {
if (p->major != major) if (p->major != major)
continue; continue;
if (minor < p->minor_start) if (minor < p->minor_start)
...@@ -2083,10 +2083,7 @@ int tty_register_driver(struct tty_driver *driver) ...@@ -2083,10 +2083,7 @@ int tty_register_driver(struct tty_driver *driver)
if (!driver->put_char) if (!driver->put_char)
driver->put_char = tty_default_put_char; driver->put_char = tty_default_put_char;
driver->prev = 0; list_add(&driver->tty_drivers, &tty_drivers);
driver->next = tty_drivers;
if (tty_drivers) tty_drivers->prev = driver;
tty_drivers = driver;
if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
for(i = 0; i < driver->num; i++) for(i = 0; i < driver->num; i++)
...@@ -2110,7 +2107,7 @@ int tty_unregister_driver(struct tty_driver *driver) ...@@ -2110,7 +2107,7 @@ int tty_unregister_driver(struct tty_driver *driver)
if (*driver->refcount) if (*driver->refcount)
return -EBUSY; return -EBUSY;
for (p = tty_drivers; p; p = p->next) { list_for_each_entry(p, &tty_drivers, tty_drivers) {
if (p == driver) if (p == driver)
found++; found++;
else if (p->major == driver->major) else if (p->major == driver->major)
...@@ -2127,13 +2124,7 @@ int tty_unregister_driver(struct tty_driver *driver) ...@@ -2127,13 +2124,7 @@ int tty_unregister_driver(struct tty_driver *driver)
} else } else
register_chrdev(driver->major, othername, &tty_fops); register_chrdev(driver->major, othername, &tty_fops);
if (driver->prev) list_del(&driver->tty_drivers);
driver->prev->next = driver->next;
else
tty_drivers = driver->next;
if (driver->next)
driver->next->prev = driver->prev;
/* /*
* Free the termios and termios_locked structures because * Free the termios and termios_locked structures because
......
...@@ -1576,7 +1576,6 @@ static void esp_exec_cmd(struct esp *esp) ...@@ -1576,7 +1576,6 @@ static void esp_exec_cmd(struct esp *esp)
memset(esp_dev, 0, sizeof(struct esp_device)); memset(esp_dev, 0, sizeof(struct esp_device));
SDptr->hostdata = esp_dev; SDptr->hostdata = esp_dev;
} }
}
esp->snip = 0; esp->snip = 0;
esp->msgout_len = 0; esp->msgout_len = 0;
...@@ -3589,7 +3588,7 @@ static int target_with_ants_in_pants(struct esp *esp, ...@@ -3589,7 +3588,7 @@ static int target_with_ants_in_pants(struct esp *esp,
Scsi_Cmnd *SCptr, Scsi_Cmnd *SCptr,
struct esp_device *esp_dev) struct esp_device *esp_dev)
{ {
if (esp_dev->sync || SCptr->SDptr->borken) { if (esp_dev->sync || SCptr->device->borken) {
/* sorry, no can do */ /* sorry, no can do */
ESPSDTR(("forcing to async, ")); ESPSDTR(("forcing to async, "));
build_sync_nego_msg(esp, 0, 0); build_sync_nego_msg(esp, 0, 0);
...@@ -3811,7 +3810,7 @@ static int check_multibyte_msg(struct esp *esp) ...@@ -3811,7 +3810,7 @@ static int check_multibyte_msg(struct esp *esp)
/* Regardless, next try for sync transfers. */ /* Regardless, next try for sync transfers. */
build_sync_nego_msg(esp, esp->sync_defp, 15); build_sync_nego_msg(esp, esp->sync_defp, 15);
espo_dev->sync = 1; esp_dev->sync = 1;
esp->snip = 1; esp->snip = 1;
message_out = EXTENDED_MESSAGE; message_out = EXTENDED_MESSAGE;
} }
......
...@@ -458,7 +458,7 @@ decode_negTokenInit(unsigned char *security_blob, int length, ...@@ -458,7 +458,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
unsigned int cls, con, tag, oidlen, rc; unsigned int cls, con, tag, oidlen, rc;
int use_ntlmssp = FALSE; int use_ntlmssp = FALSE;
dump_mem(" Received SecBlob ", security_blob, length); /* cifs_dump_mem(" Received SecBlob ", security_blob, length); */
asn1_open(&ctx, security_blob, length); asn1_open(&ctx, security_blob, length);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "cifs_debug.h" #include "cifs_debug.h"
void void
dump_mem(char *label, void *data, int length) cifs_dump_mem(char *label, void *data, int length)
{ {
int i, j; int i, j;
int *intptr = data; int *intptr = data;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#ifndef _H_CIFS_DEBUG #ifndef _H_CIFS_DEBUG
#define _H_CIFS_DEBUG #define _H_CIFS_DEBUG
void dump_mem(char *label, void *data, int length); void cifs_dump_mem(char *label, void *data, int length);
extern int traceSMB; /* flag which enables the function below */ extern int traceSMB; /* flag which enables the function below */
void dump_smb(struct smb_hdr *, int); void dump_smb(struct smb_hdr *, int);
......
This diff is collapsed.
...@@ -168,7 +168,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) ...@@ -168,7 +168,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
} else if (temp[0] != (char) 0) { } else if (temp[0] != (char) 0) {
cERROR(1, cERROR(1,
("\nUnknown RFC 1001 frame received not 0x00 nor 0x85")); ("\nUnknown RFC 1001 frame received not 0x00 nor 0x85"));
dump_mem(" Received Data is: ", temp, length); cifs_dump_mem(" Received Data is: ", temp, length);
break; break;
} else { } else {
if ((length != sizeof (struct smb_hdr) - 1) if ((length != sizeof (struct smb_hdr) - 1)
...@@ -757,8 +757,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, ...@@ -757,8 +757,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
/* Removed following few lines to not send old style password /* Removed following few lines to not send old style password
hash ever - for better security */ hash ever - for better security */
/* toUpper(cifs_sb->local_nls, password_with_pad); /* toUpper(cifs_sb->local_nls, password_with_pad);
SMBencrypt(password_with_pad, cryptKey,session_key); SMBencrypt(password_with_pad, cryptKey,session_key); */
dump_mem("\nCIFS (Samba encrypt): ", session_key,CIFS_SESSION_KEY_SIZE); */
rc = CIFSSessSetup(xid, pSesInfo, rc = CIFSSessSetup(xid, pSesInfo,
volume_info.username, volume_info.username,
...@@ -925,7 +924,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user, ...@@ -925,7 +924,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
bcc_ptr += CIFS_SESSION_KEY_SIZE; bcc_ptr += CIFS_SESSION_KEY_SIZE;
if (ses->capabilities & CAP_UNICODE) { if (ses->capabilities & CAP_UNICODE) {
if ((int) bcc_ptr % 2) { /* must be word aligned for Unicode */ if ((long) bcc_ptr % 2) { /* must be word aligned for Unicode */
*bcc_ptr = 0; *bcc_ptr = 0;
bcc_ptr++; bcc_ptr++;
} }
...@@ -983,13 +982,12 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user, ...@@ -983,13 +982,12 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
} }
BCC(smb_buffer) = (int) bcc_ptr - (int) pByteArea(smb_buffer); BCC(smb_buffer) = (long) bcc_ptr - (long) pByteArea(smb_buffer);
smb_buffer->smb_buf_length += BCC(smb_buffer); smb_buffer->smb_buf_length += BCC(smb_buffer);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer)); BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
&bytes_returned, 1); &bytes_returned, 1);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92);*/
if (rc) { if (rc) {
/* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */ /* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */
} else if ((smb_buffer_response->WordCount == 3) } else if ((smb_buffer_response->WordCount == 3)
...@@ -1011,7 +1009,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user, ...@@ -1011,7 +1009,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
pSMBr->resp.SecurityBlobLength; pSMBr->resp.SecurityBlobLength;
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) { if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) { if ((long) (bcc_ptr) % 2) {
remaining_words = remaining_words =
(BCC(smb_buffer_response) (BCC(smb_buffer_response)
- 1) / 2; - 1) / 2;
...@@ -1069,7 +1067,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user, ...@@ -1069,7 +1067,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
} else { /* ASCII */ } else { /* ASCII */
len = strnlen(bcc_ptr, 1024); len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int) if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response) pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) { <= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1,GFP_KERNEL); ses->serverOS = kcalloc(len + 1,GFP_KERNEL);
...@@ -1176,7 +1174,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1176,7 +1174,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
bcc_ptr += SecurityBlobLength; bcc_ptr += SecurityBlobLength;
if (ses->capabilities & CAP_UNICODE) { if (ses->capabilities & CAP_UNICODE) {
if ((int) bcc_ptr % 2) { /* must be word aligned for Unicode strings */ if ((long) bcc_ptr % 2) { /* must be word aligned for Unicode strings */
*bcc_ptr = 0; *bcc_ptr = 0;
bcc_ptr++; bcc_ptr++;
} }
...@@ -1229,13 +1227,12 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1229,13 +1227,12 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1;
} }
BCC(smb_buffer) = (int) bcc_ptr - (int) pByteArea(smb_buffer); BCC(smb_buffer) = (long) bcc_ptr - (long) pByteArea(smb_buffer);
smb_buffer->smb_buf_length += BCC(smb_buffer); smb_buffer->smb_buf_length += BCC(smb_buffer);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer)); BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
&bytes_returned, 1); &bytes_returned, 1);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92); */
if (rc) { if (rc) {
/* rc = map_smb_to_linux_error(smb_buffer_response); *//* done in SendReceive now */ /* rc = map_smb_to_linux_error(smb_buffer_response); *//* done in SendReceive now */
} else if ((smb_buffer_response->WordCount == 3) } else if ((smb_buffer_response->WordCount == 3)
...@@ -1265,7 +1262,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1265,7 +1262,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
} }
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) { if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) { if ((long) (bcc_ptr) % 2) {
remaining_words = remaining_words =
(BCC(smb_buffer_response) (BCC(smb_buffer_response)
- 1) / 2; - 1) / 2;
...@@ -1328,7 +1325,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1328,7 +1325,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
} else { /* ASCII */ } else { /* ASCII */
len = strnlen(bcc_ptr, 1024); len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int) if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response) pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) { <= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1, GFP_KERNEL); ses->serverOS = kcalloc(len + 1, GFP_KERNEL);
...@@ -1465,16 +1462,16 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -1465,16 +1462,16 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob->DomainName.MaximumLength = SecurityBlob->DomainName.MaximumLength =
cpu_to_le16(SecurityBlob->DomainName.Length); cpu_to_le16(SecurityBlob->DomainName.Length);
SecurityBlob->DomainName.Buffer = SecurityBlob->DomainName.Buffer =
cpu_to_le32((unsigned int) &SecurityBlob-> cpu_to_le32((long) &SecurityBlob->
DomainString - DomainString -
(unsigned int) &SecurityBlob->Signature); (long) &SecurityBlob->Signature);
bcc_ptr += SecurityBlob->DomainName.Length; bcc_ptr += SecurityBlob->DomainName.Length;
SecurityBlobLength += SecurityBlob->DomainName.Length; SecurityBlobLength += SecurityBlob->DomainName.Length;
SecurityBlob->DomainName.Length = SecurityBlob->DomainName.Length =
cpu_to_le16(SecurityBlob->DomainName.Length); cpu_to_le16(SecurityBlob->DomainName.Length);
} }
if (ses->capabilities & CAP_UNICODE) { if (ses->capabilities & CAP_UNICODE) {
if ((int) bcc_ptr % 2) { if ((long) bcc_ptr % 2) {
*bcc_ptr = 0; *bcc_ptr = 0;
bcc_ptr++; bcc_ptr++;
} }
...@@ -1511,7 +1508,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -1511,7 +1508,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob->NegotiateFlags = SecurityBlob->NegotiateFlags =
cpu_to_le32(SecurityBlob->NegotiateFlags); cpu_to_le32(SecurityBlob->NegotiateFlags);
pSMB->req.SecurityBlobLength = cpu_to_le16(SecurityBlobLength); pSMB->req.SecurityBlobLength = cpu_to_le16(SecurityBlobLength);
BCC(smb_buffer) = (int) bcc_ptr - (int) pByteArea(smb_buffer); BCC(smb_buffer) = (long) bcc_ptr - (long) pByteArea(smb_buffer);
smb_buffer->smb_buf_length += BCC(smb_buffer); smb_buffer->smb_buf_length += BCC(smb_buffer);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer)); BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
...@@ -1564,7 +1561,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -1564,7 +1561,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
if(SecurityBlob2->NegotiateFlags & NTLMSSP_NEGOTIATE_NTLMV2) if(SecurityBlob2->NegotiateFlags & NTLMSSP_NEGOTIATE_NTLMV2)
*pNTLMv2_flag = TRUE; *pNTLMv2_flag = TRUE;
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) { if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) { if ((long) (bcc_ptr) % 2) {
remaining_words = remaining_words =
(BCC(smb_buffer_response) (BCC(smb_buffer_response)
- 1) / 2; - 1) / 2;
...@@ -1650,7 +1647,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, ...@@ -1650,7 +1647,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
} else { /* ASCII */ } else { /* ASCII */
len = strnlen(bcc_ptr, 1024); len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int) if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response) pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) { <= BCC(smb_buffer_response)) {
ses->serverOS = ses->serverOS =
...@@ -1846,7 +1843,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1846,7 +1843,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlobLength += SecurityBlob->WorkstationName.Length; SecurityBlobLength += SecurityBlob->WorkstationName.Length;
SecurityBlob->WorkstationName.Length = cpu_to_le16(SecurityBlob->WorkstationName.Length); */ SecurityBlob->WorkstationName.Length = cpu_to_le16(SecurityBlob->WorkstationName.Length); */
if ((int) bcc_ptr % 2) { if ((long) bcc_ptr % 2) {
*bcc_ptr = 0; *bcc_ptr = 0;
bcc_ptr++; bcc_ptr++;
} }
...@@ -1918,7 +1915,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1918,7 +1915,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlob->NegotiateFlags = SecurityBlob->NegotiateFlags =
cpu_to_le32(SecurityBlob->NegotiateFlags); cpu_to_le32(SecurityBlob->NegotiateFlags);
pSMB->req.SecurityBlobLength = cpu_to_le16(SecurityBlobLength); pSMB->req.SecurityBlobLength = cpu_to_le16(SecurityBlobLength);
BCC(smb_buffer) = (int) bcc_ptr - (int) pByteArea(smb_buffer); BCC(smb_buffer) = (long) bcc_ptr - (long) pByteArea(smb_buffer);
smb_buffer->smb_buf_length += BCC(smb_buffer); smb_buffer->smb_buf_length += BCC(smb_buffer);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer)); BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
...@@ -1959,7 +1956,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -1959,7 +1956,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
("\nNTLMSSP response to Authenticate ")); ("\nNTLMSSP response to Authenticate "));
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) { if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) { if ((long) (bcc_ptr) % 2) {
remaining_words = remaining_words =
(BCC(smb_buffer_response) (BCC(smb_buffer_response)
- 1) / 2; - 1) / 2;
...@@ -2037,8 +2034,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2037,8 +2034,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
} else { /* ASCII */ } else { /* ASCII */
len = strnlen(bcc_ptr, 1024); len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - if (((long) bcc_ptr + len) -
(int) pByteArea(smb_buffer_response) (long) pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) { <= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1,GFP_KERNEL); ses->serverOS = kcalloc(len + 1,GFP_KERNEL);
strncpy(ses->serverOS,bcc_ptr, len); strncpy(ses->serverOS,bcc_ptr, len);
...@@ -2142,7 +2139,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2142,7 +2139,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strcpy(bcc_ptr, "?????"); strcpy(bcc_ptr, "?????");
bcc_ptr += strlen("?????"); bcc_ptr += strlen("?????");
bcc_ptr += 1; bcc_ptr += 1;
BCC(smb_buffer) = (int) bcc_ptr - (int) pByteArea(smb_buffer); BCC(smb_buffer) = (long) bcc_ptr - (long) pByteArea(smb_buffer);
smb_buffer->smb_buf_length += BCC(smb_buffer); smb_buffer->smb_buf_length += BCC(smb_buffer);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer)); BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
...@@ -2159,8 +2156,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2159,8 +2156,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strncpy(tcon->treeName, tree, MAX_TREE_SIZE); strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) { if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
length = UniStrnlen((wchar_t *) bcc_ptr, 512); length = UniStrnlen((wchar_t *) bcc_ptr, 512);
if (((int) bcc_ptr + (2 * length)) - if (((long) bcc_ptr + (2 * length)) -
(int) pByteArea(smb_buffer_response) <= (long) pByteArea(smb_buffer_response) <=
BCC(smb_buffer_response)) { BCC(smb_buffer_response)) {
tcon->nativeFileSystem = tcon->nativeFileSystem =
kcalloc(length + 2, GFP_KERNEL); kcalloc(length + 2, GFP_KERNEL);
...@@ -2175,8 +2172,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, ...@@ -2175,8 +2172,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
/* else do not bother copying these informational fields */ /* else do not bother copying these informational fields */
} else { } else {
length = strnlen(bcc_ptr, 1024); length = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + length) - if (((long) bcc_ptr + length) -
(int) pByteArea(smb_buffer_response) <= (long) pByteArea(smb_buffer_response) <=
BCC(smb_buffer_response)) { BCC(smb_buffer_response)) {
tcon->nativeFileSystem = tcon->nativeFileSystem =
kcalloc(length + 1, GFP_KERNEL); kcalloc(length + 1, GFP_KERNEL);
......
...@@ -572,9 +572,6 @@ fill_in_inode(struct inode *tmp_inode, ...@@ -572,9 +572,6 @@ fill_in_inode(struct inode *tmp_inode,
tmp_inode->i_size = pfindData->EndOfFile; tmp_inode->i_size = pfindData->EndOfFile;
tmp_inode->i_blocks = tmp_inode->i_blocks =
do_div(pfindData->AllocationSize, tmp_inode->i_blksize); do_div(pfindData->AllocationSize, tmp_inode->i_blksize);
cFYI(1,
("\nFinddata alloc size (from smb) %lld",
pfindData->AllocationSize));
if (pfindData->AllocationSize < pfindData->EndOfFile) if (pfindData->AllocationSize < pfindData->EndOfFile)
cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file ")); cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file "));
cFYI(1, cFYI(1,
...@@ -652,10 +649,6 @@ unix_fill_in_inode(struct inode *tmp_inode, ...@@ -652,10 +649,6 @@ unix_fill_in_inode(struct inode *tmp_inode,
tmp_inode->i_size = pfindData->EndOfFile; tmp_inode->i_size = pfindData->EndOfFile;
tmp_inode->i_blocks = tmp_inode->i_blocks =
do_div(pfindData->NumOfBytes, tmp_inode->i_blksize); do_div(pfindData->NumOfBytes, tmp_inode->i_blksize);
cFYI(0, ("\nFinddata alloc size (from smb) %lld", pfindData->NumOfBytes)); /* BB remove */
if (pfindData->NumOfBytes < pfindData->EndOfFile)
cFYI(0, ("\nServer inconsistency Error: it says allocation size less than end of file ")); /* BB remove */
cFYI(1, ("\nCIFS FFIRST: Size %ld and blocks %ld ", (unsigned long) tmp_inode->i_size, tmp_inode->i_blocks)); /* BB remove */
if (S_ISREG(tmp_inode->i_mode)) { if (S_ISREG(tmp_inode->i_mode)) {
cFYI(1, (" File inode ")); cFYI(1, (" File inode "));
tmp_inode->i_op = &cifs_file_inode_ops; tmp_inode->i_op = &cifs_file_inode_ops;
......
...@@ -131,9 +131,6 @@ cifs_get_inode_info_unix(struct inode **pinode, ...@@ -131,9 +131,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
inode->i_blksize = inode->i_blksize =
(pTcon->ses->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00; (pTcon->ses->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;
inode->i_blocks = do_div(findData.NumOfBytes, inode->i_blksize); inode->i_blocks = do_div(findData.NumOfBytes, inode->i_blksize);
cFYI(1,
("\nFinddata alloc size (from smb) %lld",
findData.NumOfBytes));
if (findData.NumOfBytes < findData.EndOfFile) if (findData.NumOfBytes < findData.EndOfFile)
cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file ")); cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file "));
cFYI(1, cFYI(1,
......
...@@ -694,8 +694,8 @@ const struct nt_err_code_struct nt_errs[] = { ...@@ -694,8 +694,8 @@ const struct nt_err_code_struct nt_errs[] = {
/***************************************************************************** /*****************************************************************************
Print an error message from the status code Print an error message from the status code
*****************************************************************************/ *****************************************************************************/
void /* void
print_status(__u32 status_code) cifs_print_status(__u32 status_code)
{ {
int idx = 0; int idx = 0;
...@@ -709,4 +709,4 @@ print_status(__u32 status_code) ...@@ -709,4 +709,4 @@ print_status(__u32 status_code)
idx++; idx++;
} }
return; return;
} } */
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
obj-$(CONFIG_INTERMEZZO_FS) += intermezzo.o obj-$(CONFIG_INTERMEZZO_FS) += intermezzo.o
intermezzo-objs := journal_reiserfs.o cache.o journal.o presto.o vfs.o \ intermezzo-objs := cache.o dcache.o dir.o ext_attr.o file.o fileset.o \
psdev.o upcall.o methods.o sysctl.o dcache.o dir.o \ inode.o io_daemon.o journal.o journal_ext2.o journal_ext3.o \
super.o journal_ext2.o journal_ext3.o journal_xfs.o \ journal_obdfs.o journal_reiserfs.o journal_tmpfs.o journal_xfs.o \
inode.o file.o journal_obdfs.o kml_reint.o kml_unpack.o methods.o presto.o psdev.o replicator.o \
super.o sysctl.o upcall.o vfs.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* Extended attribute handling for presto. * vim:expandtab:shiftwidth=8:tabstop=8:
*
* Copyright (C) 2001 Tacit Networks, Inc.
* Author: Shirish H. Phatak <shirish@tacitnetworks.com>
*
* This file is part of InterMezzo, http://www.inter-mezzo.org.
*
* InterMezzo is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
* *
* Copyright (C) 2001. All rights reserved. * InterMezzo is distributed in the hope that it will be useful,
* Shirish H. Phatak * but WITHOUT ANY WARRANTY; without even the implied warranty of
* Tacit Networks, Inc. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License
* along with InterMezzo; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Extended attribute handling for presto.
*/ */
#define __NO_VERSION__ #define __NO_VERSION__
...@@ -14,6 +29,7 @@ ...@@ -14,6 +29,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -22,18 +38,16 @@ ...@@ -22,18 +38,16 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/locks.h> #include <linux/smp_lock.h>
#include <linux/string.h> #include <linux/string.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/segment.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/intermezzo_fs.h> #include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h> #include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#ifdef CONFIG_FS_EXT_ATTR #ifdef CONFIG_FS_EXT_ATTR
#include <linux/ext_attr.h> #include <linux/ext_attr.h>
...@@ -41,9 +55,6 @@ ...@@ -41,9 +55,6 @@
extern inline void presto_debug_fail_blkdev(struct presto_file_set *fset, extern inline void presto_debug_fail_blkdev(struct presto_file_set *fset,
unsigned long value); unsigned long value);
extern int presto_prep(struct dentry *, struct presto_cache **,
struct presto_file_set **);
/* VFS interface */ /* VFS interface */
/* XXX! Fixme test for user defined attributes */ /* XXX! Fixme test for user defined attributes */
...@@ -75,7 +86,7 @@ int presto_set_ext_attr(struct inode *inode, ...@@ -75,7 +86,7 @@ int presto_set_ext_attr(struct inode *inode,
* we do a reverse mapping from inode to the first dentry * we do a reverse mapping from inode to the first dentry
*/ */
if (list_empty(&inode->i_dentry)) { if (list_empty(&inode->i_dentry)) {
printk("No alias for inode %d\n", (int) inode->i_ino); CERROR("No alias for inode %d\n", (int) inode->i_ino);
EXIT; EXIT;
return -EINVAL; return -EINVAL;
} }
...@@ -99,12 +110,13 @@ int presto_set_ext_attr(struct inode *inode, ...@@ -99,12 +110,13 @@ int presto_set_ext_attr(struct inode *inode,
* (works for ext3) * (works for ext3)
*/ */
if (flags & EXT_ATTR_FLAG_USER) { if (flags & EXT_ATTR_FLAG_USER) {
PRESTO_ALLOC(buf, char *, buffer_len); PRESTO_ALLOC(buf, buffer_len);
if (!buf) { if (!buf) {
printk("InterMezzo: out of memory!!!\n"); CERROR("InterMezzo: out of memory!!!\n");
return -ENOMEM; return -ENOMEM;
} }
if (copy_from_user(buf, buffer, buffer_len)) error = copy_from_user(buf, buffer, buffer_len);
if (error)
return -EFAULT; return -EFAULT;
} else } else
buf = buffer; buf = buffer;
...@@ -172,7 +184,7 @@ int lento_set_ext_attr(const char *path, const char *name, ...@@ -172,7 +184,7 @@ int lento_set_ext_attr(const char *path, const char *name,
fset = presto_fset(dentry); fset = presto_fset(dentry);
error = -EINVAL; error = -EINVAL;
if ( !fset ) { if ( !fset ) {
printk("No fileset!\n"); CERROR("No fileset!\n");
EXIT; EXIT;
goto exit_dentry; goto exit_dentry;
} }
......
This diff is collapsed.
This diff is collapsed.
/* /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* Super block/filesystem wide operations * vim:expandtab:shiftwidth=8:tabstop=8:
*
* Copyright (C) 1996 Peter J. Braam <braam@maths.ox.ac.uk> and
* Michael Callahan <callahan@maths.ox.ac.uk>
* Copyright (C) 1999 Carnegie Mellon University
* Rewritten for Linux 2.1. Peter Braam <braam@cs.cmu.edu>
*
* This file is part of InterMezzo, http://www.inter-mezzo.org.
* *
* Copryright (C) 1996 Peter J. Braam <braam@maths.ox.ac.uk> and * InterMezzo is free software; you can redistribute it and/or
* Michael Callahan <callahan@maths.ox.ac.uk> * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
* *
* Rewritten for Linux 2.1. Peter Braam <braam@cs.cmu.edu> * InterMezzo is distributed in the hope that it will be useful,
* Copyright (C) Carnegie Mellon University * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with InterMezzo; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Super block/filesystem wide operations
*/ */
#define __NO_VERSION__ #define __NO_VERSION__
...@@ -15,6 +31,7 @@ ...@@ -15,6 +31,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -23,61 +40,53 @@ ...@@ -23,61 +40,53 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/string.h> #include <linux/string.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <asm/segment.h>
#include <linux/intermezzo_fs.h> #include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h> #include <linux/intermezzo_psdev.h>
extern int presto_remount(struct super_block *, int *, char *);
int presto_excluded_gid = PRESTO_EXCL_GID;
extern int presto_prep(struct dentry *, struct presto_cache **,
struct presto_file_set **);
extern void presto_free_cache(struct presto_cache *); extern void presto_free_cache(struct presto_cache *);
void presto_set_ops(struct inode *inode, struct filter_fs *filter) void presto_set_ops(struct inode *inode, struct filter_fs *filter)
{ {
ENTRY; ENTRY;
if (inode->i_gid == presto_excluded_gid ) {
EXIT; if (!inode || is_bad_inode(inode))
CDEBUG(D_INODE, "excluded methods for %ld at %p, %p\n", return;
inode->i_ino, inode->i_op, inode->i_fop);
return;
}
if (S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
if ( !filter_c2cfiops(filter) ) { if ( !filter_c2cfiops(filter) ) {
filter_setup_file_ops(filter, filter_setup_file_ops(filter,
inode, &presto_file_iops, inode, &presto_file_iops,
&presto_file_fops); &presto_file_fops);
} }
inode->i_op = filter_c2ufiops(filter); inode->i_op = filter_c2ufiops(filter);
inode->i_fop = filter_c2uffops(filter); inode->i_fop = filter_c2uffops(filter);
CDEBUG(D_INODE, "set file methods for %ld to %p\n", CDEBUG(D_INODE, "set file methods for %ld to %p\n",
inode->i_ino, inode->i_op); inode->i_ino, inode->i_op);
} else if (S_ISDIR(inode->i_mode)) { } else if (S_ISDIR(inode->i_mode)) {
inode->i_op = filter_c2udiops(filter); inode->i_op = filter_c2udiops(filter);
inode->i_fop = filter_c2udfops(filter); inode->i_fop = filter_c2udfops(filter);
CDEBUG(D_INODE, "set dir methods for %ld to %p lookup %p\n", CDEBUG(D_INODE, "set dir methods for %ld to %p ioctl %p\n",
inode->i_ino, inode->i_op, inode->i_op->lookup); inode->i_ino, inode->i_op, inode->i_fop->ioctl);
} else if (S_ISLNK(inode->i_mode)) { } else if (S_ISLNK(inode->i_mode)) {
if ( !filter_c2csiops(filter)) { if ( !filter_c2csiops(filter)) {
filter_setup_symlink_ops(filter, filter_setup_symlink_ops(filter,
inode, inode,
&presto_sym_iops, &presto_sym_iops,
&presto_sym_fops); &presto_sym_fops);
} }
inode->i_op = filter_c2usiops(filter); inode->i_op = filter_c2usiops(filter);
inode->i_fop = filter_c2usfops(filter); inode->i_fop = filter_c2usfops(filter);
CDEBUG(D_INODE, "set link methods for %ld to %p\n", CDEBUG(D_INODE, "set link methods for %ld to %p\n",
inode->i_ino, inode->i_op); inode->i_ino, inode->i_op);
} }
EXIT; EXIT;
} }
void presto_read_inode(struct inode *inode) void presto_read_inode(struct inode *inode)
...@@ -86,7 +95,7 @@ void presto_read_inode(struct inode *inode) ...@@ -86,7 +95,7 @@ void presto_read_inode(struct inode *inode)
cache = presto_get_cache(inode); cache = presto_get_cache(inode);
if ( !cache ) { if ( !cache ) {
printk("PRESTO: BAD, BAD: cannot find cache\n"); CERROR("PRESTO: BAD, BAD: cannot find cache\n");
make_bad_inode(inode); make_bad_inode(inode);
return ; return ;
} }
...@@ -94,37 +103,52 @@ void presto_read_inode(struct inode *inode) ...@@ -94,37 +103,52 @@ void presto_read_inode(struct inode *inode)
filter_c2csops(cache->cache_filter)->read_inode(inode); filter_c2csops(cache->cache_filter)->read_inode(inode);
CDEBUG(D_INODE, "presto_read_inode: ino %ld, gid %d\n", CDEBUG(D_INODE, "presto_read_inode: ino %ld, gid %d\n",
inode->i_ino, inode->i_gid); inode->i_ino, inode->i_gid);
// if (inode->i_gid == presto_excluded_gid)
// return;
presto_set_ops(inode, cache->cache_filter); presto_set_ops(inode, cache->cache_filter);
/* XXX handle special inodes here or not - probably not? */ /* XXX handle special inodes here or not - probably not? */
} }
void presto_put_super(struct super_block *sb) static void presto_put_super(struct super_block *sb)
{ {
struct presto_cache *cache; struct presto_cache *cache;
struct upc_comm *psdev; struct upc_channel *channel;
struct super_operations *sops; struct super_operations *sops;
struct list_head *lh; struct list_head *lh;
int err;
ENTRY; ENTRY;
cache = presto_find_cache(sb); cache = presto_cache_find(to_kdev_t(sb->s_dev));
if (!cache) { if (!cache) {
EXIT; EXIT;
goto exit; goto exit;
} }
psdev = &upc_comms[presto_c2m(cache)]; channel = &izo_channels[presto_c2m(cache)];
sops = filter_c2csops(cache->cache_filter); sops = filter_c2csops(cache->cache_filter);
err = izo_clear_all_fsetroots(cache);
if (err) {
CERROR("%s: err %d\n", __FUNCTION__, err);
}
PRESTO_FREE(cache->cache_vfsmount, sizeof(struct vfsmount));
/* look at kill_super - fsync_super is not exported GRRR but
probably not needed */
unlock_super(sb);
shrink_dcache_parent(cache->cache_root);
dput(cache->cache_root);
//fsync_super(sb);
lock_super(sb);
if (sops->write_super)
sops->write_super(sb);
if (sops->put_super) if (sops->put_super)
sops->put_super(sb); sops->put_super(sb);
/* free any remaining async upcalls when the filesystem is unmounted */ /* free any remaining async upcalls when the filesystem is unmounted */
lh = psdev->uc_pending.next; spin_lock(&channel->uc_lock);
while ( lh != &psdev->uc_pending) { lh = channel->uc_pending.next;
while ( lh != &channel->uc_pending) {
struct upc_req *req; struct upc_req *req;
req = list_entry(lh, struct upc_req, rq_chain); req = list_entry(lh, struct upc_req, rq_chain);
...@@ -136,6 +160,8 @@ void presto_put_super(struct super_block *sb) ...@@ -136,6 +160,8 @@ void presto_put_super(struct super_block *sb)
PRESTO_FREE(req->rq_data, req->rq_bufsize); PRESTO_FREE(req->rq_data, req->rq_bufsize);
PRESTO_FREE(req, sizeof(struct upc_req)); PRESTO_FREE(req, sizeof(struct upc_req));
} }
list_del(&cache->cache_channel_list);
spin_unlock(&channel->uc_lock);
presto_free_cache(cache); presto_free_cache(cache);
...@@ -146,18 +172,16 @@ void presto_put_super(struct super_block *sb) ...@@ -146,18 +172,16 @@ void presto_put_super(struct super_block *sb)
return ; return ;
} }
struct super_operations presto_super_ops = {
.read_inode = presto_read_inode,
.put_super = presto_put_super,
};
/* symlinks can be chowned */ /* symlinks can be chowned */
struct inode_operations presto_sym_iops = { struct inode_operations presto_sym_iops = {
setattr: presto_setattr .setattr = presto_setattr
}; };
/* NULL for now */ /* NULL for now */
struct file_operations presto_sym_fops; struct file_operations presto_sym_fops;
struct super_operations presto_super_ops = {
read_inode: presto_read_inode,
put_super: presto_put_super,
remount_fs: presto_remount
};
MODULE_LICENSE("GPL");
This diff is collapsed.
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
/* * vim:expandtab:shiftwidth=8:tabstop=8:
* Intermezzo. (C) 1998 Peter J. Braam *
* Copyright (C) 1998 Peter J. Braam <braam@clusterfs.com>
*
* This file is part of InterMezzo, http://www.inter-mezzo.org.
*
* InterMezzo is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* InterMezzo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with InterMezzo; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/time.h> #include <linux/sched.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/ext2_fs.h> #include <linux/ext2_fs.h>
#include <linux/intermezzo_fs.h> #include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h> #include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#if defined(CONFIG_EXT2_FS) #if defined(CONFIG_EXT2_FS)
...@@ -46,7 +62,7 @@ static void *presto_e2_trans_start(struct presto_file_set *fset, struct inode *i ...@@ -46,7 +62,7 @@ static void *presto_e2_trans_start(struct presto_file_set *fset, struct inode *i
return ERR_PTR(-ENOSPC); return ERR_PTR(-ENOSPC);
} }
if ( (op != PRESTO_OP_UNLINK && op != PRESTO_OP_RMDIR) if ( (op != KML_OPCODE_UNLINK && op != KML_OPCODE_RMDIR)
&& avail_kmlblocks < 6 ) { && avail_kmlblocks < 6 ) {
return ERR_PTR(-ENOSPC); return ERR_PTR(-ENOSPC);
} }
...@@ -55,10 +71,17 @@ static void *presto_e2_trans_start(struct presto_file_set *fset, struct inode *i ...@@ -55,10 +71,17 @@ static void *presto_e2_trans_start(struct presto_file_set *fset, struct inode *i
static void presto_e2_trans_commit(struct presto_file_set *fset, void *handle) static void presto_e2_trans_commit(struct presto_file_set *fset, void *handle)
{ {
do {} while (0); do {} while (0);
}
static int presto_e2_has_all_data(struct inode *inode)
{
BUG();
return 0;
} }
struct journal_ops presto_ext2_journal_ops = { struct journal_ops presto_ext2_journal_ops = {
tr_all_data: presto_e2_has_all_data,
tr_avail: presto_e2_freespace, tr_avail: presto_e2_freespace,
tr_start: presto_e2_trans_start, tr_start: presto_e2_trans_start,
tr_commit: presto_e2_trans_commit, tr_commit: presto_e2_trans_commit,
......
This diff is collapsed.
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
/* * vim:expandtab:shiftwidth=8:tabstop=8:
* Intermezzo. (C) 1998 Peter J. Braam *
* Intermezzo. (C) 2000 Red Hat, Inc. * Copyright (C) 1998 Peter J. Braam <braam@clusterfs.com>
* Intermezzo. (C) 2000 Los Alamos National Laboratory * Copyright (C) 2000 Red Hat, Inc.
* Intermezzo. (C) 2000 TurboLinux, Inc. * Copyright (C) 2000 Los Alamos National Laboratory
* Intermezzo. (C) 2001 Mountain View Data, Inc. * Copyright (C) 2000 TurboLinux, Inc.
* Copyright (C) 2001 Mountain View Data, Inc.
*
* This file is part of InterMezzo, http://www.inter-mezzo.org.
*
* InterMezzo is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* InterMezzo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with InterMezzo; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/param.h> #include <linux/param.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/time.h> #include <linux/sched.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/string.h> #include <linux/string.h>
#ifdef CONFIG_OBDFS_FS #ifdef CONFIG_OBDFS_FS
...@@ -23,9 +41,7 @@ ...@@ -23,9 +41,7 @@
#endif #endif
#include <linux/intermezzo_fs.h> #include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h> #include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#ifdef CONFIG_OBDFS_FS #ifdef CONFIG_OBDFS_FS
...@@ -162,17 +178,17 @@ void presto_obdfs_trans_commit(struct presto_file_set *fset, void *handle) ...@@ -162,17 +178,17 @@ void presto_obdfs_trans_commit(struct presto_file_set *fset, void *handle)
void presto_obdfs_journal_file_data(struct inode *inode) void presto_obdfs_journal_file_data(struct inode *inode)
{ {
#ifdef EXT3_JOURNAL_DATA_FL #ifdef EXT3_JOURNAL_DATA_FL
EXT3_I(inode)->i_flags |= EXT3_JOURNAL_DATA_FL; inode->u.ext3_i.i_flags |= EXT3_JOURNAL_DATA_FL;
#else #else
#warning You must have a facility to enable journaled writes for recovery! #warning You must have a facility to enable journaled writes for recovery!
#endif #endif
} }
struct journal_ops presto_obdfs_journal_ops = { struct journal_ops presto_obdfs_journal_ops = {
tr_avail: presto_obdfs_freespace, .tr_avail = presto_obdfs_freespace,
tr_start: presto_obdfs_trans_start, .tr_start = presto_obdfs_trans_start,
tr_commit: presto_obdfs_trans_commit, .tr_commit = presto_obdfs_trans_commit,
tr_journal_data: presto_obdfs_journal_file_data .tr_journal_data = presto_obdfs_journal_file_data
}; };
#endif #endif
This diff is collapsed.
This diff is collapsed.
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
/* * vim:expandtab:shiftwidth=8:tabstop=8:
* * Intermezzo. (C) 1998 Peter J. Braam *
* */ * Copyright (C) 1998 Peter J. Braam <braam@clusterfs.com>
*
* This file is part of InterMezzo, http://www.inter-mezzo.org.
*
* InterMezzo is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* InterMezzo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with InterMezzo; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/time.h> #include <linux/sched.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/string.h> #include <linux/string.h>
#if 0
/* XFS Support not there yet */
#ifdef CONFIG_FS_XFS #ifdef CONFIG_FS_XFS
#include <linux/xfs_fs.h> #include <linux/xfs_fs.h>
#endif #endif
#include <linux/intermezzo_fs.h> #include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h> #include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#include <linux/intermezzo_journal.h> #include <linux/intermezzo_journal.h>
#if 0 #if 0
...@@ -118,18 +136,27 @@ static void presto_xfs_trans_commit(struct presto_file_set *fset, void *handle) ...@@ -118,18 +136,27 @@ static void presto_xfs_trans_commit(struct presto_file_set *fset, void *handle)
xfs_trans_stop(handle); xfs_trans_stop(handle);
} }
void presto_xfs_journal_file_data(struct inode *inode) static void presto_xfs_journal_file_data(struct inode *inode)
{ {
return; return;
} }
static int presto_xfs_has_all_data(struct inode *inode)
{
BUG();
return 0;
}
struct journal_ops presto_xfs_journal_ops = { struct journal_ops presto_xfs_journal_ops = {
tr_avail: presto_xfs_freespace, .tr_all_data = presto_xfs_has_all_data,
tr_start: presto_xfs_trans_start, .tr_avail = presto_xfs_freespace,
tr_commit: presto_xfs_trans_commit, .tr_start = presto_xfs_trans_start,
tr_journal_data: presto_xfs_journal_file_data .tr_commit = presto_xfs_trans_commit,
.tr_journal_data = presto_xfs_journal_file_data
}; };
#endif /* CONFIG_XFS_FS */ #endif
#endif /* CONFIG_XFS_FS */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment