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 @@
#include <linux/smp.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/cpufreq.h>
#include <asm/io.h>
#include <asm/smp.h>
......
......@@ -7,6 +7,7 @@
#include <linux/init.h>
#include <linux/timex.h>
#include <linux/errno.h>
#include <linux/cpufreq.h>
#include <asm/timer.h>
#include <asm/io.h>
......
......@@ -34,6 +34,8 @@
#include <asm/timer.h>
#include <asm/uaccess.h>
extern rwlock_t xtime_lock;
#ifndef CONFIG_PCI
asmlinkage int sys_pciconfig_read(unsigned long bus,
......@@ -737,8 +739,10 @@ static void pcic_clear_clock_irq(void)
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();
do_timer(regs);
write_unlock(&xtime_lock);
}
#define USECS_PER_JIFFY 10000 /* We have 100HZ "standard" timer for sparc */
......@@ -776,25 +780,17 @@ void __init pci_time_init(void)
static __inline__ unsigned long do_gettimeoffset(void)
{
struct tasklet_struct *t;
unsigned long offset = 0;
/*
/*
* We devide all to 100
* 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;
count = ((count/100)*USECS_PER_JIFFY) / (TICK_TIMER_LIMIT/100);
t = &bh_task_vec[TIMER_BH];
if (test_bit(TASKLET_STATE_SCHED, &t->state))
offset = 1000000;
return offset + count;
return count;
}
extern unsigned long wall_jiffies;
extern rwlock_t xtime_lock;
static void pci_do_gettimeofday(struct timeval *tv)
{
......
......@@ -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]);
#endif
/* Protect counter clear so that do_gettimeoffset works */
write_lock(&xtime_lock);
#ifdef CONFIG_SUN4
if((idprom->id_machtype == (SM_SUN4 | SM_4_260)) ||
(idprom->id_machtype == (SM_SUN4 | SM_4_110))) {
......@@ -140,8 +142,6 @@ void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
#endif
clear_clock_irq();
write_lock(&xtime_lock);
do_timer(regs);
/* Determine when to update the Mostek clock. */
......@@ -459,17 +459,7 @@ void __init time_init(void)
extern __inline__ unsigned long do_gettimeoffset(void)
{
struct tasklet_struct *t;
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;
return (*master_l10_counter >> 10) & 0x1fffff;
}
/* Ok, my cute asm atomicity trick doesn't work anymore.
......
......@@ -32,6 +32,7 @@ CONFIG_HW_CONSOLE=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_SMP=y
# CONFIG_PREEMPT is not set
CONFIG_NR_CPUS=4
CONFIG_SPARC64=y
CONFIG_HOTPLUG=y
CONFIG_HAVE_DEC_LOCK=y
......@@ -59,7 +60,6 @@ CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=m
# CONFIG_SUNOS_EMUL is not set
CONFIG_SOLARIS_EMUL=m
CONFIG_NR_CPUS=64
#
# Parallel port support
......@@ -220,6 +220,8 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_IDEPCI_SHARE_IRQ is not set
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_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
......@@ -1025,15 +1027,20 @@ CONFIG_USB_TEST=m
CONFIG_BLUEZ=m
CONFIG_BLUEZ_L2CAP=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
#
CONFIG_BLUEZ_HCIUSB=m
CONFIG_BLUEZ_USB_FW_LOAD=y
CONFIG_BLUEZ_USB_ZERO_PACKET=y
CONFIG_BLUEZ_HCIUART=m
CONFIG_BLUEZ_HCIUART_H4=y
CONFIG_BLUEZ_HCIUART_BCSP=y
# CONFIG_BLUEZ_HCIDTL1 is not set
# CONFIG_BLUEZ_HCIBT3C is not set
# CONFIG_BLUEZ_HCIBLUECARD is not set
......
......@@ -247,7 +247,7 @@ static inline void *ebus_alloc(size_t size)
mem = kmalloc(size, GFP_ATOMIC);
if (!mem)
panic(__FUNCTION__ ": out of memory");
panic("ebus_alloc: out of memory");
memset((char *)mem, 0, size);
return mem;
}
......
......@@ -1158,18 +1158,6 @@ static int rx_pkt(struct atm_dev *dev)
}
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)
printk("Drop control packets\n");
goto out_free_desc;
......
......@@ -32,6 +32,7 @@
#define __NO_VERSION__
#include "drmP.h"
int DRM(irq_busid)(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
......@@ -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)))
return -EFAULT;
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
if (dev) p.irq = dev->irq;
else p.irq = 0;
if (!dev) {
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",
p.busnum, p.devnum, p.funcnum, p.irq);
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
......
......@@ -74,7 +74,7 @@ do { \
ret = -EBUSY; \
break; \
} \
schedule_timeout(max(HZ/100,1)); \
schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
if (signal_pending(current)) { \
ret = -EINTR; \
break; \
......
......@@ -157,9 +157,18 @@ void mga_do_dma_flush( drm_mga_private_t *dev_priv )
{
drm_mga_primary_buffer_t *primary = &dev_priv->prim;
u32 head, tail;
DMA_LOCALS;
u32 status = 0;
int i;
DMA_LOCALS;
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 ) {
DRM_DEBUG( " bailing out...\n" );
return;
......
......@@ -113,7 +113,7 @@
#define CHECK_TTY_COUNT 1
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 */
#ifdef CONFIG_UNIX98_PTYS
......@@ -338,7 +338,7 @@ struct tty_driver *get_tty_driver(kdev_t device)
minor = minor(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)
continue;
if (minor < p->minor_start)
......@@ -2083,10 +2083,7 @@ int tty_register_driver(struct tty_driver *driver)
if (!driver->put_char)
driver->put_char = tty_default_put_char;
driver->prev = 0;
driver->next = tty_drivers;
if (tty_drivers) tty_drivers->prev = driver;
tty_drivers = driver;
list_add(&driver->tty_drivers, &tty_drivers);
if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
for(i = 0; i < driver->num; i++)
......@@ -2110,7 +2107,7 @@ int tty_unregister_driver(struct tty_driver *driver)
if (*driver->refcount)
return -EBUSY;
for (p = tty_drivers; p; p = p->next) {
list_for_each_entry(p, &tty_drivers, tty_drivers) {
if (p == driver)
found++;
else if (p->major == driver->major)
......@@ -2127,13 +2124,7 @@ int tty_unregister_driver(struct tty_driver *driver)
} else
register_chrdev(driver->major, othername, &tty_fops);
if (driver->prev)
driver->prev->next = driver->next;
else
tty_drivers = driver->next;
if (driver->next)
driver->next->prev = driver->prev;
list_del(&driver->tty_drivers);
/*
* Free the termios and termios_locked structures because
......
......@@ -1576,7 +1576,6 @@ static void esp_exec_cmd(struct esp *esp)
memset(esp_dev, 0, sizeof(struct esp_device));
SDptr->hostdata = esp_dev;
}
}
esp->snip = 0;
esp->msgout_len = 0;
......@@ -3589,7 +3588,7 @@ static int target_with_ants_in_pants(struct esp *esp,
Scsi_Cmnd *SCptr,
struct esp_device *esp_dev)
{
if (esp_dev->sync || SCptr->SDptr->borken) {
if (esp_dev->sync || SCptr->device->borken) {
/* sorry, no can do */
ESPSDTR(("forcing to async, "));
build_sync_nego_msg(esp, 0, 0);
......@@ -3811,7 +3810,7 @@ static int check_multibyte_msg(struct esp *esp)
/* Regardless, next try for sync transfers. */
build_sync_nego_msg(esp, esp->sync_defp, 15);
espo_dev->sync = 1;
esp_dev->sync = 1;
esp->snip = 1;
message_out = EXTENDED_MESSAGE;
}
......
......@@ -458,7 +458,7 @@ decode_negTokenInit(unsigned char *security_blob, int length,
unsigned int cls, con, tag, oidlen, rc;
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);
......
......@@ -32,7 +32,7 @@
#include "cifs_debug.h"
void
dump_mem(char *label, void *data, int length)
cifs_dump_mem(char *label, void *data, int length)
{
int i, j;
int *intptr = data;
......
......@@ -23,7 +23,7 @@
#ifndef _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 */
void dump_smb(struct smb_hdr *, int);
......
This diff is collapsed.
......@@ -168,7 +168,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
} else if (temp[0] != (char) 0) {
cERROR(1,
("\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;
} else {
if ((length != sizeof (struct smb_hdr) - 1)
......@@ -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
hash ever - for better security */
/* toUpper(cifs_sb->local_nls, password_with_pad);
SMBencrypt(password_with_pad, cryptKey,session_key);
dump_mem("\nCIFS (Samba encrypt): ", session_key,CIFS_SESSION_KEY_SIZE); */
SMBencrypt(password_with_pad, cryptKey,session_key); */
rc = CIFSSessSetup(xid, pSesInfo,
volume_info.username,
......@@ -925,7 +924,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
bcc_ptr += CIFS_SESSION_KEY_SIZE;
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++;
}
......@@ -983,13 +982,12 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
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);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
&bytes_returned, 1);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92);*/
if (rc) {
/* rc = map_smb_to_linux_error(smb_buffer_response); now done in SendReceive */
} else if ((smb_buffer_response->WordCount == 3)
......@@ -1011,7 +1009,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
pSMBr->resp.SecurityBlobLength;
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) {
if ((long) (bcc_ptr) % 2) {
remaining_words =
(BCC(smb_buffer_response)
- 1) / 2;
......@@ -1069,7 +1067,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, char *user,
} else { /* ASCII */
len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int)
if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1,GFP_KERNEL);
......@@ -1176,7 +1174,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
bcc_ptr += SecurityBlobLength;
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++;
}
......@@ -1229,13 +1227,12 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
strcpy(bcc_ptr, CIFS_NETWORK_OPSYS);
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);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response,
&bytes_returned, 1);
/* dump_mem("\nSessSetup response is: ", smb_buffer_response, 92); */
if (rc) {
/* rc = map_smb_to_linux_error(smb_buffer_response); *//* done in SendReceive now */
} else if ((smb_buffer_response->WordCount == 3)
......@@ -1265,7 +1262,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) {
if ((long) (bcc_ptr) % 2) {
remaining_words =
(BCC(smb_buffer_response)
- 1) / 2;
......@@ -1328,7 +1325,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
} else { /* ASCII */
len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int)
if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1, GFP_KERNEL);
......@@ -1465,16 +1462,16 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob->DomainName.MaximumLength =
cpu_to_le16(SecurityBlob->DomainName.Length);
SecurityBlob->DomainName.Buffer =
cpu_to_le32((unsigned int) &SecurityBlob->
cpu_to_le32((long) &SecurityBlob->
DomainString -
(unsigned int) &SecurityBlob->Signature);
(long) &SecurityBlob->Signature);
bcc_ptr += SecurityBlob->DomainName.Length;
SecurityBlobLength += SecurityBlob->DomainName.Length;
SecurityBlob->DomainName.Length =
cpu_to_le16(SecurityBlob->DomainName.Length);
}
if (ses->capabilities & CAP_UNICODE) {
if ((int) bcc_ptr % 2) {
if ((long) bcc_ptr % 2) {
*bcc_ptr = 0;
bcc_ptr++;
}
......@@ -1511,7 +1508,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
SecurityBlob->NegotiateFlags =
cpu_to_le32(SecurityBlob->NegotiateFlags);
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);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
......@@ -1564,7 +1561,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
if(SecurityBlob2->NegotiateFlags & NTLMSSP_NEGOTIATE_NTLMV2)
*pNTLMv2_flag = TRUE;
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) {
if ((long) (bcc_ptr) % 2) {
remaining_words =
(BCC(smb_buffer_response)
- 1) / 2;
......@@ -1650,7 +1647,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
} else { /* ASCII */
len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) - (int)
if (((long) bcc_ptr + len) - (long)
pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) {
ses->serverOS =
......@@ -1846,7 +1843,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlobLength += 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++;
}
......@@ -1918,7 +1915,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlob->NegotiateFlags =
cpu_to_le32(SecurityBlob->NegotiateFlags);
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);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
......@@ -1959,7 +1956,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
("\nNTLMSSP response to Authenticate "));
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
if ((int) (bcc_ptr) % 2) {
if ((long) (bcc_ptr) % 2) {
remaining_words =
(BCC(smb_buffer_response)
- 1) / 2;
......@@ -2037,8 +2034,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
} else { /* ASCII */
len = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + len) -
(int) pByteArea(smb_buffer_response)
if (((long) bcc_ptr + len) -
(long) pByteArea(smb_buffer_response)
<= BCC(smb_buffer_response)) {
ses->serverOS = kcalloc(len + 1,GFP_KERNEL);
strncpy(ses->serverOS,bcc_ptr, len);
......@@ -2142,7 +2139,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strcpy(bcc_ptr, "?????");
bcc_ptr += strlen("?????");
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);
BCC(smb_buffer) = cpu_to_le16(BCC(smb_buffer));
......@@ -2159,8 +2156,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
if (smb_buffer->Flags2 &= SMBFLG2_UNICODE) {
length = UniStrnlen((wchar_t *) bcc_ptr, 512);
if (((int) bcc_ptr + (2 * length)) -
(int) pByteArea(smb_buffer_response) <=
if (((long) bcc_ptr + (2 * length)) -
(long) pByteArea(smb_buffer_response) <=
BCC(smb_buffer_response)) {
tcon->nativeFileSystem =
kcalloc(length + 2, GFP_KERNEL);
......@@ -2175,8 +2172,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
/* else do not bother copying these informational fields */
} else {
length = strnlen(bcc_ptr, 1024);
if (((int) bcc_ptr + length) -
(int) pByteArea(smb_buffer_response) <=
if (((long) bcc_ptr + length) -
(long) pByteArea(smb_buffer_response) <=
BCC(smb_buffer_response)) {
tcon->nativeFileSystem =
kcalloc(length + 1, GFP_KERNEL);
......
......@@ -572,9 +572,6 @@ fill_in_inode(struct inode *tmp_inode,
tmp_inode->i_size = pfindData->EndOfFile;
tmp_inode->i_blocks =
do_div(pfindData->AllocationSize, tmp_inode->i_blksize);
cFYI(1,
("\nFinddata alloc size (from smb) %lld",
pfindData->AllocationSize));
if (pfindData->AllocationSize < pfindData->EndOfFile)
cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file "));
cFYI(1,
......@@ -652,10 +649,6 @@ unix_fill_in_inode(struct inode *tmp_inode,
tmp_inode->i_size = pfindData->EndOfFile;
tmp_inode->i_blocks =
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)) {
cFYI(1, (" File inode "));
tmp_inode->i_op = &cifs_file_inode_ops;
......
......@@ -131,9 +131,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
inode->i_blksize =
(pTcon->ses->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;
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)
cFYI(1, ("\nServer inconsistency Error: it says allocation size less than end of file "));
cFYI(1,
......
......@@ -694,8 +694,8 @@ const struct nt_err_code_struct nt_errs[] = {
/*****************************************************************************
Print an error message from the status code
*****************************************************************************/
void
print_status(__u32 status_code)
/* void
cifs_print_status(__u32 status_code)
{
int idx = 0;
......@@ -709,4 +709,4 @@ print_status(__u32 status_code)
idx++;
}
return;
}
} */
......@@ -4,9 +4,11 @@
obj-$(CONFIG_INTERMEZZO_FS) += intermezzo.o
intermezzo-objs := journal_reiserfs.o cache.o journal.o presto.o vfs.o \
psdev.o upcall.o methods.o sysctl.o dcache.o dir.o \
super.o journal_ext2.o journal_ext3.o journal_xfs.o \
inode.o file.o journal_obdfs.o
intermezzo-objs := cache.o dcache.o dir.o ext_attr.o file.o fileset.o \
inode.o io_daemon.o journal.o journal_ext2.o journal_ext3.o \
journal_obdfs.o journal_reiserfs.o journal_tmpfs.o journal_xfs.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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Extended attribute handling for presto.
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* 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.
* Shirish H. Phatak
* Tacit Networks, Inc.
* 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.
*
* Extended attribute handling for presto.
*/
#define __NO_VERSION__
......@@ -14,6 +29,7 @@
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/unistd.h>
#include <asm/system.h>
......@@ -22,18 +38,16 @@
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/locks.h>
#include <linux/smp_lock.h>
#include <linux/string.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <asm/segment.h>
#include <linux/smp_lock.h>
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#ifdef CONFIG_FS_EXT_ATTR
#include <linux/ext_attr.h>
......@@ -41,9 +55,6 @@
extern inline void presto_debug_fail_blkdev(struct presto_file_set *fset,
unsigned long value);
extern int presto_prep(struct dentry *, struct presto_cache **,
struct presto_file_set **);
/* VFS interface */
/* XXX! Fixme test for user defined attributes */
......@@ -75,7 +86,7 @@ int presto_set_ext_attr(struct inode *inode,
* we do a reverse mapping from inode to the first 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;
return -EINVAL;
}
......@@ -99,12 +110,13 @@ int presto_set_ext_attr(struct inode *inode,
* (works for ext3)
*/
if (flags & EXT_ATTR_FLAG_USER) {
PRESTO_ALLOC(buf, char *, buffer_len);
PRESTO_ALLOC(buf, buffer_len);
if (!buf) {
printk("InterMezzo: out of memory!!!\n");
CERROR("InterMezzo: out of memory!!!\n");
return -ENOMEM;
}
if (copy_from_user(buf, buffer, buffer_len))
error = copy_from_user(buf, buffer, buffer_len);
if (error)
return -EFAULT;
} else
buf = buffer;
......@@ -172,7 +184,7 @@ int lento_set_ext_attr(const char *path, const char *name,
fset = presto_fset(dentry);
error = -EINVAL;
if ( !fset ) {
printk("No fileset!\n");
CERROR("No fileset!\n");
EXIT;
goto exit_dentry;
}
......
This diff is collapsed.
This diff is collapsed.
/*
* Super block/filesystem wide operations
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* 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
* Michael Callahan <callahan@maths.ox.ac.uk>
* 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.
*
* Rewritten for Linux 2.1. Peter Braam <braam@cs.cmu.edu>
* Copyright (C) Carnegie Mellon University
* 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.
*
* Super block/filesystem wide operations
*/
#define __NO_VERSION__
......@@ -15,6 +31,7 @@
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/unistd.h>
#include <asm/system.h>
......@@ -23,61 +40,53 @@
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <linux/string.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <asm/segment.h>
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.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 *);
void presto_set_ops(struct inode *inode, struct filter_fs *filter)
{
ENTRY;
if (inode->i_gid == presto_excluded_gid ) {
EXIT;
CDEBUG(D_INODE, "excluded methods for %ld at %p, %p\n",
inode->i_ino, inode->i_op, inode->i_fop);
return;
}
ENTRY;
if (!inode || is_bad_inode(inode))
return;
if (S_ISREG(inode->i_mode)) {
if ( !filter_c2cfiops(filter) ) {
filter_setup_file_ops(filter,
inode, &presto_file_iops,
&presto_file_fops);
inode, &presto_file_iops,
&presto_file_fops);
}
inode->i_op = filter_c2ufiops(filter);
inode->i_fop = filter_c2uffops(filter);
inode->i_op = filter_c2ufiops(filter);
inode->i_fop = filter_c2uffops(filter);
CDEBUG(D_INODE, "set file methods for %ld to %p\n",
inode->i_ino, inode->i_op);
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = filter_c2udiops(filter);
inode->i_fop = filter_c2udfops(filter);
CDEBUG(D_INODE, "set dir methods for %ld to %p lookup %p\n",
inode->i_ino, inode->i_op, inode->i_op->lookup);
inode->i_op = filter_c2udiops(filter);
inode->i_fop = filter_c2udfops(filter);
CDEBUG(D_INODE, "set dir methods for %ld to %p ioctl %p\n",
inode->i_ino, inode->i_op, inode->i_fop->ioctl);
} else if (S_ISLNK(inode->i_mode)) {
if ( !filter_c2csiops(filter)) {
filter_setup_symlink_ops(filter,
inode,
&presto_sym_iops,
&presto_sym_fops);
&presto_sym_fops);
}
inode->i_op = filter_c2usiops(filter);
inode->i_fop = filter_c2usfops(filter);
inode->i_op = filter_c2usiops(filter);
inode->i_fop = filter_c2usfops(filter);
CDEBUG(D_INODE, "set link methods for %ld to %p\n",
inode->i_ino, inode->i_op);
}
EXIT;
EXIT;
}
void presto_read_inode(struct inode *inode)
......@@ -86,7 +95,7 @@ void presto_read_inode(struct inode *inode)
cache = presto_get_cache(inode);
if ( !cache ) {
printk("PRESTO: BAD, BAD: cannot find cache\n");
CERROR("PRESTO: BAD, BAD: cannot find cache\n");
make_bad_inode(inode);
return ;
}
......@@ -94,37 +103,52 @@ void presto_read_inode(struct inode *inode)
filter_c2csops(cache->cache_filter)->read_inode(inode);
CDEBUG(D_INODE, "presto_read_inode: ino %ld, gid %d\n",
inode->i_ino, inode->i_gid);
// if (inode->i_gid == presto_excluded_gid)
// return;
inode->i_ino, inode->i_gid);
presto_set_ops(inode, cache->cache_filter);
presto_set_ops(inode, cache->cache_filter);
/* 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 upc_comm *psdev;
struct upc_channel *channel;
struct super_operations *sops;
struct list_head *lh;
int err;
ENTRY;
cache = presto_find_cache(sb);
ENTRY;
cache = presto_cache_find(to_kdev_t(sb->s_dev));
if (!cache) {
EXIT;
EXIT;
goto exit;
}
psdev = &upc_comms[presto_c2m(cache)];
}
channel = &izo_channels[presto_c2m(cache)];
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)
sops->put_super(sb);
/* free any remaining async upcalls when the filesystem is unmounted */
lh = psdev->uc_pending.next;
while ( lh != &psdev->uc_pending) {
spin_lock(&channel->uc_lock);
lh = channel->uc_pending.next;
while ( lh != &channel->uc_pending) {
struct upc_req *req;
req = list_entry(lh, struct upc_req, rq_chain);
......@@ -136,6 +160,8 @@ void presto_put_super(struct super_block *sb)
PRESTO_FREE(req->rq_data, req->rq_bufsize);
PRESTO_FREE(req, sizeof(struct upc_req));
}
list_del(&cache->cache_channel_list);
spin_unlock(&channel->uc_lock);
presto_free_cache(cache);
......@@ -146,18 +172,16 @@ void presto_put_super(struct super_block *sb)
return ;
}
struct super_operations presto_super_ops = {
.read_inode = presto_read_inode,
.put_super = presto_put_super,
};
/* symlinks can be chowned */
struct inode_operations presto_sym_iops = {
setattr: presto_setattr
.setattr = presto_setattr
};
/* NULL for now */
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.
/*
* Intermezzo. (C) 1998 Peter J. Braam
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* 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/kernel.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/string.h>
#include <linux/ext2_fs.h>
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#if defined(CONFIG_EXT2_FS)
......@@ -46,7 +62,7 @@ static void *presto_e2_trans_start(struct presto_file_set *fset, struct inode *i
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 ) {
return ERR_PTR(-ENOSPC);
}
......@@ -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)
{
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 = {
tr_all_data: presto_e2_has_all_data,
tr_avail: presto_e2_freespace,
tr_start: presto_e2_trans_start,
tr_commit: presto_e2_trans_commit,
......
This diff is collapsed.
/*
* Intermezzo. (C) 1998 Peter J. Braam
* Intermezzo. (C) 2000 Red Hat, Inc.
* Intermezzo. (C) 2000 Los Alamos National Laboratory
* Intermezzo. (C) 2000 TurboLinux, Inc.
* Intermezzo. (C) 2001 Mountain View Data, Inc.
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* Copyright (C) 1998 Peter J. Braam <braam@clusterfs.com>
* Copyright (C) 2000 Red Hat, Inc.
* Copyright (C) 2000 Los Alamos National Laboratory
* 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/param.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/string.h>
#ifdef CONFIG_OBDFS_FS
......@@ -23,9 +41,7 @@
#endif
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#ifdef CONFIG_OBDFS_FS
......@@ -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)
{
#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
#warning You must have a facility to enable journaled writes for recovery!
#endif
}
struct journal_ops presto_obdfs_journal_ops = {
tr_avail: presto_obdfs_freespace,
tr_start: presto_obdfs_trans_start,
tr_commit: presto_obdfs_trans_commit,
tr_journal_data: presto_obdfs_journal_file_data
.tr_avail = presto_obdfs_freespace,
.tr_start = presto_obdfs_trans_start,
.tr_commit = presto_obdfs_trans_commit,
.tr_journal_data = presto_obdfs_journal_file_data
};
#endif
This diff is collapsed.
This diff is collapsed.
/*
* * Intermezzo. (C) 1998 Peter J. Braam
* */
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* 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/kernel.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/string.h>
#if 0
/* XFS Support not there yet */
#ifdef CONFIG_FS_XFS
#include <linux/xfs_fs.h>
#endif
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#include <linux/intermezzo_journal.h>
#if 0
......@@ -118,18 +136,27 @@ static void presto_xfs_trans_commit(struct presto_file_set *fset, void *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;
}
static int presto_xfs_has_all_data(struct inode *inode)
{
BUG();
return 0;
}
struct journal_ops presto_xfs_journal_ops = {
tr_avail: presto_xfs_freespace,
tr_start: presto_xfs_trans_start,
tr_commit: presto_xfs_trans_commit,
tr_journal_data: presto_xfs_journal_file_data
.tr_all_data = presto_xfs_has_all_data,
.tr_avail = presto_xfs_freespace,
.tr_start = presto_xfs_trans_start,
.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