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,9 +780,6 @@ 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
......@@ -786,15 +787,10 @@ static __inline__ unsigned long do_gettimeoffset(void)
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;
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
/*
*
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* Copyright (C) 2000 Stelias Computing, Inc.
* Copyright (C) 2000 Red Hat, 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.
*/
#define __NO_VERSION__
......@@ -19,14 +32,14 @@
#include <linux/ext2_fs.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
#include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
/*
......@@ -37,24 +50,27 @@
The methods for the cache are set up in methods.
*/
extern kmem_cache_t * presto_dentry_slab;
/* the intent of this hash is to have collision chains of length 1 */
#define CACHES_BITS 8
#define CACHES_SIZE (1 << CACHES_BITS)
#define CACHES_MASK CACHES_SIZE - 1
static struct list_head presto_caches[CACHES_SIZE];
static inline int presto_cache_hash(struct super_block *sb)
static inline int presto_cache_hash(kdev_t dev)
{
return (CACHES_MASK) & ((unsigned long)sb / L1_CACHE_BYTES);
return (CACHES_MASK) & ((0x000F & (major(dev)) << 8) + (0x000F & minor(dev)));
}
inline void presto_cache_add(struct presto_cache *cache, struct super_block *sb)
inline void presto_cache_add(struct presto_cache *cache, kdev_t dev)
{
list_add(&cache->cache_chain,
&presto_caches[presto_cache_hash(sb)]);
&presto_caches[presto_cache_hash(dev)]);
cache->cache_dev = dev;
}
inline void presto_init_cache_hash(void)
inline void presto_cache_init_hash(void)
{
int i;
for ( i = 0; i < CACHES_SIZE; i++ ) {
......@@ -63,17 +79,18 @@ inline void presto_init_cache_hash(void)
}
/* map a device to a cache */
struct presto_cache *presto_find_cache(struct super_block *sb)
struct presto_cache *presto_cache_find(kdev_t dev)
{
struct presto_cache *cache;
struct list_head *lh, *tmp;
lh = tmp = &(presto_caches[presto_cache_hash(sb)]);
lh = tmp = &(presto_caches[presto_cache_hash(dev)]);
while ( (tmp = lh->next) != lh ) {
cache = list_entry(tmp, struct presto_cache, cache_chain);
if (cache->cache_sb == sb)
if ( kdev_same(cache->cache_dev, dev) ) {
return cache;
}
}
return NULL;
}
......@@ -82,85 +99,19 @@ struct presto_cache *presto_find_cache(struct super_block *sb)
struct presto_cache *presto_get_cache(struct inode *inode)
{
struct presto_cache *cache;
ENTRY;
/* find the correct presto_cache here, based on the device */
cache = presto_find_cache(inode->i_sb);
cache = presto_cache_find(to_kdev_t(inode->i_dev));
if ( !cache ) {
printk("WARNING: no presto cache for dev %s, ino %ld\n",
inode->i_sb->s_id, inode->i_ino);
CERROR("WARNING: no presto cache for dev %x, ino %ld\n",
inode->i_dev, inode->i_ino);
EXIT;
return NULL;
}
EXIT;
return cache;
}
/* list cache mount points for ioctl's or /proc/fs/intermezzo/mounts */
int presto_sprint_mounts(char *buf, int buflen, int minor)
{
int len = 0;
int i;
struct list_head *head, *tmp;
struct presto_cache *cache;
buf[0] = '\0';
for (i=0 ; i<CACHES_SIZE ; i++) {
head = tmp = &presto_caches[i];
while ( (tmp = tmp->next) != head ) {
cache = list_entry(tmp, struct presto_cache,
cache_chain);
if ( !cache->cache_root_fileset || !cache->cache_mtpt)
continue;
if ((minor != -1) &&
(cache->cache_psdev->uc_minor != minor))
continue;
if ( strlen(cache->cache_root_fileset) +
strlen(cache->cache_mtpt) +
strlen(cache->cache_psdev->uc_devname) +
4 > buflen - len)
break;
len += sprintf(buf + len, "%s %s %s\n",
cache->cache_root_fileset,
cache->cache_mtpt,
cache->cache_psdev->uc_devname);
}
}
buf[buflen-1] = '\0';
CDEBUG(D_SUPER, "%s\n", buf);
return len;
}
#ifdef CONFIG_KREINT
/* get mount point by volname
Arthur Ma, 2000.12.25
*/
int presto_get_mount (char *buf, int buflen, char *volname)
{
int i;
struct list_head *head, *tmp;
struct presto_cache *cache = NULL;
char *path = "";
buf[0] = '\0';
for (i=0 ; i<CACHES_SIZE ; i++) {
head = tmp = &presto_caches[i];
while ( (tmp = tmp->next) != head ) {
cache = list_entry(tmp, struct presto_cache,
cache_chain);
if ( !cache->cache_root_fileset || !cache->cache_mtpt)
continue;
if ( strcmp(cache->cache_root_fileset, volname) == 0)
break;
}
}
if (cache != NULL)
path = cache->cache_mtpt;
strncpy (buf, path, buflen);
return strlen (buf);
}
#endif
/* another debugging routine: check fs is InterMezzo fs */
int presto_ispresto(struct inode *inode)
{
......@@ -171,27 +122,25 @@ int presto_ispresto(struct inode *inode)
cache = presto_get_cache(inode);
if ( !cache )
return 0;
return (inode->i_sb == cache->cache_sb);
return kdev_same(to_kdev_t(inode->i_dev), cache->cache_dev);
}
/* setup a cache structure when we need one */
struct presto_cache *presto_init_cache(void)
struct presto_cache *presto_cache_init(void)
{
struct presto_cache *cache;
/* make a presto_cache structure for the hash */
PRESTO_ALLOC(cache, struct presto_cache *, sizeof(struct presto_cache));
PRESTO_ALLOC(cache, sizeof(struct presto_cache));
if ( cache ) {
memset(cache, 0, sizeof(struct presto_cache));
INIT_LIST_HEAD(&cache->cache_chain);
INIT_LIST_HEAD(&cache->cache_fset_list);
}
cache->cache_lock = SPIN_LOCK_UNLOCKED;
cache->cache_reserved = 0;
}
return cache;
}
/* free a cache structure and all of the memory it is pointing to */
inline void presto_free_cache(struct presto_cache *cache)
{
......@@ -199,12 +148,12 @@ inline void presto_free_cache(struct presto_cache *cache)
return;
list_del(&cache->cache_chain);
if (cache->cache_mtpt)
PRESTO_FREE(cache->cache_mtpt, strlen(cache->cache_mtpt) + 1);
if (cache->cache_type)
PRESTO_FREE(cache->cache_type, strlen(cache->cache_type) + 1);
if (cache->cache_root_fileset)
PRESTO_FREE(cache->cache_root_fileset, strlen(cache->cache_root_fileset) + 1);
if (cache->cache_sb && cache->cache_sb->s_root &&
presto_d2d(cache->cache_sb->s_root)) {
kmem_cache_free(presto_dentry_slab,
presto_d2d(cache->cache_sb->s_root));
cache->cache_sb->s_root->d_fsdata = NULL;
}
PRESTO_FREE(cache, sizeof(struct presto_cache));
}
......@@ -227,11 +176,12 @@ int presto_reserve_space(struct presto_cache *cache, loff_t req)
EXIT;
return 0;
}
spin_lock(&cache->cache_lock);
avail = filter->o_trops->tr_avail(cache, sb);
CDEBUG(D_SUPER, "ESC::%ld +++> %ld \n", (long) cache->cache_reserved,
(long) (cache->cache_reserved + req));
CDEBUG(D_SUPER, "ESC::Avail::%ld \n", (long) avail);
spin_lock(&cache->cache_lock);
if (req + cache->cache_reserved > avail) {
spin_unlock(&cache->cache_lock);
EXIT;
......@@ -240,6 +190,7 @@ int presto_reserve_space(struct presto_cache *cache, loff_t req)
cache->cache_reserved += req;
spin_unlock(&cache->cache_lock);
EXIT;
return 0;
}
......
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.
*
* Copyright (C) 2001. All rights reserved.
* Shirish H. Phatak
* Tacit Networks, Inc.
* 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.
*
* 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:
*
* Copryright (C) 1996 Peter J. Braam <braam@maths.ox.ac.uk> and
* 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>
* Copyright (C) Carnegie Mellon University
*
* 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.
*
* 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,33 +40,25 @@
#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);
if (!inode || is_bad_inode(inode))
return;
}
if (S_ISREG(inode->i_mode)) {
if ( !filter_c2cfiops(filter) ) {
filter_setup_file_ops(filter,
......@@ -63,8 +72,8 @@ void presto_set_ops(struct inode *inode, struct filter_fs *filter)
} 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);
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,
......@@ -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 ;
}
......@@ -96,35 +105,50 @@ void presto_read_inode(struct 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;
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);
cache = presto_cache_find(to_kdev_t(sb->s_dev));
if (!cache) {
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);
}
......@@ -58,7 +74,14 @@ static void presto_e2_trans_commit(struct presto_file_set *fset, void *handle)
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,
......
/*
* 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.
* Copyright (C) 2001 Tacit Networks, Inc. <phil@off.net>
*
* 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>
#include <linux/smp_lock.h>
......@@ -26,9 +45,7 @@
#endif
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#if defined(CONFIG_EXT3_FS) || defined (CONFIG_EXT3_FS_MODULE)
......@@ -52,9 +69,9 @@
static loff_t presto_e3_freespace(struct presto_cache *cache,
struct super_block *sb)
{
loff_t freebl = le32_to_cpu(sb->u.ext3_sb.s_es->s_free_blocks_count);
loff_t freebl = le32_to_cpu(EXT3_SB(sb)->s_es->s_free_blocks_count);
loff_t avail = freebl -
le32_to_cpu(sb->u.ext3_sb.s_es->s_r_blocks_count);
le32_to_cpu(EXT3_SB(sb)->s_es->s_r_blocks_count);
return (avail << EXT3_BLOCK_SIZE_BITS(sb));
}
......@@ -77,13 +94,13 @@ static void *presto_e3_trans_start(struct presto_file_set *fset,
return NULL;
}
avail_kmlblocks = inode->i_sb->u.ext3_sb.s_es->s_free_blocks_count;
avail_kmlblocks = EXT3_SB(inode->i_sb)->s_es->s_free_blocks_count;
if ( avail_kmlblocks < 3 ) {
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);
}
......@@ -105,52 +122,71 @@ static void *presto_e3_trans_start(struct presto_file_set *fset,
and operations involving the LML records
*/
switch (op) {
case PRESTO_OP_TRUNC:
case KML_OPCODE_TRUNC:
jblocks = one_path_blks + extra_name_blks + trunc_blks
+ EXT3_DELETE_TRANS_BLOCKS;
break;
case PRESTO_OP_RELEASE:
case KML_OPCODE_KML_TRUNC:
/* Hopefully this is a little better, but I'm still mostly
* guessing here. */
/* unlink 1 */
jblocks = extra_name_blks + trunc_blks +
EXT3_DELETE_TRANS_BLOCKS + 2;
/* unlink 2 */
jblocks += extra_name_blks + trunc_blks +
EXT3_DELETE_TRANS_BLOCKS + 2;
/* rename 1 */
jblocks += 2 * extra_path_blks + trunc_blks +
2 * EXT3_DATA_TRANS_BLOCKS + 2 + 3;
/* rename 2 */
jblocks += 2 * extra_path_blks + trunc_blks +
2 * EXT3_DATA_TRANS_BLOCKS + 2 + 3;
break;
case KML_OPCODE_RELEASE:
/*
jblocks = one_path_blks + lml_blks + 2*trunc_blks;
*/
jblocks = one_path_blks;
break;
case PRESTO_OP_SETATTR:
case KML_OPCODE_SETATTR:
jblocks = one_path_blks + trunc_blks + 1 ;
break;
case PRESTO_OP_CREATE:
case KML_OPCODE_CREATE:
jblocks = one_path_blks + trunc_blks
+ EXT3_DATA_TRANS_BLOCKS + 3 + 2;
break;
case PRESTO_OP_LINK:
case KML_OPCODE_LINK:
jblocks = one_path_blks + trunc_blks
+ EXT3_DATA_TRANS_BLOCKS + 2;
break;
case PRESTO_OP_UNLINK:
case KML_OPCODE_UNLINK:
jblocks = one_path_blks + extra_name_blks + trunc_blks
+ EXT3_DELETE_TRANS_BLOCKS + 2;
break;
case PRESTO_OP_SYMLINK:
case KML_OPCODE_SYMLINK:
jblocks = one_path_blks + extra_path_blks + trunc_blks
+ EXT3_DATA_TRANS_BLOCKS + 5;
break;
case PRESTO_OP_MKDIR:
case KML_OPCODE_MKDIR:
jblocks = one_path_blks + trunc_blks
+ EXT3_DATA_TRANS_BLOCKS + 4 + 2;
break;
case PRESTO_OP_RMDIR:
case KML_OPCODE_RMDIR:
jblocks = one_path_blks + extra_name_blks + trunc_blks
+ EXT3_DELETE_TRANS_BLOCKS + 1;
break;
case PRESTO_OP_MKNOD:
case KML_OPCODE_MKNOD:
jblocks = one_path_blks + trunc_blks +
EXT3_DATA_TRANS_BLOCKS + 3 + 2;
break;
case PRESTO_OP_RENAME:
case KML_OPCODE_RENAME:
jblocks = one_path_blks + extra_path_blks + trunc_blks +
2 * EXT3_DATA_TRANS_BLOCKS + 2 + 3;
break;
case PRESTO_OP_WRITE:
case KML_OPCODE_WRITE:
jblocks = one_path_blks;
/* add this when we can wrap our transaction with
that of ext3_file_write (ordered writes)
......@@ -162,7 +198,8 @@ static void *presto_e3_trans_start(struct presto_file_set *fset,
return NULL;
}
CDEBUG(D_JOURNAL, "creating journal handle (%d blocks)\n", jblocks);
CDEBUG(D_JOURNAL, "creating journal handle (%d blocks) for op %d\n",
jblocks, op);
/* journal_start/stop does not do its own locking while updating
* the handle/transaction information. Hence we create our own
* critical section to protect these calls. -SHP
......@@ -173,7 +210,7 @@ static void *presto_e3_trans_start(struct presto_file_set *fset,
return handle;
}
void presto_e3_trans_commit(struct presto_file_set *fset, void *handle)
static void presto_e3_trans_commit(struct presto_file_set *fset, void *handle)
{
if ( presto_no_journal(fset) || !handle)
return;
......@@ -184,7 +221,7 @@ void presto_e3_trans_commit(struct presto_file_set *fset, void *handle)
unlock_kernel();
}
void presto_e3_journal_file_data(struct inode *inode)
static void presto_e3_journal_file_data(struct inode *inode)
{
#ifdef EXT3_JOURNAL_DATA_FL
EXT3_I(inode)->i_flags |= EXT3_JOURNAL_DATA_FL;
......@@ -193,11 +230,56 @@ void presto_e3_journal_file_data(struct inode *inode)
#endif
}
/* The logic here is a slightly modified version of ext3/inode.c:block_to_path
*/
static int presto_e3_has_all_data(struct inode *inode)
{
int ptrs = EXT3_ADDR_PER_BLOCK(inode->i_sb);
int ptrs_bits = EXT3_ADDR_PER_BLOCK_BITS(inode->i_sb);
const long direct_blocks = EXT3_NDIR_BLOCKS,
indirect_blocks = ptrs,
double_blocks = (1 << (ptrs_bits * 2));
long block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
inode->i_sb->s_blocksize_bits;
ENTRY;
if (inode->i_size == 0) {
EXIT;
return 1;
}
if (block < direct_blocks) {
/* No indirect blocks, no problem. */
} else if (block < indirect_blocks + direct_blocks) {
block++;
} else if (block < double_blocks + indirect_blocks + direct_blocks) {
block += 2;
} else if (((block - double_blocks - indirect_blocks - direct_blocks)
>> (ptrs_bits * 2)) < ptrs) {
block += 3;
}
block *= (inode->i_sb->s_blocksize / 512);
CDEBUG(D_CACHE, "Need %ld blocks, have %ld.\n", block, inode->i_blocks);
if (block > inode->i_blocks) {
EXIT;
return 0;
}
EXIT;
return 1;
}
struct journal_ops presto_ext3_journal_ops = {
tr_avail: presto_e3_freespace,
tr_start: presto_e3_trans_start,
tr_commit: presto_e3_trans_commit,
tr_journal_data: presto_e3_journal_file_data
.tr_all_data = presto_e3_has_all_data,
.tr_avail = presto_e3_freespace,
.tr_start = presto_e3_trans_start,
.tr_commit = presto_e3_trans_commit,
.tr_journal_data = presto_e3_journal_file_data,
.tr_ilookup = presto_iget_ilookup
};
#endif /* CONFIG_EXT3_FS */
/*
* 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
/*
* 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/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 <linux/smp_lock.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/string.h>
#if 0
......@@ -26,9 +44,8 @@
#endif
#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>
#if defined(CONFIG_REISERFS_FS) || defined(CONFIG_REISERFS_FS_MODULE)
......@@ -52,9 +69,9 @@ static void *presto_reiserfs_trans_start(struct presto_file_set *fset,
__u32 avail_kmlblocks;
struct reiserfs_transaction_handle *th ;
PRESTO_ALLOC(th, struct reiserfs_transaction_handle *, sizeof(*th));
PRESTO_ALLOC(th, sizeof(*th));
if (!th) {
printk("presto: No memory for trans handle\n");
CERROR("presto: No memory for trans handle\n");
return NULL;
}
......@@ -81,36 +98,44 @@ static void *presto_reiserfs_trans_start(struct presto_file_set *fset,
CDEBUG(D_JOURNAL, "creating journal handle (%d blocks)\n", jblocks);
lock_kernel();
//journal_begin(th, inode->i_sb, jblocks);
journal_begin(th, inode->i_sb, jblocks);
unlock_kernel();
return th;
}
void presto_reiserfs_trans_commit(struct presto_file_set *fset, void *handle)
static void presto_reiserfs_trans_commit(struct presto_file_set *fset,
void *handle)
{
int jblocks;
jblocks = 3 + JOURNAL_PER_BALANCE_CNT * 4;
lock_kernel();
//journal_end(handle, fset->fset_cache->cache_sb, jblocks);
journal_end(handle, fset->fset_cache->cache_sb, jblocks);
unlock_kernel();
PRESTO_FREE(handle, sizeof(struct reiserfs_transaction_handle));
}
void presto_reiserfs_journal_file_data(struct inode *inode)
static void presto_reiserfs_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
}
static int presto_reiserfs_has_all_data(struct inode *inode)
{
BUG();
return 0;
}
struct journal_ops presto_reiserfs_journal_ops = {
tr_avail: presto_reiserfs_freespace,
tr_start: presto_reiserfs_trans_start,
tr_commit: presto_reiserfs_trans_commit,
tr_journal_data: presto_reiserfs_journal_file_data
.tr_all_data = presto_reiserfs_has_all_data,
.tr_avail = presto_reiserfs_freespace,
.tr_start = presto_reiserfs_trans_start,
.tr_commit = presto_reiserfs_trans_commit,
.tr_journal_data = presto_reiserfs_journal_file_data
};
#endif
......
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.
......@@ -14,7 +14,6 @@
#include <linux/tty.h>
#include <asm/bitops.h>
extern struct tty_driver *tty_drivers; /* linked list of tty drivers */
extern struct tty_ldisc ldiscs[];
......@@ -40,7 +39,7 @@ static int tty_drivers_read_proc(char *page, char **start, off_t off,
char range[20], deftype[20];
char *type;
for (p = tty_drivers; p; p = p->next) {
list_for_each_entry(p, &tty_drivers, tty_drivers) {
if (p->num > 1)
sprintf(range, "%d-%d", p->minor_start,
p->minor_start + p->num - 1);
......
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