- Dave Jones: more merging, fix up last merge..
- release to sync with Dave
VERSION = 2
PATCHLEVEL = 5
SUBLEVEL = 2
-EXTRAVERSION =-pre4
+EXTRAVERSION =-pre5
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o
+ifdef CONFIG_VISWS
+obj-y += setup-visws.o
obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
+endif
include $(TOPDIR)/Rules.make
--- /dev/null
+/*
+ * Unmaintained SGI Visual Workstation support.
+ * Split out from setup.c by davej@suse.de
+ */
+
+char visws_board_type = -1;
+char visws_board_rev = -1;
+
+#define PIIX_PM_START 0x0F80
+
+#define SIO_GPIO_START 0x0FC0
+
+#define SIO_PM_START 0x0FC8
+
+#define PMBASE PIIX_PM_START
+#define GPIREG0 (PMBASE+0x30)
+#define GPIREG(x) (GPIREG0+((x)/8))
+#define PIIX_GPI_BD_ID1 18
+#define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
+
+#define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
+
+#define SIO_INDEX 0x2e
+#define SIO_DATA 0x2f
+
+#define SIO_DEV_SEL 0x7
+#define SIO_DEV_ENB 0x30
+#define SIO_DEV_MSB 0x60
+#define SIO_DEV_LSB 0x61
+
+#define SIO_GP_DEV 0x7
+
+#define SIO_GP_BASE SIO_GPIO_START
+#define SIO_GP_MSB (SIO_GP_BASE>>8)
+#define SIO_GP_LSB (SIO_GP_BASE&0xff)
+
+#define SIO_GP_DATA1 (SIO_GP_BASE+0)
+
+#define SIO_PM_DEV 0x8
+
+#define SIO_PM_BASE SIO_PM_START
+#define SIO_PM_MSB (SIO_PM_BASE>>8)
+#define SIO_PM_LSB (SIO_PM_BASE&0xff)
+#define SIO_PM_INDEX (SIO_PM_BASE+0)
+#define SIO_PM_DATA (SIO_PM_BASE+1)
+
+#define SIO_PM_FER2 0x1
+
+#define SIO_PM_GP_EN 0x80
+
+void __init visws_get_board_type_and_rev(void)
+{
+ int raw;
+
+ visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
+ >> PIIX_GPI_BD_SHIFT;
+/*
+ * Get Board rev.
+ * First, we have to initialize the 307 part to allow us access
+ * to the GPIO registers. Let's map them at 0x0fc0 which is right
+ * after the PIIX4 PM section.
+ */
+ outb_p(SIO_DEV_SEL, SIO_INDEX);
+ outb_p(SIO_GP_DEV, SIO_DATA); /* Talk to GPIO regs. */
+
+ outb_p(SIO_DEV_MSB, SIO_INDEX);
+ outb_p(SIO_GP_MSB, SIO_DATA); /* MSB of GPIO base address */
+
+ outb_p(SIO_DEV_LSB, SIO_INDEX);
+ outb_p(SIO_GP_LSB, SIO_DATA); /* LSB of GPIO base address */
+
+ outb_p(SIO_DEV_ENB, SIO_INDEX);
+ outb_p(1, SIO_DATA); /* Enable GPIO registers. */
+
+/*
+ * Now, we have to map the power management section to write
+ * a bit which enables access to the GPIO registers.
+ * What lunatic came up with this shit?
+ */
+ outb_p(SIO_DEV_SEL, SIO_INDEX);
+ outb_p(SIO_PM_DEV, SIO_DATA); /* Talk to GPIO regs. */
+
+ outb_p(SIO_DEV_MSB, SIO_INDEX);
+ outb_p(SIO_PM_MSB, SIO_DATA); /* MSB of PM base address */
+
+ outb_p(SIO_DEV_LSB, SIO_INDEX);
+ outb_p(SIO_PM_LSB, SIO_DATA); /* LSB of PM base address */
+
+ outb_p(SIO_DEV_ENB, SIO_INDEX);
+ outb_p(1, SIO_DATA); /* Enable PM registers. */
+
+/*
+ * Now, write the PM register which enables the GPIO registers.
+ */
+ outb_p(SIO_PM_FER2, SIO_PM_INDEX);
+ outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
+
+/*
+ * Now, initialize the GPIO registers.
+ * We want them all to be inputs which is the
+ * power on default, so let's leave them alone.
+ * So, let's just read the board rev!
+ */
+ raw = inb_p(SIO_GP_DATA1);
+ raw &= 0x7f; /* 7 bits of valid board revision ID. */
+
+ if (visws_board_type == VISWS_320) {
+ if (raw < 0x6) {
+ visws_board_rev = 4;
+ } else if (raw < 0xc) {
+ visws_board_rev = 5;
+ } else {
+ visws_board_rev = 6;
+ }
+ } else if (visws_board_type == VISWS_540) {
+ visws_board_rev = 2;
+ } else {
+ visws_board_rev = raw;
+ }
+
+ printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
+ visws_board_type == VISWS_320 ? "320" :
+ (visws_board_type == VISWS_540 ? "540" :
+ "unknown"), visws_board_rev);
+ }
+}
extern int root_mountflags;
extern char _text, _etext, _edata, _end;
extern int blk_nohighio;
+void __init visws_get_board_type_and_rev(void);
static int disable_x86_serial_nr __initdata = 1;
static int disable_x86_fxsr __initdata = 0;
#define RAMDISK_PROMPT_FLAG 0x8000
#define RAMDISK_LOAD_FLAG 0x4000
-#ifdef CONFIG_VISWS
-char visws_board_type = -1;
-char visws_board_rev = -1;
-
-#define PIIX_PM_START 0x0F80
-
-#define SIO_GPIO_START 0x0FC0
-
-#define SIO_PM_START 0x0FC8
-
-#define PMBASE PIIX_PM_START
-#define GPIREG0 (PMBASE+0x30)
-#define GPIREG(x) (GPIREG0+((x)/8))
-#define PIIX_GPI_BD_ID1 18
-#define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
-
-#define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
-
-#define SIO_INDEX 0x2e
-#define SIO_DATA 0x2f
-
-#define SIO_DEV_SEL 0x7
-#define SIO_DEV_ENB 0x30
-#define SIO_DEV_MSB 0x60
-#define SIO_DEV_LSB 0x61
-
-#define SIO_GP_DEV 0x7
-
-#define SIO_GP_BASE SIO_GPIO_START
-#define SIO_GP_MSB (SIO_GP_BASE>>8)
-#define SIO_GP_LSB (SIO_GP_BASE&0xff)
-
-#define SIO_GP_DATA1 (SIO_GP_BASE+0)
-
-#define SIO_PM_DEV 0x8
-
-#define SIO_PM_BASE SIO_PM_START
-#define SIO_PM_MSB (SIO_PM_BASE>>8)
-#define SIO_PM_LSB (SIO_PM_BASE&0xff)
-#define SIO_PM_INDEX (SIO_PM_BASE+0)
-#define SIO_PM_DATA (SIO_PM_BASE+1)
-
-#define SIO_PM_FER2 0x1
-
-#define SIO_PM_GP_EN 0x80
-
-static void __init visws_get_board_type_and_rev(void)
-{
- int raw;
-
- visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
- >> PIIX_GPI_BD_SHIFT;
-/*
- * Get Board rev.
- * First, we have to initialize the 307 part to allow us access
- * to the GPIO registers. Let's map them at 0x0fc0 which is right
- * after the PIIX4 PM section.
- */
- outb_p(SIO_DEV_SEL, SIO_INDEX);
- outb_p(SIO_GP_DEV, SIO_DATA); /* Talk to GPIO regs. */
-
- outb_p(SIO_DEV_MSB, SIO_INDEX);
- outb_p(SIO_GP_MSB, SIO_DATA); /* MSB of GPIO base address */
-
- outb_p(SIO_DEV_LSB, SIO_INDEX);
- outb_p(SIO_GP_LSB, SIO_DATA); /* LSB of GPIO base address */
-
- outb_p(SIO_DEV_ENB, SIO_INDEX);
- outb_p(1, SIO_DATA); /* Enable GPIO registers. */
-
-/*
- * Now, we have to map the power management section to write
- * a bit which enables access to the GPIO registers.
- * What lunatic came up with this shit?
- */
- outb_p(SIO_DEV_SEL, SIO_INDEX);
- outb_p(SIO_PM_DEV, SIO_DATA); /* Talk to GPIO regs. */
-
- outb_p(SIO_DEV_MSB, SIO_INDEX);
- outb_p(SIO_PM_MSB, SIO_DATA); /* MSB of PM base address */
-
- outb_p(SIO_DEV_LSB, SIO_INDEX);
- outb_p(SIO_PM_LSB, SIO_DATA); /* LSB of PM base address */
-
- outb_p(SIO_DEV_ENB, SIO_INDEX);
- outb_p(1, SIO_DATA); /* Enable PM registers. */
-
-/*
- * Now, write the PM register which enables the GPIO registers.
- */
- outb_p(SIO_PM_FER2, SIO_PM_INDEX);
- outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
-
-/*
- * Now, initialize the GPIO registers.
- * We want them all to be inputs which is the
- * power on default, so let's leave them alone.
- * So, let's just read the board rev!
- */
- raw = inb_p(SIO_GP_DATA1);
- raw &= 0x7f; /* 7 bits of valid board revision ID. */
-
- if (visws_board_type == VISWS_320) {
- if (raw < 0x6) {
- visws_board_rev = 4;
- } else if (raw < 0xc) {
- visws_board_rev = 5;
- } else {
- visws_board_rev = 6;
-
- }
- } else if (visws_board_type == VISWS_540) {
- visws_board_rev = 2;
- } else {
- visws_board_rev = raw;
- }
-
- printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
- visws_board_type == VISWS_320 ? "320" :
- (visws_board_type == VISWS_540 ? "540" :
- "unknown"),
- visws_board_rev);
- }
-#endif
-
static char command_line[COMMAND_LINE_SIZE];
char saved_command_line[COMMAND_LINE_SIZE];
}
break;
- case 6: /* An Athlon/Duron. We can trust the BIOS probably */
- break;
+ case 6: /* An Athlon/Duron */
+
+ /* Bit 15 of Athlon specific MSR 15, needs to be 0
+ * to enable SSE on Palomino/Morgan CPU's.
+ * If the BIOS didn't enable it already, enable it
+ * here.
+ */
+ if (c->x86_model == 6 || c->x86_model == 7) {
+ if (!test_bit(X86_FEATURE_XMM, &c->x86_capability)) {
+ printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
+ rdmsr(MSR_K7_HWCR, l, h);
+ l &= ~0x00008000;
+ wrmsr(MSR_K7_HWCR, l, h);
+ set_bit(X86_FEATURE_XMM, &c->x86_capability);
+ }
+ }
+ break;
+
}
display_cacheinfo(c);
if ( p )
strcpy(c->x86_model_id, p);
+
+#ifdef CONFIG_SMP
+ if (test_bit(X86_FEATURE_HT, &c->x86_capability)) {
+ extern int phys_proc_id[NR_CPUS];
+
+ u32 eax, ebx, ecx, edx;
+ int index_lsb, index_msb, tmp;
+ int initial_apic_id;
+ int cpu = smp_processor_id();
+
+ cpuid(1, &eax, &ebx, &ecx, &edx);
+ smp_num_siblings = (ebx & 0xff0000) >> 16;
+
+ if (smp_num_siblings == 1) {
+ printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
+ } else if (smp_num_siblings > 1 ) {
+ index_lsb = 0;
+ index_msb = 31;
+ /*
+ * At this point we only support two siblings per
+ * processor package.
+ */
+#define NR_SIBLINGS 2
+ if (smp_num_siblings != NR_SIBLINGS) {
+ printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings);
+ smp_num_siblings = 1;
+ goto too_many_siblings;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 1) == 0) {
+ tmp >>=1 ;
+ index_lsb++;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 0x80000000 ) == 0) {
+ tmp <<=1 ;
+ index_msb--;
+ }
+ if (index_lsb != index_msb )
+ index_msb++;
+ initial_apic_id = ebx >> 24 & 0xff;
+ phys_proc_id[cpu] = initial_apic_id >> index_msb;
+
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ phys_proc_id[cpu]);
+ }
+
+ }
+too_many_siblings:
+#endif
}
void __init get_cpu_vendor(struct cpuinfo_x86 *c)
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
"cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
"pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
- "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
+ "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
/* AMD-defined */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* Total count of live CPUs */
int smp_num_cpus = 1;
+/* Number of siblings per CPU package */
+int smp_num_siblings = 1;
+int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
+
/* Bitmask of currently online CPUs */
unsigned long cpu_online_map;
/* Where the IO area was mapped on multiquad, always 0 otherwise */
void *xquad_portio = NULL;
+int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+
void __init smp_boot_cpus(void)
{
int apicid, cpu, bit;
printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n");
Dprintk("Boot done.\n");
+ /*
+ * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
+ * that we can tell the sibling CPU efficiently.
+ */
+ if (test_bit(X86_FEATURE_HT, boot_cpu_data.x86_capability)
+ && smp_num_siblings > 1) {
+ for (cpu = 0; cpu < NR_CPUS; cpu++)
+ cpu_sibling_map[cpu] = NO_PROC_ID;
+
+ for (cpu = 0; cpu < smp_num_cpus; cpu++) {
+ int i;
+
+ for (i = 0; i < smp_num_cpus; i++) {
+ if (i == cpu)
+ continue;
+ if (phys_proc_id[cpu] == phys_proc_id[i]) {
+ cpu_sibling_map[cpu] = i;
+ printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
+ break;
+ }
+ }
+ if (cpu_sibling_map[cpu] == NO_PROC_ID) {
+ smp_num_siblings = 1;
+ printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
+ }
+ }
+ }
+
#ifndef CONFIG_VISWS
/*
* Here we can be sure that there is an IO-APIC in the system. Let's
#include <linux/proc_fs.h>
#include <linux/sysctl.h>
#include <linux/pm.h>
+#include <linux/sched.h>
#include <acpi.h>
#include <bm.h>
break;
}
if(ending != -1) {
- spin_lock_irqsave(ps2esdi_LOCK, flags);
+ spin_lock_irqsave(&ps2esdi_lock, flags);
end_request(ending);
do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
- spin_unlock_irqrestore(ps2esdi_LOCK, flags);
+ spin_unlock_irqrestore(&ps2esdi_lock, flags);
}
} /* handle interrupts */
- Split ftape-io.c into ftape-io.c and ftape-ctl.c files.
- Corrected too high media error count after writing to
a bad tape.
+- Added #include <asm/segment.h> again because old kernel versions
need it.
- Fixed fdc not being disabled when open failed because no tape
drive was found.
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#endif
#include "../zftape/zftape-init.h"
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#endif
#include <asm/io.h>
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#endif
#include "../zftape/zftape-init.h"
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#endif
#include "../zftape/zftape-init.h"
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,6)
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#endif
#include "../zftape/zftape-init.h"
if (cap.mechtype == mechtype_caddy || cap.mechtype == mechtype_popup)
CDROM_CONFIG_FLAGS (drive)->close_tray = 0;
+ /* Some drives used by Apple don't advertise audio play
+ * but they do support reading TOC & audio datas
+ */
+ if (strcmp (drive->id->model, "MATSHITADVD-ROM SR-8187") == 0 ||
+ strcmp (drive->id->model, "MATSHITADVD-ROM SR-8186") == 0)
+ CDROM_CONFIG_FLAGS (drive)->audio_play = 1;
+
#if ! STANDARD_ATAPI
if (cdi->sanyo_slot > 0) {
CDROM_CONFIG_FLAGS (drive)->is_changer = 1;
}
/* We must remove proc entries defined in this module.
Otherwise we oops while accessing these entries */
+#ifdef CONFIG_PROC_FS
if (drive->proc)
ide_remove_proc_entries(drive->proc, idedisk_proc);
+#endif
}
ide_unregister_module(&idedisk_module);
}
printk ("%s: cleanup_module() called while still busy\n", drive->name);
failed++;
}
+
+#ifdef CONFIG_PROC_FS
/* We must remove proc entries defined in this module.
Otherwise we oops while accessing these entries */
if (drive->proc)
ide_remove_proc_entries(drive->proc, idefloppy_proc);
+#endif
}
ide_unregister_module(&idefloppy_module);
}
#if LINUX_VERSION_CODE >= 0x20100
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#include <linux/mm.h>
#undef put_user
#if LINUX_VERSION_CODE >= 0x20100
#include <asm/uaccess.h>
#else
+#include <asm/segment.h>
#include <linux/mm.h>
#undef put_user
#include <linux/inetdevice.h>
#include <linux/netdevice.h>
#else
+ #include <asm/segment.h>
#include <net/route.h> /* Adding new route entries : 2.0.X kernels */
#endif
#include <linux/netdevice.h>
#else
+ #include <asm/segment.h>
#endif
#include <net/route.h> /* Dynamic Route Creation */
#include <linux/inetdevice.h>
#include <linux/netdevice.h>
#else
+ #include <asm/segment.h>
#include <net/route.h> /* Adding new route entries : 2.0.X kernels */
#endif
#if defined(LINUX_2_1) || defined(LINUX_2_4)
#include <asm/uaccess.h>
#else
+ #include <asm/segment.h>
#include <net/route.h>
#endif
#else
+ #include <asm/segment.h>
#define devinet_ioctl(x,y) dev_ioctl(x,y)
#define netdevice_t struct device
#define test_and_set_bit set_bit
* Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
* Author(s): Ingo Adlung (adlung@de.ibm.com)
+ * Cornelia Huck (cohuck@de.ibm.com)
* ChangeLog: 01/07/2001 Blacklist cleanup (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
* 01/04/2001 Holger Smolinski (smolinsk@de.ibm.com)
* Fixed lost interrupts and do_adapter_IO
static void s390_process_subchannels( void);
static void s390_device_recognition_all( void);
static void s390_device_recognition_irq( int irq);
+#ifdef CONFIG_PROC_FS
static void s390_redo_validation(void);
+#endif
static int s390_validate_subchannel( int irq, int enable);
static int s390_SenseID( int irq, senseid_t *sid, __u8 lpm);
static int s390_SetPGID( int irq, __u8 lpm, pgid_t *pgid);
static int enable_subchannel( unsigned int irq);
static int disable_subchannel( unsigned int irq);
+#ifdef CONFIG_PROC_FS
static int chan_proc_init( void );
+#endif
static inline void do_adapter_IO( __u32 intparm );
__setup("cio_notoper_msg=", cio_notoper_setup);
+#ifdef CONFIG_PROC_FS
static int __init cio_proc_devinfo_setup(char *parm)
{
if (!strcmp(parm, "yes")) {
} else if (!strcmp(parm, "no")) {
cio_proc_devinfo = 0;
} else {
- printk("cio_proc_devinfo_setup: invalid parameter '%s'\n",parm);
+ printk( KERN_ERR "cio_proc_devinfo_setup: invalid parameter '%s'\n",parm);
}
return 1;
}
__setup("cio_proc_devinfo=", cio_proc_devinfo_setup);
+#endif
/*
* register for adapter interrupts
}
}
+#ifdef CONFIG_PROC_FS
if (cio_proc_devinfo)
if (irq < MAX_CIO_PROCFS_ENTRIES) {
cio_procfs_device_create(ioinfo[irq]->devno);
}
+#endif
}
}
irq++;
if ( ioinfo[irq]->ui.flags.oper == 0 )
{
not_oper_handler_func_t nopfunc=ioinfo[irq]->nopfunc;
-
+#ifdef CONFIG_PROC_FS
/* remove procfs entry */
if (cio_proc_devinfo)
cio_procfs_device_remove(dev_no);
+#endif
/*
* If the device has gone
* call not oper handler
pdevreg->oper_func( irq, pdevreg );
} /* endif */
-
+#ifdef CONFIG_PROC_FS
/* add new procfs entry */
if (cio_proc_devinfo)
if (highest_subchannel < MAX_CIO_PROCFS_ENTRIES) {
cio_procfs_device_create(ioinfo[irq]->devno);
}
+#endif
}
/*
* ... it is and was operational, but
*/
else if ((ioinfo[irq]->devno != dev_no) && ( ioinfo[irq]->nopfunc != NULL ))
{
+#ifdef CONFIG_PROC_FS
int devno_old = ioinfo[irq]->devno;
+#endif
ioinfo[irq]->nopfunc( irq,
DEVSTAT_REVALIDATE );
-
+#ifdef CONFIG_PROC_FS
/* remove old entry, add new */
if (cio_proc_devinfo) {
cio_procfs_device_remove(devno_old);
cio_procfs_device_create(ioinfo[irq]->devno);
}
+#endif
} /* endif */
} /* endif */
-
+#ifdef CONFIG_PROC_FS
/* get rid of dead procfs entries */
if (cio_proc_devinfo)
cio_procfs_device_purge();
-
+#endif
} /* endif */
break;
__initcall(cio_debug_init);
+#ifdef CONFIG_PROC_FS
/*
* Display info on subchannels in /proc/subchannels.
* Adapted from procfs stuff in dasd.c by Cornelia Huck, 02/28/01.
entry->cio_chpid_entry = create_proc_entry( "chpids", S_IFREG|S_IRUGO, entry->cio_device_entry);
entry->cio_chpid_entry->proc_fops = &cio_chpid_entry_file_ops;
} else {
- printk("Error, could not allocate procfs structure!\n");
+ printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
remove_proc_entry(buf, cio_procfs_deviceinfo_root);
kfree(entry);
rc = -ENOMEM;
}
} else {
- printk("Error, could not allocate procfs structure!\n");
+ printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
kfree(entry);
rc = -ENOMEM;
}
} else {
- printk("Error, could not allocate procfs structure!\n");
+ printk( KERN_WARNING "Error, could not allocate procfs structure!\n");
rc = -ENOMEM;
}
return rc;
}
buffer[user_len]='\0';
#ifdef CIO_DEBUG_IO
- printk ("/proc/cio_ignore: '%s'\n", buffer);
+ printk ( KERN_DEBUG "/proc/cio_ignore: '%s'\n", buffer);
#endif /* CIO_DEBUG_IO */
if (cio_debug_initialized)
debug_sprintf_event(cio_debug_msg_id, 2, "/proc/cio_ignore: '%s'\n",buffer);
__initcall(cio_irq_proc_init);
/* end of procfs stuff */
+#endif
schib_t *s390_get_schib( int irq )
{
/* Register the IRQ with the kernel */
retcode = request_irq( interrupt_level,
- do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", NULL);
+ do_fdomain_16x0_intr, pdev?SA_SHIRQ:0, "fdomain", shpnt);
if (retcode < 0) {
if (retcode == -EINVAL) {
return 0;
}
+int fdomain_16x0_release(struct Scsi_Host *shpnt)
+{
+ if (shpnt->irq)
+ free_irq(shpnt->irq, shpnt);
+ if (shpnt->io_port && shpnt->n_io_port)
+ release_region(shpnt->io_port, shpnt->n_io_port);
+
+}
+
MODULE_LICENSE("GPL");
/* Eventually this will go into an include file, but this will be later */
int fdomain_16x0_biosparam( Disk *, kdev_t, int * );
int fdomain_16x0_proc_info( char *buffer, char **start, off_t offset,
int length, int hostno, int inout );
+int fdomain_16x0_release( struct Scsi_Host *shpnt );
#define FDOMAIN_16X0 { proc_info: fdomain_16x0_proc_info, \
detect: fdomain_16x0_detect, \
abort: fdomain_16x0_abort, \
reset: fdomain_16x0_reset, \
bios_param: fdomain_16x0_biosparam, \
+ release: fdomain_16x0_release, \
can_queue: 1, \
this_id: 6, \
sg_tablesize: 64, \
if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
if (done_list) {
- NCR_LOCK_SCSI_DONE(np, flags);
+ NCR_LOCK_SCSI_DONE(done_list->host, flags);
ncr_flush_done_cmds(done_list);
- NCR_UNLOCK_SCSI_DONE(np, flags);
+ NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
}
}
NCR_UNLOCK_NCB(np, flags);
if (done_list) {
- NCR_LOCK_SCSI_DONE(np, flags);
+ NCR_LOCK_SCSI_DONE(done_list->host, flags);
ncr_flush_done_cmds(done_list);
- NCR_UNLOCK_SCSI_DONE(np, flags);
+ NCR_UNLOCK_SCSI_DONE(done_list->host, flags);
}
}
{"EMC", "SYMMETRIX", "*", BLIST_SPARSELUN},
{"CMD", "CRA-7280", "*", BLIST_SPARSELUN}, // CMD RAID Controller
{"CNSI", "G7324", "*", BLIST_SPARSELUN}, // Chaparral G7324 RAID
+ {"CNSi", "G8324", "*", BLIST_SPARSELUN}, // Chaparral G8324 RAID
{"Zzyzx", "RocketStor 500S", "*", BLIST_SPARSELUN},
{"Zzyzx", "RocketStor 2000", "*", BLIST_SPARSELUN},
{"SONY", "TSL", "*", BLIST_FORCELUN}, // DDS3 & DDS4 autoloaders
{"DELL", "PERCRAID", "*", BLIST_FORCELUN},
{"HP", "NetRAID-4M", "*", BLIST_FORCELUN},
+ {"ADAPTEC", "AACRAID", "*", BLIST_FORCELUN},
+ {"ADAPTEC", "Adaptec 5400S", "*", BLIST_FORCELUN},
/*
* Must be at end of list...
#define NCR_LOCK_NCB(np, flags) spin_lock_irqsave(&np->smp_lock, flags)
#define NCR_UNLOCK_NCB(np, flags) spin_unlock_irqrestore(&np->smp_lock, flags)
-#define NCR_LOCK_SCSI_DONE(np, flags) \
- spin_lock_irqsave(&io_request_lock, flags)
-#define NCR_UNLOCK_SCSI_DONE(np, flags) \
- spin_unlock_irqrestore(&io_request_lock, flags)
+#define NCR_LOCK_SCSI_DONE(host, flags) \
+ spin_lock_irqsave(&(host)->host_lock, flags)
+#define NCR_UNLOCK_SCSI_DONE(host, flags) \
+ spin_unlock_irqrestore(&((host)->host_lock), flags)
#else
#define NCR_LOCK_NCB(np, flags) do { save_flags(flags); cli(); } while (0)
#define NCR_UNLOCK_NCB(np, flags) do { restore_flags(flags); } while (0)
-#define NCR_LOCK_SCSI_DONE(np, flags) do {;} while (0)
-#define NCR_UNLOCK_SCSI_DONE(np, flags) do {;} while (0)
+#define NCR_LOCK_SCSI_DONE(host, flags) do {;} while (0)
+#define NCR_UNLOCK_SCSI_DONE(host, flags) do {;} while (0)
#endif
static int loaded;
-static int ad_format_mask[10 /*devc->model */ ] =
+static int ad_format_mask[13 /*devc->model */ ] =
{
0,
AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW,
AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
AFMT_U8 | AFMT_S16_LE /* CS4235 */,
- AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW /* Ensoniq Soundscape*/
+ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW /* Ensoniq Soundscape*/,
+ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
+ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM,
+ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM
};
static ad1848_info adev_info[MAX_AUDIO_DEV];
ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021),
1, 0, 0, 1, 1},
+ {"Advanced Gravis InterWave Audio",
+ ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
+ ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000),
+ 0, 0, 0, 1, 0},
{0}
};
ISAPNP_VENDOR('C','S','C'), ISAPNP_FUNCTION(0x0100), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021), 0 },
+ { ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
+ ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000), 0 },
{0}
};
# include <linux/major.h>
# include <linux/fs.h>
# include <linux/sound.h>
+# include <asm/segment.h>
# include "sound_config.h"
#else
# include <linux/init.h>
#include <asm/page.h>
#include <asm/system.h>
#ifdef __alpha__
+#include <asm/segment.h>
#endif
#include <linux/vmalloc.h>
#include <asm/uaccess.h>
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
0,0,0,0,
0,1,1,-1},
+ {"Sound Blaster AWE 32",
+ ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0047),
+ ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
+ 0,0,0,0,
+ 0,1,1,-1},
{"Sound Blaster AWE 32",
ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0048),
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
struct nc_trailer *trailer = 0;
#endif /* CONFIG_USB_NET1080 */
- flags = in_interrupt () ? GFP_ATOMIC : GFP_KERNEL;
+ flags = in_interrupt () ? GFP_ATOMIC : GFP_NOIO; /* might be used for nfs */
// some devices want funky USB-level framing, for
// win32 driver (usually) and/or hardware quirks
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/slab.h>
+#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/tty.h>
#include <linux/console.h>
20010730 Richard Gooch <rgooch@atnf.csiro.au>
Added DEVFSD_NOTIFY_DELETE event.
20010801 Richard Gooch <rgooch@atnf.csiro.au>
+ Removed #include <asm/segment.h>.
v0.109
20010807 Richard Gooch <rgooch@atnf.csiro.au>
Fixed inode table races by removing it and using
#include <asm/uaccess.h>
+static void ext2_sync_super(struct super_block *sb,
+ struct ext2_super_block *es);
static char error_buf[1024];
const char * fmt, ...)
{
va_list args;
+ struct ext2_super_block *es = EXT2_SB(sb)->s_es;
if (!(sb->s_flags & MS_RDONLY)) {
sb->u.ext2_sb.s_mount_state |= EXT2_ERROR_FS;
- sb->u.ext2_sb.s_es->s_state =
- cpu_to_le16(le16_to_cpu(sb->u.ext2_sb.s_es->s_state) | EXT2_ERROR_FS);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
- sb->s_dirt = 1;
+ es->s_state =
+ cpu_to_le16(le16_to_cpu(es->s_state) | EXT2_ERROR_FS);
+ ext2_sync_super(sb, es);
}
va_start (args, fmt);
vsprintf (error_buf, fmt, args);
int i;
if (!(sb->s_flags & MS_RDONLY)) {
- sb->u.ext2_sb.s_es->s_state = le16_to_cpu(sb->u.ext2_sb.s_mount_state);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
+ struct ext2_super_block *es = EXT2_SB(sb)->s_es;
+
+ es->s_state = le16_to_cpu(EXT2_SB(sb)->s_mount_state);
+ ext2_sync_super(sb, es);
}
db_count = EXT2_SB(sb)->s_gdb_count;
for (i = 0; i < db_count; i++)
(le32_to_cpu(es->s_lastcheck) + le32_to_cpu(es->s_checkinterval) <= CURRENT_TIME))
printk ("EXT2-fs warning: checktime reached, "
"running e2fsck is recommended\n");
- es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) & ~EXT2_VALID_FS);
if (!(__s16) le16_to_cpu(es->s_max_mnt_count))
es->s_max_mnt_count = (__s16) cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
es->s_mnt_count=cpu_to_le16(le16_to_cpu(es->s_mnt_count) + 1);
- es->s_mtime = cpu_to_le32(CURRENT_TIME);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
- sb->s_dirt = 1;
+ ext2_write_super(sb);
if (test_opt (sb, DEBUG))
printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, "
"bpg=%lu, ipg=%lu, mo=%04lx]\n",
sb->s_dirt = 0;
}
+static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es)
+{
+ es->s_wtime = cpu_to_le32(CURRENT_TIME);
+ mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
+ ll_rw_block(WRITE, 1, &EXT2_SB(sb)->s_sbh);
+ wait_on_buffer(EXT2_SB(sb)->s_sbh);
+ sb->s_dirt = 0;
+}
+
/*
* In the second extended file system, it is not necessary to
* write the super block since we use a mapping of the
if (!(sb->s_flags & MS_RDONLY)) {
es = sb->u.ext2_sb.s_es;
- ext2_debug ("setting valid to 0\n");
-
if (le16_to_cpu(es->s_state) & EXT2_VALID_FS) {
- es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) & ~EXT2_VALID_FS);
+ ext2_debug ("setting valid to 0\n");
+ es->s_state = cpu_to_le16(le16_to_cpu(es->s_state) &
+ ~EXT2_VALID_FS);
es->s_mtime = cpu_to_le32(CURRENT_TIME);
- }
- ext2_commit_super (sb, es);
+ ext2_sync_super(sb, es);
+ } else
+ ext2_commit_super (sb, es);
}
sb->s_dirt = 0;
}
*/
es->s_state = cpu_to_le16(sb->u.ext2_sb.s_mount_state);
es->s_mtime = cpu_to_le32(CURRENT_TIME);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
- sb->s_dirt = 1;
- ext2_commit_super (sb, es);
- }
- else {
+ } else {
int ret;
if ((ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
~EXT2_FEATURE_RO_COMPAT_SUPP))) {
if (!ext2_setup_super (sb, es, 0))
sb->s_flags &= ~MS_RDONLY;
}
+ ext2_sync_super(sb, es);
return 0;
}
O_TARGET := ext3.o
-obj-y := acl.o balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
+obj-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
ioctl.o namei.o super.o symlink.o
obj-m := $(O_TARGET)
+++ /dev/null
-/*
- * linux/fs/ext3/acl.c
- *
- * Copyright (C) 1993, 1994, 1995
- * Remy Card (card@masi.ibp.fr)
- * Laboratoire MASI - Institut Blaise Pascal
- * Universite Pierre et Marie Curie (Paris VI)
- */
-
-#include <linux/fs.h>
-#include <linux/sched.h>
-
-
-/*
- * This file will contain the Access Control Lists management for the
- * second extended file system.
- */
#include <linux/quotaops.h>
#include <linux/module.h>
-
/*
* SEARCH_FROM_ZERO forces each block allocation to search from the start
* of the filesystem. This is to force rapid reallocation of recently-freed
* reachable from inode.
*
* akpm: `handle' can be NULL if create == 0.
+ *
+ * The BKL may not be held on entry here. Be sure to take it early.
*/
static int ext3_get_block_handle(handle_t *handle, struct inode *inode,
ret = PTR_ERR(handle);
goto out;
}
+ unlock_kernel();
ret = block_prepare_write(page, from, to, ext3_get_block);
+ lock_kernel();
if (ret != 0)
goto prepare_write_failed;
- if (ext3_should_journal_data(inode))
+ if (ext3_should_journal_data(inode)) {
ret = walk_page_buffers(handle, page->buffers,
from, to, NULL, do_journal_get_write_access);
+ if (ret) {
+ /*
+ * We're going to fail this prepare_write(),
+ * so commit_write() will not be called.
+ * We need to undo block_prepare_write()'s kmap().
+ * AKPM: Do we need to clear PageUptodate? I don't
+ * think so.
+ */
+ kunmap(page);
+ }
+ }
prepare_write_failed:
if (ret)
ext3_journal_stop(handle, inode);
kunmap(page);
if (pos > inode->i_size)
inode->i_size = pos;
- set_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state);
+ EXT3_I(inode)->i_state |= EXT3_STATE_JDATA;
} else {
if (ext3_should_order_data(inode)) {
ret = walk_page_buffers(handle, page->buffers,
}
/* Be careful here if generic_commit_write becomes a
* required invocation after block_prepare_write. */
- if (ret == 0)
+ if (ret == 0) {
ret = generic_commit_write(file, page, from, to);
+ } else {
+ /*
+ * block_prepare_write() was called, but we're not
+ * going to call generic_commit_write(). So we
+ * need to perform generic_commit_write()'s kunmap
+ * by hand.
+ */
+ kunmap(page);
+ }
}
if (inode->i_size > inode->u.ext3_i.i_disksize) {
inode->u.ext3_i.i_disksize = inode->i_size;
journal_t *journal;
int err;
- if (test_and_clear_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state)) {
+ if (EXT3_I(inode)->i_state & EXT3_STATE_JDATA) {
/*
* This is a REALLY heavyweight approach, but the use of
* bmap on dirty files is expected to be extremely rare:
* everything they get.
*/
+ EXT3_I(inode)->i_state &= ~EXT3_STATE_JDATA;
journal = EXT3_JOURNAL(inode);
journal_lock_updates(journal);
err = journal_flush(journal);
/* If we are not tracking these fields in the in-memory inode,
* then preserve them on disk, but still initialise them to zero
* for new inodes. */
- if (inode->u.ext3_i.i_state & EXT3_STATE_NEW) {
+ if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) {
raw_inode->i_faddr = 0;
raw_inode->i_frag = 0;
raw_inode->i_fsize = 0;
rc = ext3_journal_dirty_metadata(handle, bh);
if (!err)
err = rc;
- inode->u.ext3_i.i_state &= ~EXT3_STATE_NEW;
+ EXT3_I(inode)->i_state &= ~EXT3_STATE_NEW;
out_brelse:
brelse (bh);
int ext3_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
- int error, rc;
+ int error, rc = 0;
+ const unsigned int ia_valid = attr->ia_valid;
error = inode_change_ok(inode, attr);
if (error)
return error;
-
+
+ if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
+ (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) {
+ error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
+ if (error)
+ return error;
+ }
+
if (attr->ia_valid & ATTR_SIZE && attr->ia_size < inode->i_size) {
handle_t *handle;
ext3_journal_stop(handle, inode);
}
- inode_setattr(inode, attr);
+ rc = inode_setattr(inode, attr);
/* If inode_setattr's call to ext3_truncate failed to get a
* transaction handle at all, we need to clean up the in-core
err_out:
ext3_std_error(inode->i_sb, error);
- return 0;
+ if (!error)
+ error = rc;
+ return error;
}
* here, in ext3_aops_journal_start() to ensure that the forthcoming "see if we
* need to extend" test in ext3_prepare_write() succeeds.
*/
-
-
-MODULE_LICENSE("GPL");
}
journal = journal_init_inode(journal_inode);
- if (!journal)
+ if (!journal) {
+ printk(KERN_ERR "EXT3-fs: Could not load journal inode\n");
iput(journal_inode);
+ }
+
return journal;
}
journal_t *journal;
int journal_inum = le32_to_cpu(es->s_journal_inum);
int journal_dev = le32_to_cpu(es->s_journal_dev);
- int err;
+ int err = 0;
int really_read_only;
really_read_only = is_read_only(sb->s_dev);
}
if (!EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER))
- journal_wipe(journal, !really_read_only);
+ err = journal_wipe(journal, !really_read_only);
+ if (!err)
+ err = journal_load(journal);
- err = journal_load(journal);
if (err) {
printk(KERN_ERR "EXT3-fs: error loading journal.\n");
journal_destroy(journal);
EXPORT_NO_SYMBOLS;
+MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
MODULE_LICENSE("GPL");
module_init(init_ext3_fs)
module_exit(exit_ext3_fs)
EXPORT_SYMBOL(zlib_fs_inflateReset);
EXPORT_SYMBOL(zlib_fs_adler32);
EXPORT_SYMBOL(zlib_fs_inflateSyncPoint);
+MODULE_LICENSE("GPL");
<< file->f_dentry->d_inode->i_sb->s_blocksize_bits);
error = presto_reserve_space(fset->fset_cache, res_size);
- CDEBUG(D_INODE, "Reserved %Ld for %d\n", res_size, size);
+ CDEBUG(D_INODE, "Reserved %Ld for %Zd\n", res_size, size);
if ( error ) {
EXIT;
return -ENOSPC;
fops = filter_c2cffops(cache->cache_filter);
res = fops->write(file, buf, size, off);
if ( res != size ) {
- CDEBUG(D_FILE, "file write returns short write: size %d, res %d\n", size, res);
+ CDEBUG(D_FILE, "file write returns short write: size %Zd, res %Zd\n", size, res);
}
if ( (res > 0) && fdata )
return 0;
}
- CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %d\n",
+ CDEBUG(D_JOURNAL, "reading prefix: off %ld, size %Zd\n",
(long)lml_offset, sizeof(record));
rc = presto_fread(fset->fset_lml.fd_file, (char *)&record,
sizeof(record), &offset);
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/list.h>
+#include <linux/termios.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/poll.h>
/* move data into response buffer. */
if (req->rq_bufsize < count) {
- printk("psdev_write: too much cnt: %d, cnt: %d, "
+ printk("psdev_write: too much cnt: %d, cnt: %Zd, "
"opc: %d, uniq: %d.\n",
req->rq_bufsize, count, hdr.opcode, hdr.unique);
count = req->rq_bufsize; /* don't have more space! */
__FUNCTION__, kdevname(dev));
}
- CDEBUG(D_PSDEV, "count %d\n", count);
+ CDEBUG(D_PSDEV, "count %Zd\n", count);
if (list_empty(&(upccom->uc_pending))) {
CDEBUG(D_UPCALL, "Empty pending list in read, not good\n");
return -EINVAL;
}
if (count < req->rq_bufsize) {
- printk ("psdev_read: buffer too small, read %d of %d bytes\n",
+ printk ("psdev_read: buffer too small, read %Zd of %d bytes\n",
count, req->rq_bufsize);
}
error = copy_from_user(&readmount, (void *)arg,
sizeof(readmount));
if ( error ) {
- printk("psdev: can't copy %d bytes from %p to %p\n",
+ printk("psdev: can't copy %Zd bytes from %p to %p\n",
sizeof(readmount), (struct readmount *) arg,
&readmount);
EXIT;
input.size = size;
upccom->uc_pid = saved_pid;
- CDEBUG(D_PSDEV, "get_kmlsize: size = %d\n", size);
+ CDEBUG(D_PSDEV, "get_kmlsize: size = %Zd\n", size);
EXIT;
return copy_to_user((char *)arg, &input, sizeof(input));
error = copy_from_user(&kopt, (void *)arg, sizeof(kopt));
if ( error ) {
- printk("psdev: can't copyin %d bytes from %p to %p\n",
+ printk("psdev: can't copyin %Zd bytes from %p to %p\n",
sizeof(kopt), (struct kopt *) arg, &kopt);
EXIT;
return error;
default:
CDEBUG(D_PSDEV, "bad ioctl 0x%x, \n", cmd);
- CDEBUG(D_PSDEV, "valid are 0x%x - 0x%x, 0x%x - 0x%x \n",
+ CDEBUG(D_PSDEV, "valid are 0x%Zx - 0x%Zx, 0x%Zx - 0x%Zx \n",
PRESTO_GETMOUNT, PRESTO_GET_KMLSIZE,
PRESTO_VFS_SETATTR, PRESTO_VFS_IOPEN);
EXIT;
req->rq_opcode, jiffies - req->rq_posttime,
req->rq_unique, req->rq_rep_size);
CDEBUG(D_UPCALL,
- "..process %d woken up by Lento for req at 0x%x, data at %x\n",
- current->pid, (int)req, (int)req->rq_data);
+ "..process %d woken up by Lento for req at 0x%p, data at %p\n",
+ current->pid, req, req->rq_data);
if (upc_commp->uc_pid) { /* i.e. Lento is still alive */
/* Op went through, interrupt or not we go on */
struct buffer_head *wbuf[64];
int bufs;
int flags;
- int blocknr;
+ int err;
+ unsigned long blocknr;
char *tagp = NULL;
journal_header_t *header;
journal_block_tag_t *tag = NULL;
jbd_debug(4, "JBD: get descriptor\n");
descriptor = journal_get_descriptor_buffer(journal);
+ if (!descriptor) {
+ __journal_abort_hard(journal);
+ continue;
+ }
+
bh = jh2bh(descriptor);
jbd_debug(4, "JBD: got buffer %ld (%p)\n",
bh->b_blocknr, bh->b_data);
/* Where is the buffer to be written? */
- blocknr = journal_next_log_block(journal);
+ err = journal_next_log_block(journal, &blocknr);
+ /* If the block mapping failed, just abandon the buffer
+ and repeat this loop: we'll fall into the
+ refile-on-abort condition above. */
+ if (err) {
+ __journal_abort_hard(journal);
+ continue;
+ }
/* Bump b_count to prevent truncate from stumbling over
the shadowed buffer! @@@ This can go if we ever get
jbd_debug(3, "JBD: commit phase 6\n");
+ if (is_journal_aborted(journal))
+ goto skip_commit;
+
/* Done it all: now write the commit record. We should have
* cleaned up our previous buffers by now, so if we are in abort
* mode we can now just skip the rest of the journal write
* entirely. */
- if (is_journal_aborted(journal))
- goto skip_commit;
-
descriptor = journal_get_descriptor_buffer(journal);
-
+ if (!descriptor) {
+ __journal_abort_hard(journal);
+ goto skip_commit;
+ }
+
/* AKPM: buglet - add `i' to tmp! */
for (i = 0; i < jh2bh(descriptor)->b_size; i += 512) {
journal_header_t *tmp =
EXPORT_SYMBOL(journal_destroy);
EXPORT_SYMBOL(journal_recover);
EXPORT_SYMBOL(journal_update_superblock);
-EXPORT_SYMBOL(__journal_abort);
EXPORT_SYMBOL(journal_abort);
EXPORT_SYMBOL(journal_errno);
EXPORT_SYMBOL(journal_ack_err);
* Log buffer allocation routines:
*/
-unsigned long journal_next_log_block(journal_t *journal)
+int journal_next_log_block(journal_t *journal, unsigned long *retp)
{
unsigned long blocknr;
journal->j_free--;
if (journal->j_head == journal->j_last)
journal->j_head = journal->j_first;
- return journal_bmap(journal, blocknr);
+ return journal_bmap(journal, blocknr, retp);
}
/*
* this is a no-op. If needed, we can use j_blk_offset - everything is
* ready.
*/
-unsigned long journal_bmap(journal_t *journal, unsigned long blocknr)
+int journal_bmap(journal_t *journal, unsigned long blocknr,
+ unsigned long *retp)
{
+ int err = 0;
unsigned long ret;
if (journal->j_inode) {
ret = bmap(journal->j_inode, blocknr);
- J_ASSERT(ret != 0);
+ if (ret)
+ *retp = ret;
+ else {
+ printk (KERN_ALERT __FUNCTION__
+ ": journal block not found "
+ "at offset %lu on %s\n",
+ blocknr, bdevname(journal->j_dev));
+ err = -EIO;
+ __journal_abort_soft(journal, err);
+ }
} else {
- ret = blocknr; /* +journal->j_blk_offset */
+ *retp = blocknr; /* +journal->j_blk_offset */
}
- return ret;
+ return err;
}
/*
struct journal_head * journal_get_descriptor_buffer(journal_t *journal)
{
struct buffer_head *bh;
- unsigned long blocknr = journal_next_log_block(journal);
+ unsigned long blocknr;
+ int err;
+
+ err = journal_next_log_block(journal, &blocknr);
+
+ if (err)
+ return NULL;
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
bh->b_state |= (1 << BH_Dirty);
{
struct buffer_head *bh;
journal_t *journal = journal_init_common();
- int blocknr;
+ int err;
+ unsigned long blocknr;
if (!journal)
return NULL;
journal->j_inode = inode;
jbd_debug(1,
"journal %p: inode %s/%ld, size %Ld, bits %d, blksize %ld\n",
- journal, bdevname(inode->i_dev), inode->i_ino, inode->i_size,
+ journal, bdevname(inode->i_dev), inode->i_ino,
+ (long long) inode->i_size,
inode->i_sb->s_blocksize_bits, inode->i_sb->s_blocksize);
journal->j_maxlen = inode->i_size >> inode->i_sb->s_blocksize_bits;
journal->j_blocksize = inode->i_sb->s_blocksize;
- blocknr = journal_bmap(journal, 0);
+ err = journal_bmap(journal, 0, &blocknr);
+ /* If that failed, give up */
+ if (err) {
+ printk(KERN_ERR __FUNCTION__ ": Cannnot locate journal "
+ "superblock\n");
+ kfree(journal);
+ return NULL;
+ }
+
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
J_ASSERT(bh != NULL);
journal->j_sb_buffer = bh;
return journal;
}
+/*
+ * If the journal init or create aborts, we need to mark the journal
+ * superblock as being NULL to prevent the journal destroy from writing
+ * back a bogus superblock.
+ */
+static void journal_fail_superblock (journal_t *journal)
+{
+ struct buffer_head *bh = journal->j_sb_buffer;
+ brelse(bh);
+ journal->j_sb_buffer = NULL;
+}
+
/*
* Given a journal_t structure, initialise the various fields for
* startup of a new journaling session. We use this both when creating
int journal_create (journal_t *journal)
{
- int blocknr;
+ unsigned long blocknr;
struct buffer_head *bh;
journal_superblock_t *sb;
- int i;
+ int i, err;
if (journal->j_maxlen < JFS_MIN_JOURNAL_BLOCKS) {
printk (KERN_ERR "Journal length (%d blocks) too short.\n",
journal->j_maxlen);
+ journal_fail_superblock(journal);
return -EINVAL;
}
have any blocks on disk beginning with JFS_MAGIC_NUMBER. */
jbd_debug(1, "JBD: Zeroing out journal blocks...\n");
for (i = 0; i < journal->j_maxlen; i++) {
- blocknr = journal_bmap(journal, i);
+ err = journal_bmap(journal, i, &blocknr);
+ if (err)
+ return err;
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
wait_on_buffer(bh);
memset (bh->b_data, 0, journal->j_blocksize);
mark_buffer_uptodate(bh, 1);
__brelse(bh);
}
+
sync_dev(journal->j_dev);
jbd_debug(1, "JBD: journal cleared.\n");
{
struct buffer_head *bh;
journal_superblock_t *sb;
-
+ int err = -EIO;
+
bh = journal->j_sb_buffer;
J_ASSERT(bh != NULL);
if (!buffer_uptodate(bh)) {
printk (KERN_ERR
"JBD: IO error reading journal superblock\n");
- return -EIO;
+ goto out;
}
}
sb = journal->j_superblock;
+ err = -EINVAL;
+
if (sb->s_header.h_magic != htonl(JFS_MAGIC_NUMBER) ||
sb->s_blocksize != htonl(journal->j_blocksize)) {
printk(KERN_WARNING "JBD: no valid journal superblock found\n");
- return -EINVAL;
+ goto out;
}
switch(ntohl(sb->s_header.h_blocktype)) {
break;
default:
printk(KERN_WARNING "JBD: unrecognised superblock format ID\n");
- return -EINVAL;
+ goto out;
}
if (ntohl(sb->s_maxlen) < journal->j_maxlen)
journal->j_maxlen = ntohl(sb->s_maxlen);
else if (ntohl(sb->s_maxlen) > journal->j_maxlen) {
printk (KERN_WARNING "JBD: journal file too short\n");
- return -EINVAL;
+ goto out;
}
return 0;
+
+out:
+ journal_fail_superblock(journal);
+ return err;
}
/*
/* We can now mark the journal as empty. */
journal->j_tail = 0;
journal->j_tail_sequence = ++journal->j_transaction_sequence;
- journal_update_superblock(journal, 1);
+ if (journal->j_sb_buffer) {
+ journal_update_superblock(journal, 1);
+ brelse(journal->j_sb_buffer);
+ }
if (journal->j_inode)
iput(journal->j_inode);
journal_destroy_revoke(journal);
unlock_journal(journal);
- brelse(journal->j_sb_buffer);
kfree(journal);
MOD_DEC_USE_COUNT;
}
* progress).
*/
-/* Quick version for internal journal use (doesn't lock the journal) */
-void __journal_abort (journal_t *journal)
+/* Quick version for internal journal use (doesn't lock the journal).
+ * Aborts hard --- we mark the abort as occurred, but do _nothing_ else,
+ * and don't attempt to make any other journal updates. */
+void __journal_abort_hard (journal_t *journal)
{
transaction_t *transaction;
+ if (journal->j_flags & JFS_ABORT)
+ return;
+
printk (KERN_ERR "Aborting journal on device %s.\n",
journal_dev_name(journal));
log_start_commit(journal, transaction);
}
-/* Full version for external use */
-void journal_abort (journal_t *journal, int errno)
+/* Soft abort: record the abort error status in the journal superblock,
+ * but don't do any other IO. */
+void __journal_abort_soft (journal_t *journal, int errno)
{
- lock_journal(journal);
-
if (journal->j_flags & JFS_ABORT)
- goto out;
+ return;
if (!journal->j_errno)
journal->j_errno = errno;
- __journal_abort(journal);
+ __journal_abort_hard(journal);
if (errno)
journal_update_superblock(journal, 1);
+}
- out:
+/* Full version for external use */
+void journal_abort (journal_t *journal, int errno)
+{
+ lock_journal(journal);
+ __journal_abort_soft(journal, errno);
unlock_journal(journal);
}
static int do_readahead(journal_t *journal, unsigned int start)
{
int err;
- unsigned int max, nbufs, next, blocknr;
+ unsigned int max, nbufs, next;
+ unsigned long blocknr;
struct buffer_head *bh;
struct buffer_head * bufs[MAXBUF];
nbufs = 0;
for (next = start; next < max; next++) {
- blocknr = journal_bmap(journal, next);
+ err = journal_bmap(journal, next, &blocknr);
- if (!blocknr) {
+ if (err) {
printk (KERN_ERR "JBD: bad block at offset %u\n",
next);
- err = -EIO;
goto failed;
}
static int jread(struct buffer_head **bhp, journal_t *journal,
unsigned int offset)
{
- unsigned int blocknr;
+ int err;
+ unsigned long blocknr;
struct buffer_head *bh;
*bhp = NULL;
J_ASSERT (offset < journal->j_maxlen);
- blocknr = journal_bmap(journal, offset);
+ err = journal_bmap(journal, offset, &blocknr);
- if (!blocknr) {
+ if (err) {
printk (KERN_ERR "JBD: bad block at offset %u\n",
offset);
- return -EIO;
+ return err;
}
bh = getblk(journal->j_dev, blocknr, journal->j_blocksize);
if (!descriptor) {
descriptor = journal_get_descriptor_buffer(journal);
+ if (!descriptor)
+ return;
header = (journal_header_t *) &jh2bh(descriptor)->b_data[0];
header->h_magic = htonl(JFS_MAGIC_NUMBER);
header->h_blocktype = htonl(JFS_REVOKE_BLOCK);
JBUFFER_TRACE(jh, "not on a transaction");
__journal_file_buffer(jh, handle->h_transaction, wanted_jlist);
}
- /*
- * We need to mark the buffer dirty and refile it inside the lock to
- * protect it from release by journal_try_to_free_buffer()
- *
- * We set ->b_flushtime to something small enough to typically keep
- * kupdate away from the buffer.
- *
- * We don't need to do a balance_dirty() - __block_commit_write()
- * does that.
- */
- if (!async && !atomic_set_buffer_dirty(jh2bh(jh))) {
- jh2bh(jh)->b_flushtime =
- jiffies + journal->j_commit_interval + 1 * HZ;
- refile_buffer(jh2bh(jh));
- }
no_journal:
spin_unlock(&journal_datalist_lock);
if (need_brelse) {
assert_spin_locked(&journal_datalist_lock);
- if (!buffer_jbd(bh))
- return 1;
jh = bh2jh(bh);
if (buffer_locked(bh) || buffer_dirty(bh)) {
/* set up enough so that it can read an inode */
s->s_op = &minix_sops;
root_inode = iget(s, MINIX_ROOT_INO);
- if (!root_inode)
+ if (!root_inode || is_bad_inode(root_inode))
goto out_no_root;
s->s_root = d_alloc_root(root_inode);
int i;
raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh);
- if (!raw_inode)
+ if (!raw_inode) {
+ make_bad_inode(inode);
return;
+ }
inode->i_mode = raw_inode->i_mode;
inode->i_uid = (uid_t)raw_inode->i_uid;
inode->i_gid = (gid_t)raw_inode->i_gid;
int i;
raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh);
- if (!raw_inode)
+ if (!raw_inode) {
+ make_bad_inode(inode);
return;
+ }
inode->i_mode = raw_inode->i_mode;
inode->i_uid = (uid_t)raw_inode->i_uid;
inode->i_gid = (gid_t)raw_inode->i_gid;
module_init(init_msdos_fs)
module_exit(exit_msdos_fs)
+MODULE_LICENSE("GPL");
struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data);
int do_remount_sb(struct super_block *sb, int flags, void * data);
void kill_super(struct super_block *sb);
+int __init init_rootfs(void);
static struct list_head *mount_hashtable;
static int hash_mask, hash_bits;
+Sat Dec 15 2001 Christoph Hellwig <hch@caldera.de>
+
+ * inode.c (sysv_read_inode): Mark inode as bad in case of failure.
+ * super.c (complete_read_super): Check for bad root inode.
+
+Wed Nov 21 2001 Andrew Morton <andrewm@uow.edu.au>
+
+ * file.c (sysv_sync_file): Call fsync_inode_data_buffers.
+
Fri Oct 26 2001 Christoph Hellwig <hch@caldera.de>
* dir.c, ialloc.c, namei.c, include/linux/sysv_fs_i.h:
printk("Bad inode number on dev %s"
": %d is out of range\n",
kdevname(inode->i_dev), ino);
- return;
+ goto bad_inode;
}
raw_inode = sysv_raw_inode(sb, ino, &bh);
if (!raw_inode) {
printk("Major problem: unable to read inode from dev %s\n",
bdevname(inode->i_dev));
- return;
+ goto bad_inode;
}
/* SystemV FS: kludge permissions if ino==SYSV_ROOT_INO ?? */
inode->i_mode = fs16_to_cpu(sb, raw_inode->i_mode);
rdev = (u16)fs32_to_cpu(sb, inode->u.sysv_i.i_data[0]);
inode->u.sysv_i.i_dir_start_lookup = 0;
sysv_set_inode(inode, rdev);
+ return;
+
+bad_inode:
+ make_bad_inode(inode);
+ return;
}
static struct buffer_head * sysv_update_inode(struct inode * inode)
/* set up enough so that it can read an inode */
sb->s_op = &sysv_sops;
root_inode = iget(sb,SYSV_ROOT_INO);
- if (!root_inode) {
+ if (!root_inode || is_bad_inode(root_inode)) {
printk("SysV FS: get root inode failed\n");
return 0;
}
if (inode->i_ino < UFS_ROOTINO ||
inode->i_ino > (uspi->s_ncg * uspi->s_ipg)) {
ufs_warning (sb, "ufs_read_inode", "bad inode number (%lu)\n", inode->i_ino);
- return;
+ goto bad_inode;
}
bh = sb_bread(sb, uspi->s_sbbase + ufs_inotofsba(inode->i_ino));
if (!bh) {
ufs_warning (sb, "ufs_read_inode", "unable to read inode %lu\n", inode->i_ino);
- return;
+ goto bad_inode;
}
ufs_inode = (struct ufs_inode *) (bh->b_data + sizeof(struct ufs_inode) * ufs_inotofsbo(inode->i_ino));
brelse (bh);
UFSD(("EXIT\n"))
+ return;
+
+bad_inode:
+ make_bad_inode(inode);
+ return;
}
static int ufs_update_inode(struct inode * inode, int do_sync)
struct ufs_super_block_second * usb2;
struct ufs_super_block_third * usb3;
struct ufs_buffer_head * ubh;
+ struct inode *inode;
unsigned block_size, super_block_size;
unsigned flags;
fs32_to_cpu(sb, usb3->fs_u2.fs_44.fs_maxsymlinklen);
sb->u.ufs_sb.s_flags = flags;
- sb->s_root = d_alloc_root(iget(sb, UFS_ROOTINO));
+
+ inode = iget(sb, UFS_ROOTINO);
+ if (!inode || is_bad_inode(inode))
+ goto failed;
+ sb->s_root = d_alloc_root(inode);
+ if (!sb->s_root)
+ goto dalloc_failed;
/*
UFSD(("EXIT\n"))
return(sb);
+dalloc_failed:
+ iput(inode);
failed:
if (ubh) ubh_brelse_uspi (uspi);
if (uspi) kfree (uspi);
module_init(init_vfat_fs)
module_exit(exit_vfat_fs)
+MODULE_LICENSE("GPL");
#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */
#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */
#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */
+#define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */
#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */
#define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */
#define MSR_K7_EVNTSEL0 0xC0010000
#define MSR_K7_PERFCTR0 0xC0010004
+#define MSR_K7_HWCR 0xC0010015
/* Centaur-Hauls/IDT defined MSRs. */
#define MSR_IDT_FCR1 0x107
extern unsigned long cpu_online_map;
extern volatile unsigned long smp_invalidate_needed;
extern int pic_mode;
+extern int smp_num_siblings;
+extern int cpu_sibling_map[];
+
extern void smp_flush_tlb(void);
extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
extern void smp_send_reschedule(int cpu);
/*
* The second extended file system version
*/
-#define EXT3FS_DATE "06 Nov 2001"
-#define EXT3FS_VERSION "2.4-0.9.15"
+#define EXT3FS_DATE "02 Dec 2001"
+#define EXT3FS_VERSION "2.4-0.9.16"
/*
* Debug code
~EXT3_DIR_ROUND)
#ifdef __KERNEL__
-
-/* Filesize hard limits for 64-bit file offsets */
-extern long long ext3_max_sizes[];
-
/*
* Describe an inode's exact location on disk and in memory
*/
# define ATTRIB_NORET __attribute__((noreturn))
# define NORET_AND noreturn,
-/* acl.c */
-extern int ext3_permission (struct inode *, int);
-
/* balloc.c */
extern int ext3_bg_has_super(struct super_block *sb, int group);
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
unsigned int block_group,
struct buffer_head ** bh);
-/* bitmap.c */
-extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
-
/* dir.c */
extern int ext3_check_dir_entry(const char *, struct inode *,
struct ext3_dir_entry_2 *, struct buffer_head *,
unsigned long);
-
-/* file.c */
-
/* fsync.c */
extern int ext3_sync_file (struct file *, struct dentry *, int);
extern struct inode * ext3_orphan_get (struct super_block *, ino_t);
extern unsigned long ext3_count_free_inodes (struct super_block *);
extern void ext3_check_inodes_bitmap (struct super_block *);
+extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
/* inode.c */
-
extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
extern void ext3_discard_prealloc (struct inode *);
extern void ext3_dirty_inode(struct inode *);
extern int ext3_change_inode_journal_flag(struct inode *, int);
+extern void ext3_truncate (struct inode *);
/* ioctl.c */
extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
/* namei.c */
-extern struct inode_operations ext3_dir_inode_operations;
extern int ext3_orphan_add(handle_t *, struct inode *);
extern int ext3_orphan_del(handle_t *, struct inode *);
extern struct super_block * ext3_read_super (struct super_block *,void *,int);
extern int ext3_statfs (struct super_block *, struct statfs *);
-/* truncate.c */
-extern void ext3_truncate (struct inode *);
-
#define ext3_std_error(sb, errno) \
do { \
if ((errno)) \
extern struct inode_operations ext3_file_inode_operations;
extern struct file_operations ext3_file_operations;
+/* inode.c */
+extern struct address_space_operations ext3_aops;
+
+/* namei.c */
+extern struct inode_operations ext3_dir_inode_operations;
+
/* symlink.c */
extern struct inode_operations ext3_fast_symlink_inode_operations;
-extern struct address_space_operations ext3_aops;
#endif /* __KERNEL__ */
*/
static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks)
{
+ journal_t *journal;
+
if (inode->i_sb->s_flags & MS_RDONLY)
return ERR_PTR(-EROFS);
- return journal_start(EXT3_JOURNAL(inode), nblocks);
+
+ /* Special case here: if the journal has aborted behind our
+ * backs (eg. EIO in the commit thread), then we still need to
+ * take the FS itself readonly cleanly. */
+ journal = EXT3_JOURNAL(inode);
+ if (is_journal_aborted(journal)) {
+ ext3_abort(inode->i_sb, __FUNCTION__,
+ "Detected aborted journal");
+ return ERR_PTR(-EROFS);
+ }
+
+ return journal_start(journal, nblocks);
}
static inline handle_t *
#endif
#else
-#define J_ASSERT(assert)
+#define J_ASSERT(assert) do { } while (0)
#endif /* JBD_ASSERTIONS */
enum jbd_state_bits {
/* Log buffer allocation */
extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
-extern unsigned long journal_next_log_block(journal_t *);
+int journal_next_log_block(journal_t *, unsigned long *);
/* Commit management */
extern void journal_commit_transaction(journal_t *);
extern void journal_destroy (journal_t *);
extern int journal_recover (journal_t *journal);
extern int journal_wipe (journal_t *, int);
-extern int journal_skip_recovery (journal_t *);
-extern void journal_update_superblock (journal_t *, int);
-extern void __journal_abort (journal_t *);
+extern int journal_skip_recovery (journal_t *);
+extern void journal_update_superblock (journal_t *, int);
+extern void __journal_abort_hard (journal_t *);
+extern void __journal_abort_soft (journal_t *, int);
extern void journal_abort (journal_t *, int);
extern int journal_errno (journal_t *);
extern void journal_ack_err (journal_t *);
extern int journal_clear_err (journal_t *);
-extern unsigned long journal_bmap(journal_t *journal, unsigned long blocknr);
-extern int journal_force_commit(journal_t *journal);
+extern int journal_bmap(journal_t *, unsigned long, unsigned long *);
+extern int journal_force_commit(journal_t *);
/*
* journal_head management
#define PF_MEMALLOC 0x00000800 /* Allocating memory */
#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */
#define PF_FREE_PAGES 0x00002000 /* per process page freeing */
+#define PF_NOIO 0x00004000 /* avoid generating further I/O */
#define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */
* a problem.
*/
if (tsk == idle_task(cpu)) {
+#if defined(__i386__) && defined(CONFIG_SMP)
+ /*
+ * Check if two siblings are idle in the same
+ * physical package. Use them if found.
+ */
+ if (smp_num_siblings == 2) {
+ if (cpu_curr(cpu_sibling_map[cpu]) ==
+ idle_task(cpu_sibling_map[cpu])) {
+ oldest_idle = last_schedule(cpu);
+ target_tsk = tsk;
+ break;
+ }
+
+ }
+#endif
if (last_schedule(cpu) < oldest_idle) {
oldest_idle = last_schedule(cpu);
target_tsk = tsk;
*
* PACKET - implements raw packet sockets.
*
- * Version: $Id: af_packet.c,v 1.57 2001/10/30 03:38:37 davem Exp $
+ * Version: $Id: af_packet.c,v 1.58 2001/11/28 21:02:10 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
module_init(packet_init);
module_exit(packet_exit);
+MODULE_LICENSE("GPL");
#include <../drivers/net/syncppp.h>
#else
+ #include <asm/segment.h> /* kernel <-> user copy */
#endif
#define KMEM_SAFETYZONE 8
#define PROC_STATS_FORMAT "%30s: %12lu\n"
#else
#define PROC_STATS_FORMAT "%30s: %12u\n"
+ #include <asm/segment.h> /* kernel <-> user copy */
#endif