From 9c2dd1d4faab84b817530e518705b67e9b6b1f0b Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:29:02 -0500 Subject: [PATCH] Import 2.3.30 --- arch/alpha/kernel/irq.c | 91 ++----------- arch/alpha/kernel/pci.c | 37 +++++- arch/alpha/kernel/smp.c | 8 +- arch/alpha/kernel/sys_alcor.c | 2 +- arch/alpha/kernel/sys_cabriolet.c | 6 +- arch/alpha/kernel/sys_dp264.c | 55 +++++--- arch/alpha/kernel/sys_eb64p.c | 3 +- arch/alpha/kernel/sys_eiger.c | 2 +- arch/alpha/kernel/sys_jensen.c | 2 +- arch/alpha/kernel/sys_miata.c | 2 +- arch/alpha/kernel/sys_mikasa.c | 3 +- arch/alpha/kernel/sys_nautilus.c | 2 +- arch/alpha/kernel/sys_noritake.c | 3 +- arch/alpha/kernel/sys_rawhide.c | 2 +- arch/alpha/kernel/sys_ruffian.c | 2 +- arch/alpha/kernel/sys_rx164.c | 2 +- arch/alpha/kernel/sys_sable.c | 3 +- arch/alpha/kernel/sys_sio.c | 6 +- arch/alpha/kernel/sys_sx164.c | 2 +- arch/alpha/kernel/sys_takara.c | 2 +- arch/alpha/kernel/time.c | 2 +- drivers/block/loop.c | 2 +- drivers/net/rrunner.c | 2 +- drivers/pci/setup.c | 5 +- drivers/sound/trident.c | 1 + fs/dquot.c | 141 ++++++++++----------- include/asm-alpha/cache.h | 2 - include/asm-alpha/hardirq.h | 16 ++- .../irq_impl.h => include/asm-alpha/hw_irq.h | 4 + include/asm-alpha/irq.h | 3 - include/asm-i386/cache.h | 40 ++---- include/asm-i386/hardirq.h | 12 +- include/asm-i386/pgtable-3level.h | 5 +- include/asm-i386/pgtable.h | 14 +- include/asm-i386/system.h | 2 +- include/linux/bootmem.h | 2 +- include/linux/cache.h | 28 ++++ include/linux/fs.h | 8 +- include/linux/irq.h | 23 +--- include/linux/quota.h | 4 +- include/linux/quotaops.h | 19 +-- include/linux/sched.h | 1 + include/linux/slab.h | 2 +- kernel/sysctl.c | 2 +- mm/filemap.c | 1 - net/khttpd/datasending.c | 11 +- net/khttpd/main.c | 7 +- scripts/Menuconfig | 2 +- 48 files changed, 282 insertions(+), 314 deletions(-) rename arch/alpha/kernel/irq_impl.h => include/asm-alpha/hw_irq.h (97%) rewrite include/asm-i386/cache.h (60%) create mode 100644 include/linux/cache.h diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index 86c58359d..8368be9b2 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -22,15 +22,15 @@ #include #include #include +#include #include #include -#include #include #include +#include #include "proto.h" -#include "irq_impl.h" #define vulp volatile unsigned long * #define vuip volatile unsigned int * @@ -182,7 +182,8 @@ srm_device_interrupt(unsigned long vector, struct pt_regs * regs) */ static struct irqaction timer_irq = { NULL, 0, 0, NULL, NULL, NULL}; -static struct irqaction *irq_action[NR_IRQS]; +spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; +irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { [0 ... NR_IRQS-1] = {0,} }; static inline void @@ -230,12 +231,7 @@ enable_irq(unsigned int irq_nr) int check_irq(unsigned int irq) { - struct irqaction **p; - - p = irq_action + irq; - if (*p == NULL) - return 0; - return -EBUSY; + return irq_desc[irq].action ? -EBUSY : 0; } int @@ -253,7 +249,7 @@ request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), if (!handler) return -EINVAL; - p = irq_action + irq; + p = &irq_desc[irq].action; action = *p; if (action) { /* Can't share interrupts unless both agree to */ @@ -314,14 +310,14 @@ free_irq(unsigned int irq, void *dev_id) printk("Trying to free reserved IRQ %d\n", irq); return; } - for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) { + for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) { if (action->dev_id != dev_id) continue; /* Found it - now free it */ save_and_cli(flags); *p = action->next; - if (!irq[irq_action]) + if (!irq_desc[irq].action) mask_irq(irq); restore_flags(flags); kfree(action); @@ -344,7 +340,7 @@ int get_irq_list(char *buf) #endif for (i = 0; i < NR_IRQS; i++) { - action = irq_action[i]; + action = irq_desc[i].action; if (!action) continue; p += sprintf(p, "%3d: ",i); @@ -541,63 +537,6 @@ __global_restore_flags(unsigned long flags) } } -#undef INIT_STUCK -#define INIT_STUCK (1<<26) - -#undef STUCK -#define STUCK \ - if (!--stuck) { \ - printk("irq_enter stuck (irq=%d, cpu=%d, global=%d)\n", \ - irq, cpu, global_irq_holder); \ - stuck = INIT_STUCK; \ - } - -#undef VERBOSE_IRQLOCK_DEBUGGING - -void -irq_enter(int cpu, int irq) -{ -#ifdef VERBOSE_IRQLOCK_DEBUGGING - extern void smp_show_backtrace_all_cpus(void); -#endif - int stuck = INIT_STUCK; - - hardirq_enter(cpu, irq); - barrier(); - while (spin_is_locked(&global_irq_lock)) { - if (cpu == global_irq_holder) { - int globl_locked = spin_is_locked(&global_irq_lock); - int globl_icount = atomic_read(&global_irq_count); - int local_count = local_irq_count(cpu); - - /* It is very important that we load the state - variables before we do the first call to - printk() as printk() could end up changing - them... */ - - printk("CPU[%d]: where [%p] glocked[%d] gicnt[%d]" - " licnt[%d]\n", - cpu, previous_irqholder, globl_locked, - globl_icount, local_count); -#ifdef VERBOSE_IRQLOCK_DEBUGGING - printk("Performing backtrace on all CPUs," - " write this down!\n"); - smp_show_backtrace_all_cpus(); -#endif - break; - } - STUCK; - barrier(); - } -} - -void -irq_exit(int cpu, int irq) -{ - hardirq_exit(cpu, irq); - release_irqlock(cpu); -} - static void show(char * str, void *where) { @@ -698,12 +637,6 @@ synchronize_irq(void) } #endif } - -#else /* !__SMP__ */ - -#define irq_enter(cpu, irq) (++local_irq_count(cpu)) -#define irq_exit(cpu, irq) (--local_irq_count(cpu)) - #endif /* __SMP__ */ static void @@ -720,7 +653,7 @@ unexpected_irq(int irq, struct pt_regs * regs) printk("PC = %016lx PS=%04lx\n", regs->pc, regs->ps); printk("Expecting: "); for (i = 0; i < ACTUAL_NR_IRQS; i++) - if ((action = irq_action[i])) + if ((action = irq_desc[i].action)) while (action->handler) { printk("[%s:%d] ", action->name, i); action = action->next; @@ -774,7 +707,7 @@ handle_irq(int irq, int ack, struct pt_regs * regs) irq_enter(cpu, irq); kstat.irqs[cpu][irq] += 1; - action = irq_action[irq]; + action = irq_desc[irq].action; /* * For normal interrupts, we mask it out, and then ACK it. @@ -823,7 +756,7 @@ probe_irq_on(void) if (!(PROBE_MASK & (1UL << i))) { continue; } - action = irq_action[i]; + action = irq_desc[i].action; if (!action) { enable_irq(i); irqs |= (1UL << i); diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 4fb054e38..9a61a4e99 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -57,11 +57,32 @@ quirk_isa_bridge(struct pci_dev *dev) dev->class = PCI_CLASS_BRIDGE_ISA; } +static void __init +quirk_vga_enable_rom(struct pci_dev *dev) +{ + /* If it's a VGA, enable its BIOS ROM at C0000. + But if its a Cirrus 543x/544x DISABLE it, since + enabling ROM disables the memory... */ + if ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA && + /* But if its a Cirrus 543x/544x DISABLE it */ + (dev->vendor != PCI_VENDOR_ID_CIRRUS || + (dev->device < 0x00a0) || (dev->device > 0x00ac))) + { + u32 reg; + + pci_read_config_dword(dev, dev->rom_base_reg, ®); + reg |= PCI_ROM_ADDRESS_ENABLE; + pci_write_config_dword(dev, dev->rom_base_reg, reg); + dev->resource[PCI_ROM_RESOURCE].flags |= PCI_ROM_ADDRESS_ENABLE; + } +} + struct pci_fixup pcibios_fixups[] __initdata = { { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge }, + { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, quirk_vga_enable_rom }, { 0 } }; @@ -71,7 +92,7 @@ struct pci_fixup pcibios_fixups[] __initdata = { #define MB (1024*KB) #define GB (1024*MB) -void __init +void pcibios_align_resource(void *data, struct resource *res, unsigned long size) { struct pci_dev * dev = data; @@ -145,13 +166,13 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size) static void __init pcibios_assign_special(struct pci_dev * dev) { + int i; + /* The first three resources of an IDE controler are often magic, so leave them unchanged. This is true, for instance, of the Contaq 82C693 as seen on SX164 and DP264. */ if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) { - int i; - /* Resource 1 of IDE controller is the address of HD_CMD register which actually occupies a single byte (0x3f6 for ide0) in reported 0x3f4-3f7 range. We have to fix @@ -163,6 +184,16 @@ pcibios_assign_special(struct pci_dev * dev) if (dev->resource[i].flags && dev->resource[i].start) pci_claim_resource(dev, i); } + /* + * We don't have code that will init the CYPRESS bridge correctly + * so we do the next best thing, and depend on the previous + * console code to do the right thing, and ignore it here... :-\ + */ + else if (dev->vendor == PCI_VENDOR_ID_CONTAQ && + dev->device == PCI_DEVICE_ID_CONTAQ_82C693) + for (i = 0; i < PCI_NUM_RESOURCES; i++) + if (dev->resource[i].flags && dev->resource[i].start) + pci_claim_resource(dev, i); } diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index a1beba5be..3fbf11495 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -32,7 +33,6 @@ #include #include "proto.h" -#include "irq_impl.h" #define DEBUG_SMP 0 @@ -47,8 +47,8 @@ struct cpuinfo_alpha cpu_data[NR_CPUS]; /* A collection of single bit ipi messages. */ static struct { - unsigned long bits __cacheline_aligned; -} ipi_data[NR_CPUS]; + unsigned long bits ____cacheline_aligned; +} ipi_data[NR_CPUS] __cacheline_aligned; enum ipi_message_type { IPI_RESCHEDULE, @@ -56,7 +56,7 @@ enum ipi_message_type { IPI_CPU_STOP, }; -spinlock_t kernel_flag __cacheline_aligned = SPIN_LOCK_UNLOCKED; +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; /* Set to a secondary's cpuid when it comes online. */ static unsigned long smp_secondary_alive; diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index 684e9edec..2a27bac5b 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c @@ -27,7 +27,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c index d79913e82..bc4d2c2ba 100644 --- a/arch/alpha/kernel/sys_cabriolet.c +++ b/arch/alpha/kernel/sys_cabriolet.c @@ -31,7 +31,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -298,7 +298,6 @@ struct alpha_machine_vector eb164_mv __initmv = { init_irq: cabriolet_init_irq, init_pit: common_init_pit, init_pci: cabriolet_init_pci, - kill_arch: common_kill_arch, pci_map_irq: cabriolet_map_irq, pci_swizzle: common_swizzle, }; @@ -327,7 +326,6 @@ struct alpha_machine_vector eb66p_mv __initmv = { init_irq: cabriolet_init_irq, init_pit: common_init_pit, init_pci: cabriolet_init_pci, - kill_arch: common_kill_arch, pci_map_irq: eb66p_map_irq, pci_swizzle: common_swizzle, }; @@ -356,7 +354,6 @@ struct alpha_machine_vector lx164_mv __initmv = { init_irq: cabriolet_init_irq, init_pit: common_init_pit, init_pci: alphapc164_init_pci, - kill_arch: common_kill_arch, pci_map_irq: alphapc164_map_irq, pci_swizzle: common_swizzle, }; @@ -385,7 +382,6 @@ struct alpha_machine_vector pc164_mv __initmv = { init_irq: cabriolet_init_irq, init_pit: common_init_pit, init_pci: alphapc164_init_pci, - kill_arch: common_kill_arch, pci_map_irq: alphapc164_map_irq, pci_swizzle: common_swizzle, }; diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 26e97a8ae..f0ef47183 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c @@ -27,7 +27,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -39,28 +39,30 @@ static void dp264_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p) { - if (irq >= 16) { - volatile unsigned long *csr; + volatile unsigned long *csr; - if (TSUNAMI_bootcpu < 2) - if (!TSUNAMI_bootcpu) - csr = &TSUNAMI_cchip->dim0.csr; - else - csr = &TSUNAMI_cchip->dim1.csr; + if (TSUNAMI_bootcpu < 2) { + if (!TSUNAMI_bootcpu) + csr = &TSUNAMI_cchip->dim0.csr; else - if (TSUNAMI_bootcpu == 2) - csr = &TSUNAMI_cchip->dim2.csr; - else - csr = &TSUNAMI_cchip->dim3.csr; - - *csr = ~mask; - mb(); - *csr; + csr = &TSUNAMI_cchip->dim1.csr; + } else { + if (TSUNAMI_bootcpu == 2) + csr = &TSUNAMI_cchip->dim2.csr; + else + csr = &TSUNAMI_cchip->dim3.csr; + } + + *csr = ~mask; + mb(); + *csr; + + if (irq < 16) { + if (irq >= 8) + outb(mask >> 8, 0xA1); /* ISA PIC2 */ + else + outb(mask, 0x21); /* ISA PIC1 */ } - else if (irq >= 8) - outb(mask >> 8, 0xA1); /* ISA PIC2 */ - else - outb(mask, 0x21); /* ISA PIC1 */ } static void @@ -274,8 +276,19 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin) struct pci_controler *hose = dev->sysdata; int irq = COMMON_TABLE_LOOKUP; - if (irq > 0) + if (irq > 0) { irq += 16 * hose->index; + } else { + /* ??? The Contaq IDE controler on the ISA bridge uses + "legacy" interrupts 14 and 15. I don't know if anything + can wind up at the same slot+pin on hose1, so we'll + just have to trust whatever value the console might + have assigned. */ + + u8 irq8; + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq8); + irq = irq8; + } return irq; } diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c index 4f15ec4f1..e8e224715 100644 --- a/arch/alpha/kernel/sys_eb64p.c +++ b/arch/alpha/kernel/sys_eb64p.c @@ -28,7 +28,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -212,7 +212,6 @@ struct alpha_machine_vector eb66_mv __initmv = { init_irq: eb64p_init_irq, init_pit: common_init_pit, init_pci: common_init_pci, - kill_arch: common_kill_arch, pci_map_irq: eb64p_map_irq, pci_swizzle: common_swizzle, }; diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c index 07dbed730..433abddfb 100644 --- a/arch/alpha/kernel/sys_eiger.c +++ b/arch/alpha/kernel/sys_eiger.c @@ -29,7 +29,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c index 992321331..ad156c9f2 100644 --- a/arch/alpha/kernel/sys_jensen.c +++ b/arch/alpha/kernel/sys_jensen.c @@ -28,7 +28,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 4e5dd14b9..b2da23528 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c @@ -25,7 +25,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c index c93bcec45..ac55371a6 100644 --- a/arch/alpha/kernel/sys_mikasa.c +++ b/arch/alpha/kernel/sys_mikasa.c @@ -28,7 +28,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -223,7 +223,6 @@ struct alpha_machine_vector mikasa_primo_mv __initmv = { init_irq: mikasa_init_irq, init_pit: common_init_pit, init_pci: common_init_pci, - kill_arch: common_kill_arch, pci_map_irq: mikasa_map_irq, pci_swizzle: common_swizzle, }; diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c index 48f79bd06..b51eee671 100644 --- a/arch/alpha/kernel/sys_nautilus.c +++ b/arch/alpha/kernel/sys_nautilus.c @@ -45,7 +45,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index 5a97b5e2c..c1a793393 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c @@ -29,7 +29,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -283,7 +283,6 @@ struct alpha_machine_vector noritake_primo_mv __initmv = { init_irq: noritake_init_irq, init_pit: common_init_pit, init_pci: common_init_pci, - kill_arch: common_kill_arch, pci_map_irq: noritake_map_irq, pci_swizzle: noritake_swizzle, }; diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c index 89bac9644..0a0ce2267 100644 --- a/arch/alpha/kernel/sys_rawhide.c +++ b/arch/alpha/kernel/sys_rawhide.c @@ -25,7 +25,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 7d4aeedd4..c03a91296 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c @@ -26,7 +26,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c index 0a13bb8f3..969d3561f 100644 --- a/arch/alpha/kernel/sys_rx164.c +++ b/arch/alpha/kernel/sys_rx164.c @@ -26,7 +26,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index 327167d47..53afe259b 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c @@ -26,7 +26,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -283,7 +283,6 @@ struct alpha_machine_vector sable_gamma_mv __initmv = { init_irq: sable_init_irq, init_pit: common_init_pit, init_pci: common_init_pci, - kill_arch: common_kill_arch, pci_map_irq: sable_map_irq, pci_swizzle: common_swizzle, diff --git a/arch/alpha/kernel/sys_sio.c b/arch/alpha/kernel/sys_sio.c index ade418eaf..f26991f55 100644 --- a/arch/alpha/kernel/sys_sio.c +++ b/arch/alpha/kernel/sys_sio.c @@ -30,7 +30,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" @@ -359,7 +359,6 @@ struct alpha_machine_vector avanti_mv __initmv = { init_irq: sio_init_irq, init_pit: common_init_pit, init_pci: noname_init_pci, - kill_arch: common_kill_arch, pci_map_irq: noname_map_irq, pci_swizzle: common_swizzle, @@ -392,7 +391,6 @@ struct alpha_machine_vector noname_mv __initmv = { init_irq: sio_init_irq, init_pit: common_init_pit, init_pci: noname_init_pci, - kill_arch: common_kill_arch, pci_map_irq: noname_map_irq, pci_swizzle: common_swizzle, @@ -434,7 +432,6 @@ struct alpha_machine_vector p2k_mv __initmv = { init_irq: sio_init_irq, init_pit: common_init_pit, init_pci: noname_init_pci, - kill_arch: common_kill_arch, pci_map_irq: p2k_map_irq, pci_swizzle: common_swizzle, @@ -467,7 +464,6 @@ struct alpha_machine_vector xl_mv __initmv = { init_irq: sio_init_irq, init_pit: common_init_pit, init_pci: noname_init_pci, - kill_arch: common_kill_arch, pci_map_irq: noname_map_irq, pci_swizzle: common_swizzle, diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c index 63a09544a..6ad08e442 100644 --- a/arch/alpha/kernel/sys_sx164.c +++ b/arch/alpha/kernel/sys_sx164.c @@ -26,7 +26,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c index 4ca18d70d..a17cd4de6 100644 --- a/arch/alpha/kernel/sys_takara.c +++ b/arch/alpha/kernel/sys_takara.c @@ -25,7 +25,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include #include "pci_impl.h" #include "machvec_impl.h" diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index f66418c6c..6e528e08f 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -40,7 +40,7 @@ #include #include "proto.h" -#include "irq_impl.h" +#include extern rwlock_t xtime_lock; extern volatile unsigned long lost_ticks; /* kernel/sched.c */ diff --git a/drivers/block/loop.c b/drivers/block/loop.c index cace2226c..3459ec1fd 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -425,7 +425,7 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg) lo->lo_flags |= LO_FLAGS_READ_ONLY; set_device_ro(dev, 1); } else { - invalidate_inode_pages (inode); + vmtruncate (inode, 0); set_device_ro(dev, 0); } diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index f21525438..8e2e4f72e 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c @@ -32,10 +32,10 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/drivers/pci/setup.c b/drivers/pci/setup.c index 022af82fe..e47380c58 100644 --- a/drivers/pci/setup.c +++ b/drivers/pci/setup.c @@ -16,8 +16,7 @@ #include #include #include - -#include +#include #define DEBUG_CONFIG 0 @@ -271,7 +270,7 @@ pci_set_bus_ranges(void) pbus_set_ranges(bus, NULL); } -static void +static void __init pdev_fixup_irq(struct pci_dev *dev, u8 (*swizzle)(struct pci_dev *, u8 *), int (*map_irq)(struct pci_dev *, u8, u8)) diff --git a/drivers/sound/trident.c b/drivers/sound/trident.c index 9092998fa..08c4acfa1 100644 --- a/drivers/sound/trident.c +++ b/drivers/sound/trident.c @@ -32,6 +32,7 @@ /*****************************************************************************/ +#include #include #include #include diff --git a/fs/dquot.c b/fs/dquot.c index a7686fe0e..1efafcf51 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -786,110 +786,113 @@ static inline void dquot_decr_blocks(struct dquot *dquot, unsigned long number) dquot->dq_flags |= DQ_MOD; } -static inline char need_print_warning(short type, uid_t initiator, struct dquot *dquot) +static inline int need_print_warning(struct dquot *dquot, int flag) { - switch (type) { + switch (dquot->dq_type) { case USRQUOTA: - return(initiator == dquot->dq_id); + return current->fsuid == dquot->dq_id && !(dquot->dq_flags & flag); case GRPQUOTA: - return(initiator == dquot->dq_id); + return in_group_p(dquot->dq_id) && !(dquot->dq_flags & flag); } - return(0); + return 0; } -static inline char ignore_hardlimit(struct dquot *dquot, uid_t initiator) +static void print_warning(struct dquot *dquot, int flag, char *fmtstr, ...) { - return(initiator == 0 && dquot->dq_mnt->mnt_dquot.rsquash[dquot->dq_type] == 0); + va_list args; + + if (!need_print_warning(dquot, flag)) + return; + va_start(args, fmtstr); + vsprintf(quotamessage, fmtstr, args); + va_end(args); + tty_write_message(current->tty, quotamessage); + dquot->dq_flags |= flag; } -static int check_idq(struct dquot *dquot, short type, u_long inodes, uid_t initiator, - struct tty_struct *tty) +static inline char ignore_hardlimit(struct dquot *dquot) { + return capable(CAP_SYS_RESOURCE) && !dquot->dq_mnt->mnt_dquot.rsquash[dquot->dq_type]; +} + +static int check_idq(struct dquot *dquot, u_long inodes) +{ + short type = dquot->dq_type; + if (inodes <= 0 || dquot->dq_flags & DQ_FAKE) - return(QUOTA_OK); + return QUOTA_OK; if (dquot->dq_ihardlimit && (dquot->dq_curinodes + inodes) > dquot->dq_ihardlimit && - !ignore_hardlimit(dquot, initiator)) { - if ((dquot->dq_flags & DQ_INODES) == 0 && - need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: write failed, %s file limit reached\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); - dquot->dq_flags |= DQ_INODES; - } - return(NO_QUOTA); + !ignore_hardlimit(dquot)) { + print_warning(dquot, DQ_INODES, "%s: write failed, %s file limit reached\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); + return NO_QUOTA; } if (dquot->dq_isoftlimit && (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit && dquot->dq_itime && CURRENT_TIME >= dquot->dq_itime && - !ignore_hardlimit(dquot, initiator)) { - if (need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: warning, %s file quota exceeded too long.\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); - } - return(NO_QUOTA); + !ignore_hardlimit(dquot)) { + print_warning(dquot, DQ_INODES, "%s: warning, %s file quota exceeded too long.\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); + return NO_QUOTA; } if (dquot->dq_isoftlimit && (dquot->dq_curinodes + inodes) > dquot->dq_isoftlimit && dquot->dq_itime == 0) { - if (need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: warning, %s file quota exceeded\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); - } + print_warning(dquot, 0, "%s: warning, %s file quota exceeded\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); dquot->dq_itime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.inode_expire[type]; } - return(QUOTA_OK); + return QUOTA_OK; } -static int check_bdq(struct dquot *dquot, short type, u_long blocks, uid_t initiator, - struct tty_struct *tty, char warn) +static int check_bdq(struct dquot *dquot, u_long blocks, char prealloc) { + short type = dquot->dq_type; + if (blocks <= 0 || dquot->dq_flags & DQ_FAKE) - return(QUOTA_OK); + return QUOTA_OK; if (dquot->dq_bhardlimit && (dquot->dq_curblocks + blocks) > dquot->dq_bhardlimit && - !ignore_hardlimit(dquot, initiator)) { - if (warn && (dquot->dq_flags & DQ_BLKS) == 0 && - need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: write failed, %s disk limit reached.\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); - dquot->dq_flags |= DQ_BLKS; - } - return(NO_QUOTA); + !ignore_hardlimit(dquot)) { + if (!prealloc) + print_warning(dquot, DQ_BLKS, "%s: write failed, %s disk limit reached.\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); + return NO_QUOTA; } if (dquot->dq_bsoftlimit && (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit && dquot->dq_btime && CURRENT_TIME >= dquot->dq_btime && - !ignore_hardlimit(dquot, initiator)) { - if (warn && need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: write failed, %s disk quota exceeded too long.\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); - } - return(NO_QUOTA); + !ignore_hardlimit(dquot)) { + if (!prealloc) + print_warning(dquot, DQ_BLKS, "%s: write failed, %s disk quota exceeded too long.\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); + return NO_QUOTA; } if (dquot->dq_bsoftlimit && (dquot->dq_curblocks + blocks) > dquot->dq_bsoftlimit && dquot->dq_btime == 0) { - if (warn && need_print_warning(type, initiator, dquot)) { - sprintf(quotamessage, "%s: warning, %s disk quota exceeded\n", - dquot->dq_mnt->mnt_dirname, quotatypes[type]); - tty_write_message(tty, quotamessage); + if (!prealloc) { + print_warning(dquot, 0, "%s: warning, %s disk quota exceeded\n", + dquot->dq_mnt->mnt_dirname, quotatypes[type]); + dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.block_expire[type]; } - dquot->dq_btime = CURRENT_TIME + dquot->dq_mnt->mnt_dquot.block_expire[type]; + else + /* + * We don't allow preallocation to exceed softlimit so exceeding will + * be always printed + */ + return NO_QUOTA; } - return(QUOTA_OK); + return QUOTA_OK; } /* @@ -1102,11 +1105,9 @@ void dquot_drop(struct inode *inode) /* * Note: this is a blocking operation. */ -int dquot_alloc_block(const struct inode *inode, unsigned long number, uid_t initiator, - char warn) +int dquot_alloc_block(const struct inode *inode, unsigned long number, char warn) { int cnt; - struct tty_struct *tty = current->tty; struct dquot *dquot[MAXQUOTAS]; for (cnt = 0; cnt < MAXQUOTAS; cnt++) { @@ -1114,7 +1115,7 @@ int dquot_alloc_block(const struct inode *inode, unsigned long number, uid_t ini if (dquot[cnt] == NODQUOT) continue; lock_dquot(dquot[cnt]); - if (check_bdq(dquot[cnt], cnt, number, initiator, tty, warn)) + if (check_bdq(dquot[cnt], number, warn)) goto put_all; } @@ -1140,10 +1141,9 @@ put_all: /* * Note: this is a blocking operation. */ -int dquot_alloc_inode(const struct inode *inode, unsigned long number, uid_t initiator) +int dquot_alloc_inode(const struct inode *inode, unsigned long number) { int cnt; - struct tty_struct *tty = current->tty; struct dquot *dquot[MAXQUOTAS]; for (cnt = 0; cnt < MAXQUOTAS; cnt++) { @@ -1151,7 +1151,7 @@ int dquot_alloc_inode(const struct inode *inode, unsigned long number, uid_t ini if (dquot[cnt] == NODQUOT) continue; lock_dquot(dquot[cnt]); - if (check_idq(dquot[cnt], cnt, number, initiator, tty)) + if (check_idq(dquot[cnt], number)) goto put_all; } @@ -1213,13 +1213,12 @@ void dquot_free_inode(const struct inode *inode, unsigned long number) * * Note: this is a blocking operation. */ -int dquot_transfer(struct dentry *dentry, struct iattr *iattr, uid_t initiator) +int dquot_transfer(struct dentry *dentry, struct iattr *iattr) { struct inode *inode = dentry -> d_inode; unsigned long blocks; struct dquot *transfer_from[MAXQUOTAS]; struct dquot *transfer_to[MAXQUOTAS]; - struct tty_struct *tty = current->tty; short cnt, disc; int error = -EDQUOT; @@ -1293,8 +1292,8 @@ int dquot_transfer(struct dentry *dentry, struct iattr *iattr, uid_t initiator) * invalidated or locked... */ if (!transfer_to[cnt]->dq_mnt || !transfer_from[cnt]->dq_mnt || - check_idq(transfer_to[cnt], cnt, 1, initiator, tty) == NO_QUOTA || - check_bdq(transfer_to[cnt], cnt, blocks, initiator, tty, 0) == NO_QUOTA) { + check_idq(transfer_to[cnt], 1) == NO_QUOTA || + check_bdq(transfer_to[cnt], blocks, 0) == NO_QUOTA) { cnt++; goto put_all; } @@ -1458,9 +1457,9 @@ out: static inline int check_quotafile_size(loff_t size) { ulong blocks = size >> BLOCK_SIZE_BITS; - size_t off = size & ~(BLOCK_SIZE - 1); + size_t off = size & (BLOCK_SIZE - 1); - return !((blocks % sizeof(struct dqblk) + off % sizeof(struct dqblk)) % sizeof(struct dqblk)); + return !(((blocks % sizeof(struct dqblk)) * BLOCK_SIZE + off % sizeof(struct dqblk)) % sizeof(struct dqblk)); } int quota_on(kdev_t dev, short type, char *path) @@ -1555,7 +1554,7 @@ asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr) break; case Q_GETQUOTA: if (((type == USRQUOTA && current->euid != id) || - (type == GRPQUOTA && in_group_p(id))) && + (type == GRPQUOTA && in_egroup_p(id))) && !capable(CAP_SYS_RESOURCE)) goto out; break; diff --git a/include/asm-alpha/cache.h b/include/asm-alpha/cache.h index b7662d726..5e46073a8 100644 --- a/include/asm-alpha/cache.h +++ b/include/asm-alpha/cache.h @@ -10,6 +10,4 @@ #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) #define SMP_CACHE_BYTES L1_CACHE_BYTES -#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) - #endif diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h index 31cdbac06..67544e13d 100644 --- a/include/asm-alpha/hardirq.h +++ b/include/asm-alpha/hardirq.h @@ -28,8 +28,8 @@ extern int __local_irq_count; #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0) #define hardirq_endlock(cpu) ((void) 0) -#define hardirq_enter(cpu, irq) (local_irq_count(cpu)++) -#define hardirq_exit(cpu, irq) (local_irq_count(cpu)--) +#define irq_enter(cpu, irq) (local_irq_count(cpu)++) +#define irq_exit(cpu, irq) (local_irq_count(cpu)--) #define synchronize_irq() barrier() @@ -52,13 +52,16 @@ static inline void release_irqlock(int cpu) } } -static inline void hardirq_enter(int cpu, int irq) +static inline void irq_enter(int cpu, int irq) { ++local_irq_count(cpu); atomic_inc(&global_irq_count); + + while (spin_is_locked(&global_irq_lock)) + barrier(); } -static inline void hardirq_exit(int cpu, int irq) +static inline void irq_exit(int cpu, int irq) { atomic_dec(&global_irq_count); --local_irq_count(cpu); @@ -66,11 +69,10 @@ static inline void hardirq_exit(int cpu, int irq) static inline int hardirq_trylock(int cpu) { - return (!atomic_read(&global_irq_count) - && !spin_is_locked(&global_irq_lock)); + return !local_irq_count(cpu) && !spin_is_locked(&global_irq_lock); } -#define hardirq_endlock(cpu) ((void)0) +#define hardirq_endlock(cpu) do { } while (0) extern void synchronize_irq(void); diff --git a/arch/alpha/kernel/irq_impl.h b/include/asm-alpha/hw_irq.h similarity index 97% rename from arch/alpha/kernel/irq_impl.h rename to include/asm-alpha/hw_irq.h index ae1d62039..c6af57999 100644 --- a/arch/alpha/kernel/irq_impl.h +++ b/include/asm-alpha/hw_irq.h @@ -1,3 +1,5 @@ +#ifndef _ALPHA_HW_IRQ_H +#define _ALPHA_HW_IRQ_H /* * linux/arch/alpha/kernel/irq.h * @@ -85,3 +87,5 @@ static inline void alpha_do_profile (unsigned long pc) atomic_inc((atomic_t *)&prof_buffer[pc]); } } + +#endif diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h index 2d1a80351..f9b4d9f12 100644 --- a/include/asm-alpha/irq.h +++ b/include/asm-alpha/irq.h @@ -67,9 +67,6 @@ extern void disable_irq(unsigned int); extern void disable_irq_nosync(unsigned int); extern void enable_irq(unsigned int); -extern void irq_enter(int cpu, int irq); -extern void irq_exit(int cpu, int irq); - struct pt_regs; extern void (*perf_irq)(unsigned long, struct pt_regs *); diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h dissimilarity index 60% index 379568491..7260b50e4 100644 --- a/include/asm-i386/cache.h +++ b/include/asm-i386/cache.h @@ -1,26 +1,14 @@ -/* - * include/asm-i386/cache.h - */ -#ifndef __ARCH_I386_CACHE_H -#define __ARCH_I386_CACHE_H - -/* bytes per L1 cache line */ -#if CPU==586 || CPU==686 -#define L1_CACHE_BYTES 32 -#else -#define L1_CACHE_BYTES 16 -#endif - -#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) - -#define SMP_CACHE_BYTES L1_CACHE_BYTES - -#ifdef MODULE -#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES))) -#else -#define __cacheline_aligned \ - __attribute__((__aligned__(L1_CACHE_BYTES), \ - __section__(".data.cacheline_aligned"))) -#endif - -#endif +/* + * include/asm-i386/cache.h + */ +#ifndef __ARCH_I386_CACHE_H +#define __ARCH_I386_CACHE_H + +/* bytes per L1 cache line */ +#if CPU==586 || CPU==686 +#define L1_CACHE_BYTES 32 +#else +#define L1_CACHE_BYTES 16 +#endif + +#endif diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h index f96faa806..4679cb3ef 100644 --- a/include/asm-i386/hardirq.h +++ b/include/asm-i386/hardirq.h @@ -17,8 +17,8 @@ extern unsigned int local_irq_count[NR_CPUS]; #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) -#define hardirq_enter(cpu) (local_irq_count[cpu]++) -#define hardirq_exit(cpu) (local_irq_count[cpu]--) +#define irq_enter(cpu, irq) (local_irq_count[cpu]++) +#define irq_exit(cpu, irq) (local_irq_count[cpu]--) #define synchronize_irq() barrier() @@ -39,13 +39,17 @@ static inline void release_irqlock(int cpu) } } -static inline void hardirq_enter(int cpu) +static inline void irq_enter(int cpu, int irq) { ++local_irq_count[cpu]; atomic_inc(&global_irq_count); + + while (test_bit(0,&global_irq_lock)) { + /* nothing */; + } } -static inline void hardirq_exit(int cpu) +static inline void irq_exit(int cpu, int irq) { atomic_dec(&global_irq_count); --local_irq_count[cpu]; diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index dad58bb93..5ee848ef3 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h @@ -40,7 +40,8 @@ * the 4 pgd entries internally, so there is no extra memory * load on TLB miss, despite one more level of indirection. */ -#define pgd_none(x) (pgd_val(x) == 1ULL) +#define EMPTY_PGD (__pa(empty_zero_page) + 1) +#define pgd_none(x) (pgd_val(x) == EMPTY_PGD) extern inline int pgd_bad(pgd_t pgd) { return 0; } extern inline int pgd_present(pgd_t pgd) { return !pgd_none(pgd); } @@ -59,7 +60,7 @@ extern inline int pgd_present(pgd_t pgd) { return !pgd_none(pgd); } */ extern inline void __pgd_clear (pgd_t * pgd) { - set_pgd(pgd, __pgd(1ULL)); + set_pgd(pgd, __pgd(EMPTY_PGD)); } extern inline void pgd_clear (pgd_t * pgd) diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index c0177923c..336c27c67 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -37,6 +37,13 @@ do { unsigned long tmpreg; __asm__ __volatile__("movl %%cr3,%0\n\tmovl %0,%%cr3" __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) #endif +/* + * ZERO_PAGE is a global shared page that is always zero: used + * for zero-mapped memory areas etc.. + */ +extern unsigned long empty_zero_page[1024]; +#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(empty_zero_page)) + #endif /* !__ASSEMBLY__ */ /* @@ -145,13 +152,6 @@ __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) extern unsigned long pg0[1024]; /* - * ZERO_PAGE is a global shared page that is always zero: used - * for zero-mapped memory areas etc.. - */ -extern unsigned long empty_zero_page[1024]; -#define ZERO_PAGE(vaddr) (mem_map + MAP_NR(empty_zero_page)) - -/* * Handling allocation failures during page table setup. */ extern void __handle_bad_pmd(pmd_t * pmd); diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 33f94edc7..e980ec02b 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -145,7 +145,7 @@ extern inline void __set_64bit (unsigned long long * ptr, __asm__ __volatile__ ( "1: movl (%0), %%eax; movl 4(%0), %%edx; - lock; cmpxchg8b (%0); + cmpxchg8b (%0); jnz 1b" :: "D"(ptr), "b"(low), diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 4e373d7d0..7b51fcb54 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include /* diff --git a/include/linux/cache.h b/include/linux/cache.h new file mode 100644 index 000000000..2030eb72b --- /dev/null +++ b/include/linux/cache.h @@ -0,0 +1,28 @@ +#ifndef __LINUX_CACHE_H +#define __LINUX_CACHE_H + +#include + +#ifndef L1_CACHE_ALIGN +#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) +#endif + +#ifndef SMP_CACHE_BYTES +#define SMP_CACHE_BYTES L1_CACHE_BYTES +#endif + +#ifndef ____cacheline_aligned +#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) +#endif + +#ifndef __cacheline_aligned +#ifdef MODULE +#define __cacheline_aligned ____cacheline_aligned +#else +#define __cacheline_aligned \ + __attribute__((__aligned__(SMP_CACHE_BYTES), \ + __section__(".data.cacheline_aligned"))) +#endif +#endif /* __cacheline_aligned */ + +#endif /* __LINUX_CACHE_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 834c4aa29..9112e5f96 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -18,10 +18,10 @@ #include #include #include +#include #include #include -#include struct poll_table_struct; @@ -674,11 +674,11 @@ struct super_operations { struct dquot_operations { void (*initialize) (struct inode *, short); void (*drop) (struct inode *); - int (*alloc_block) (const struct inode *, unsigned long, uid_t, char); - int (*alloc_inode) (const struct inode *, unsigned long, uid_t); + int (*alloc_block) (const struct inode *, unsigned long, char); + int (*alloc_inode) (const struct inode *, unsigned long); void (*free_block) (const struct inode *, unsigned long); void (*free_inode) (const struct inode *, unsigned long); - int (*transfer) (struct dentry *, struct iattr *, uid_t); + int (*transfer) (struct dentry *, struct iattr *); }; struct file_system_type { diff --git a/include/linux/irq.h b/include/linux/irq.h index 4063fe743..f8a16d730 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -42,7 +42,7 @@ typedef struct { independent code */ struct irqaction *action; /* IRQ action list */ unsigned int depth; /* Disable depth for nested irq disables */ -} irq_desc_t; +} ____cacheline_aligned irq_desc_t; #include /* the arch dependent stuff */ @@ -52,27 +52,6 @@ extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); extern spinlock_t irq_controller_lock; extern int setup_irq(unsigned int , struct irqaction * ); -#ifdef __SMP__ - -#include - -static inline void irq_enter(int cpu, unsigned int irq) -{ - hardirq_enter(cpu); - while (test_bit(0,&global_irq_lock)) { - /* nothing */; - } -} - -static inline void irq_exit(int cpu, unsigned int irq) -{ - hardirq_exit(cpu); -} -#else -#define irq_enter(cpu, irq) (++local_irq_count[cpu]) -#define irq_exit(cpu, irq) (--local_irq_count[cpu]) -#endif - extern hw_irq_controller no_irq_type; /* needed in every arch ? */ #endif /* __asm_h */ diff --git a/include/linux/quota.h b/include/linux/quota.h index de0f21dc1..ad2380019 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -44,8 +44,8 @@ /* * Convert diskblocks to blocks and the other way around. */ -#define dbtob(num) (num << 10) -#define btodb(num) (num >> 10) +#define dbtob(num) (num << BLOCK_SIZE_BITS) +#define btodb(num) (num >> BLOCK_SIZE_BITS) /* * Convert count of filesystem blocks to diskquota blocks, meant diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index bb76e715b..17371e58c 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -23,16 +23,13 @@ extern void invalidate_dquots(kdev_t dev, short type); extern int quota_off(kdev_t dev, short type); extern int sync_dquots(kdev_t dev, short type); -extern int dquot_alloc_block(const struct inode *inode, unsigned long number, - uid_t initiator, char warn); -extern int dquot_alloc_inode(const struct inode *inode, unsigned long number, - uid_t initiator); +extern int dquot_alloc_block(const struct inode *inode, unsigned long number, char prealloc); +extern int dquot_alloc_inode(const struct inode *inode, unsigned long number); extern void dquot_free_block(const struct inode *inode, unsigned long number); extern void dquot_free_inode(const struct inode *inode, unsigned long number); -extern int dquot_transfer(struct dentry *dentry, struct iattr *iattr, - uid_t initiator); +extern int dquot_transfer(struct dentry *dentry, struct iattr *iattr); /* * Operations supported for diskquotas. @@ -54,8 +51,7 @@ extern __inline__ void DQUOT_DROP(struct inode *inode) extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr) { if (sb->dq_op) { - if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), - current->fsuid, 0) == NO_QUOTA) + if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 1) == NO_QUOTA) return 1; } return 0; @@ -64,8 +60,7 @@ extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct inode *inode, int nr) { if (sb->dq_op) { - if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), - current->fsuid, 1) == NO_QUOTA) + if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize), 0) == NO_QUOTA) return 1; } return 0; @@ -75,7 +70,7 @@ extern __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode *in { if (sb->dq_op) { sb->dq_op->initialize (inode, -1); - if (sb->dq_op->alloc_inode (inode, 1, current->fsuid)) + if (sb->dq_op->alloc_inode (inode, 1)) return 1; } inode->i_flags |= S_QUOTA; @@ -100,7 +95,7 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr) if (dentry->d_inode->i_sb->dq_op) { dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1); - error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr, current->fsuid); + error = dentry->d_inode->i_sb->dq_op->transfer(dentry, iattr); } else { error = notify_change(dentry, iattr); } diff --git a/include/linux/sched.h b/include/linux/sched.h index 72ae514ee..36590d49c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -513,6 +513,7 @@ extern void FASTCALL(wake_up_process(struct task_struct * tsk)); #define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE) extern int in_group_p(gid_t); +extern int in_egroup_p(gid_t); extern void flush_signals(struct task_struct *); extern void flush_signal_handlers(struct task_struct *); diff --git a/include/linux/slab.h b/include/linux/slab.h index fa344d816..97f6923da 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -12,7 +12,7 @@ typedef struct kmem_cache_s kmem_cache_t; #include -#include +#include /* flags for kmem_cache_alloc() */ #define SLAB_BUFFER GFP_BUFFER diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 23be26489..fa69edbac 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -355,7 +355,7 @@ extern asmlinkage long sys_sysctl(struct __sysctl_args *args) } /* Like in_group_p, but testing against egid, not fsgid */ -static int in_egroup_p(gid_t grp) +int in_egroup_p(gid_t grp) { if (grp != current->egid) { int i = current->ngroups; diff --git a/mm/filemap.c b/mm/filemap.c index 2a3380504..32e76e13e 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -303,7 +303,6 @@ int shrink_mmap(int priority, int gfp_mask) /* is it a page-cache page? */ if (page->mapping) { - dispose = &old; if (!pgcache_under_min()) { remove_page_from_inode_queue(page); diff --git a/net/khttpd/datasending.c b/net/khttpd/datasending.c index d435af64d..7a1afc1df 100644 --- a/net/khttpd/datasending.c +++ b/net/khttpd/datasending.c @@ -55,16 +55,23 @@ This send_actor is for use with do_generic_file_read (ie sendfile()) It sends the data to the socket indicated by desc->buf. */ -static int sock_send_actor(read_descriptor_t * desc, const char *area, unsigned long size) +static int sock_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size) { int written; + unsigned long kaddr; unsigned long count = desc->count; struct socket *sock = (struct socket *) desc->buf; + mm_segment_t old_fs; if (size > count) size = count; - written = SendBuffer_async(sock,(char *)area,size); + old_fs = get_fs(); + set_fs(KERNEL_DS); + kaddr = kmap(page); + written = SendBuffer_async(sock,(char *)kaddr + offset,size); + kunmap(page); + set_fs(old_fs); if (written < 0) { desc->error = written; written = 0; diff --git a/net/khttpd/main.c b/net/khttpd/main.c index 5746bc4f7..418037907 100644 --- a/net/khttpd/main.c +++ b/net/khttpd/main.c @@ -50,6 +50,10 @@ Userspace * ****************************************************************/ + +static int errno; +#define __KERNEL_SYSCALLS__ + #include #include #include @@ -176,9 +180,6 @@ static int MainDaemon(void *cpu_pointer) static int CountBuf[CONFIG_KHTTPD_NUMCPU]; -static int errno; -inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options); - /* diff --git a/scripts/Menuconfig b/scripts/Menuconfig index f7e3ef118..824d44014 100644 --- a/scripts/Menuconfig +++ b/scripts/Menuconfig @@ -54,7 +54,7 @@ # Change a lot of places to call set_x_info uniformly. # Take out message about preparing version (old sound driver cruft). # -# 13 Dec 1998, Riley H Williams (rhw@bigfoot.com) +# 13 Dec 1998, Riley H Williams # When an error occurs, actually display the error message as well as # our comments thereon. # -- 2.11.4.GIT