Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 13 Nov 2006 16:20:38 +0000 (08:20 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 13 Nov 2006 16:20:38 +0000 (08:20 -0800)
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] cell: set ARCH_SPARSEMEM_DEFAULT in Kconfig
  [POWERPC] Fix cell "new style" mapping and add debug
  [POWERPC] pseries: Force 4k update_flash block and list sizes
  [POWERPC] CPM_UART: Fix non-console initialisation
  [POWERPC] CPM_UART: Fix non-console transmit
  [POWERPC] Make sure initrd and dtb sections get into zImage correctly

75 files changed:
.gitignore
CREDITS
Documentation/feature-removal-schedule.txt
Documentation/memory-barriers.txt
MAINTAINERS
arch/i386/kernel/io_apic.c
arch/i386/kernel/kprobes.c
arch/i386/kernel/microcode.c
arch/i386/kernel/vmlinux.lds.S
arch/i386/pci/mmconfig.c
arch/ia64/Kconfig
arch/x86_64/kernel/io_apic.c
drivers/char/Kconfig
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/mspec.c
drivers/infiniband/hw/ipath/ipath_driver.c
drivers/infiniband/hw/ipath/ipath_iba6110.c
drivers/infiniband/hw/ipath/ipath_iba6120.c
drivers/infiniband/hw/ipath/ipath_intr.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/md/dm-ioctl.c
drivers/md/dm-raid1.c
drivers/md/dm-round-robin.c
drivers/md/dm.c
drivers/md/md.c
drivers/md/raid5.c
drivers/net/arcnet/com20020.c
drivers/net/bonding/bond_main.c
drivers/net/cris/eth_v10.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
drivers/pci/htirq.c
drivers/pci/pci-sysfs.c
drivers/scsi/scsi_scan.c
drivers/telephony/ixj.h
drivers/video/nvidia/nv_hw.c
drivers/video/nvidia/nv_setup.c
drivers/video/nvidia/nv_type.h
drivers/video/nvidia/nvidia.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/sess.c
fs/nfsd/nfs3proc.c
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c
fs/xfs/Makefile-linux-2.6
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_dmapi_priv.h [new file with mode: 0644]
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/support/debug.c
fs/xfs/support/move.c
fs/xfs/support/move.h
fs/xfs/xfs.h
fs/xfs/xfs_dir2.c
fs/xfs/xfs_dmapi.h
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_vnodeops.c
include/asm-ia64/sn/addrs.h
include/linux/htirq.h
include/linux/ipmi_msgdefs.h
include/linux/nfsd/nfsd.h
include/linux/personality.h
include/linux/vmalloc.h
include/net/ip_vs.h
init/Kconfig
kernel/fork.c
kernel/irq/spurious.c
mm/vmalloc.c
net/ipv4/ipvs/ip_vs_ftp.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/ipvs/ip_vs_proto_udp.c
scripts/kconfig/.gitignore

index e1d5c17c12c22663d9df80925e4b7872bd53d6aa..9eb4b77114994877b247c1d165f3920f680cc7e6 100644 (file)
@@ -20,6 +20,7 @@
 # Top-level generic files
 #
 tags
+TAGS
 vmlinux*
 System.map
 Module.symvers
diff --git a/CREDITS b/CREDITS
index 5329ead9c672f3f3f4a891c9d00929ca2af434f1..606d407cfc1565c1715912142e251289fb88d332 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -45,7 +45,7 @@ S: Longford, Ireland
 S: Sydney, Australia
 
 N: Tigran A. Aivazian
-E: tigran@veritas.com
+E: tigran@aivazian.fsnet.co.uk
 W: http://www.moses.uklinux.net/patches
 D: BFS filesystem
 D: Intel IA32 CPU microcode update support
index 1ac3c74646e3fc29fac85e767eaec8ad4e350330..d52c4aaaf17f19cb2cdd59427f880bcaec5af51b 100644 (file)
@@ -53,18 +53,6 @@ Who: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
 
 ---------------------------
 
-What:  sys_sysctl
-When:  January 2007
-Why:   The same information is available through /proc/sys and that is the
-       interface user space prefers to use. And there do not appear to be
-       any existing user in user space of sys_sysctl.  The additional
-       maintenance overhead of keeping a set of binary names gets
-       in the way of doing a good job of maintaining this interface.
-
-Who:   Eric Biederman <ebiederm@xmission.com>
-
----------------------------
-
 What:  PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
 When:  November 2005
 Files: drivers/pcmcia/: pcmcia_ioctl.c
index 7f790f66ec68528776852d15a3f60ab60dcd94b6..7751704b6db1418e6eb3ecb7a273b34730f66fac 100644 (file)
@@ -1016,7 +1016,7 @@ There are some more advanced barrier functions:
 
  (*) set_mb(var, value)
 
-     This assigns the value to the variable and then inserts at least a write
+     This assigns the value to the variable and then inserts a full memory
      barrier after it, depending on the function.  It isn't guaranteed to
      insert anything more than a compiler barrier in a UP compilation.
 
index d708702aba2f292b83bc62fb20274d18f3389716..8732daeae3038328772e410d951cceb85bae1731 100644 (file)
@@ -493,7 +493,7 @@ S:  Maintained
 
 BFS FILE SYSTEM
 P:     Tigran A. Aivazian
-M:     tigran@veritas.com
+M:     tigran@aivazian.fsnet.co.uk
 L:     linux-kernel@vger.kernel.org
 S:     Maintained
 
@@ -1513,7 +1513,7 @@ S:        Maintained
 
 INTEL IA32 MICROCODE UPDATE SUPPORT
 P:     Tigran Aivazian
-M:     tigran@veritas.com
+M:     tigran@aivazian.fsnet.co.uk
 S:     Maintained
 
 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
index 507983c513c34b60f97049eac72c8f4e2b41bea9..ad84bc2802a6a2900b4bb2f4bc3c61fad8332948 100644 (file)
@@ -2624,18 +2624,16 @@ void arch_teardown_msi_irq(unsigned int irq)
 
 static void target_ht_irq(unsigned int irq, unsigned int dest)
 {
-       u32 low, high;
-       low  = read_ht_irq_low(irq);
-       high = read_ht_irq_high(irq);
+       struct ht_irq_msg msg;
+       fetch_ht_irq_msg(irq, &msg);
 
-       low  &= ~(HT_IRQ_LOW_DEST_ID_MASK);
-       high &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
+       msg.address_lo &= ~(HT_IRQ_LOW_DEST_ID_MASK);
+       msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
 
-       low  |= HT_IRQ_LOW_DEST_ID(dest);
-       high |= HT_IRQ_HIGH_DEST_ID(dest);
+       msg.address_lo |= HT_IRQ_LOW_DEST_ID(dest);
+       msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest);
 
-       write_ht_irq_low(irq, low);
-       write_ht_irq_high(irq, high);
+       write_ht_irq_msg(irq, &msg);
 }
 
 static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
@@ -2673,7 +2671,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
 
        vector = assign_irq_vector(irq);
        if (vector >= 0) {
-               u32 low, high;
+               struct ht_irq_msg msg;
                unsigned dest;
                cpumask_t tmp;
 
@@ -2681,9 +2679,10 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                cpu_set(vector >> 8, tmp);
                dest = cpu_mask_to_apicid(tmp);
 
-               high =  HT_IRQ_HIGH_DEST_ID(dest);
+               msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
 
-               low =   HT_IRQ_LOW_BASE |
+               msg.address_lo =
+                       HT_IRQ_LOW_BASE |
                        HT_IRQ_LOW_DEST_ID(dest) |
                        HT_IRQ_LOW_VECTOR(vector) |
                        ((INT_DEST_MODE == 0) ?
@@ -2695,8 +2694,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                                HT_IRQ_LOW_MT_ARBITRATED) |
                        HT_IRQ_LOW_IRQ_MASKED;
 
-               write_ht_irq_low(irq, low);
-               write_ht_irq_high(irq, high);
+               write_ht_irq_msg(irq, &msg);
 
                set_irq_chip_and_handler_name(irq, &ht_irq_chip,
                                              handle_edge_irq, "edge");
index d98e44b16fe20fa1edbda6d0246bc95b3a49cede..fc79e1e859c498a9d640ba40fcff7494fe6110b6 100644 (file)
@@ -361,8 +361,11 @@ no_kprobe:
        asm volatile ( ".global kretprobe_trampoline\n"
                        "kretprobe_trampoline: \n"
                        "       pushf\n"
-                       /* skip cs, eip, orig_eax, es, ds */
-                       "       subl $20, %esp\n"
+                       /* skip cs, eip, orig_eax */
+                       "       subl $12, %esp\n"
+                       "       pushl %gs\n"
+                       "       pushl %ds\n"
+                       "       pushl %es\n"
                        "       pushl %eax\n"
                        "       pushl %ebp\n"
                        "       pushl %edi\n"
@@ -373,10 +376,10 @@ no_kprobe:
                        "       movl %esp, %eax\n"
                        "       call trampoline_handler\n"
                        /* move eflags to cs */
-                       "       movl 48(%esp), %edx\n"
-                       "       movl %edx, 44(%esp)\n"
+                       "       movl 52(%esp), %edx\n"
+                       "       movl %edx, 48(%esp)\n"
                        /* save true return address on eflags */
-                       "       movl %eax, 48(%esp)\n"
+                       "       movl %eax, 52(%esp)\n"
                        "       popl %ebx\n"
                        "       popl %ecx\n"
                        "       popl %edx\n"
@@ -384,8 +387,8 @@ no_kprobe:
                        "       popl %edi\n"
                        "       popl %ebp\n"
                        "       popl %eax\n"
-                       /* skip eip, orig_eax, es, ds */
-                       "       addl $16, %esp\n"
+                       /* skip eip, orig_eax, es, ds, gs */
+                       "       addl $20, %esp\n"
                        "       popf\n"
                        "       ret\n");
 }
@@ -404,6 +407,10 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
        INIT_HLIST_HEAD(&empty_rp);
        spin_lock_irqsave(&kretprobe_lock, flags);
        head = kretprobe_inst_table_head(current);
+       /* fixup registers */
+       regs->xcs = __KERNEL_CS;
+       regs->eip = trampoline_address;
+       regs->orig_eax = 0xffffffff;
 
        /*
         * It is possible to have multiple instances associated with a given
@@ -425,6 +432,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
 
                if (ri->rp && ri->rp->handler){
                        __get_cpu_var(current_kprobe) = &ri->rp->kp;
+                       get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
                        ri->rp->handler(ri, regs);
                        __get_cpu_var(current_kprobe) = NULL;
                }
index c4d0291b519f836db7cfaccdfb8f375ffb0751ea..23f5984d06540f9c42183b232ad98e488b5218ae 100644 (file)
@@ -577,7 +577,7 @@ static void microcode_init_cpu(int cpu)
        set_cpus_allowed(current, cpumask_of_cpu(cpu));
        mutex_lock(&microcode_mutex);
        collect_cpu_info(cpu);
-       if (uci->valid)
+       if (uci->valid && system_state == SYSTEM_RUNNING)
                cpu_request_microcode(cpu);
        mutex_unlock(&microcode_mutex);
        set_cpus_allowed(current, old);
index adc1f232afeeddad4e92b8ee26412440966aef4d..c6f84a0322ba30438dda746a630ef68e4ace7306 100644 (file)
@@ -51,6 +51,7 @@ SECTIONS
   __tracedata_end = .;
 
   /* writeable */
+  . = ALIGN(4096);
   .data : AT(ADDR(.data) - LOAD_OFFSET) {      /* Data */
        *(.data)
        CONSTRUCTORS
index d0c3da3aa2aa9978eef4774c4a61ec97955e2df3..c6b6d9bbc453834f0c6e17508e741d521144bd6f 100644 (file)
@@ -154,38 +154,6 @@ static struct pci_raw_ops pci_mmcfg = {
        .write =        pci_mmcfg_write,
 };
 
-
-static __init void pci_mmcfg_insert_resources(void)
-{
-#define PCI_MMCFG_RESOURCE_NAME_LEN 19
-       int i;
-       struct resource *res;
-       char *names;
-       unsigned num_buses;
-
-       res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res),
-                       pci_mmcfg_config_num, GFP_KERNEL);
-
-       if (!res) {
-               printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n");
-               return;
-       }
-
-       names = (void *)&res[pci_mmcfg_config_num];
-       for (i = 0; i < pci_mmcfg_config_num; i++, res++) {
-               num_buses = pci_mmcfg_config[i].end_bus_number -
-                   pci_mmcfg_config[i].start_bus_number + 1;
-               res->name = names;
-               snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u",
-                       pci_mmcfg_config[i].pci_segment_group_number);
-               res->start = pci_mmcfg_config[i].base_address;
-               res->end = res->start + (num_buses << 20) - 1;
-               res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-               insert_resource(&iomem_resource, res);
-               names += PCI_MMCFG_RESOURCE_NAME_LEN;
-       }
-}
-
 /* K8 systems have some devices (typically in the builtin northbridge)
    that are only accessible using type1
    Normally this can be expressed in the MCFG by not listing them
@@ -222,8 +190,6 @@ static __init void unreachable_devices(void)
        }
 }
 
-
-
 void __init pci_mmcfg_init(int type)
 {
        if ((pci_probe & PCI_PROBE_MMCONF) == 0)
@@ -251,5 +217,4 @@ void __init pci_mmcfg_init(int type)
        pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
 
        unreachable_devices();
-       pci_mmcfg_insert_resources();
 }
index 70f7eb9fed3562aaa9e072376fb3efd759d7b28e..683b12c6f76cafd6930787bb8663c5face2bb5a2 100644 (file)
@@ -341,6 +341,7 @@ config NUMA
        bool "NUMA support"
        depends on !IA64_HP_SIM && !FLATMEM
        default y if IA64_SGI_SN2
+       select ACPI_NUMA if ACPI
        help
          Say Y to compile the kernel to support NUMA (Non-Uniform Memory
          Access).  This option is for configuring high-end multiprocessor
@@ -483,6 +484,15 @@ source "net/Kconfig"
 
 source "drivers/Kconfig"
 
+config MSPEC
+       tristate "Memory special operations driver"
+       depends on IA64
+       select IA64_UNCACHED_ALLOCATOR
+       help
+         If you have an ia64 and you want to enable memory special
+         operations support (formerly known as fetchop), say Y here,
+         otherwise say N.
+
 source "fs/Kconfig"
 
 source "lib/Kconfig"
index 3b8f9c68ad3c1db9c5e60048d57ad6af19ab684d..41bfc49301ad139cd32583d8b542a1dbc482fe08 100644 (file)
@@ -1955,18 +1955,16 @@ void arch_teardown_msi_irq(unsigned int irq)
 
 static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector)
 {
-       u32 low, high;
-       low  = read_ht_irq_low(irq);
-       high = read_ht_irq_high(irq);
+       struct ht_irq_msg msg;
+       fetch_ht_irq_msg(irq, &msg);
 
-       low  &= ~(HT_IRQ_LOW_VECTOR_MASK | HT_IRQ_LOW_DEST_ID_MASK);
-       high &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
+       msg.address_lo &= ~(HT_IRQ_LOW_VECTOR_MASK | HT_IRQ_LOW_DEST_ID_MASK);
+       msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK);
 
-       low  |= HT_IRQ_LOW_VECTOR(vector) | HT_IRQ_LOW_DEST_ID(dest);
-       high |= HT_IRQ_HIGH_DEST_ID(dest);
+       msg.address_lo |= HT_IRQ_LOW_VECTOR(vector) | HT_IRQ_LOW_DEST_ID(dest);
+       msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest);
 
-       write_ht_irq_low(irq, low);
-       write_ht_irq_high(irq, high);
+       write_ht_irq_msg(irq, &msg);
 }
 
 static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
@@ -1987,7 +1985,7 @@ static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
 
        dest = cpu_mask_to_apicid(tmp);
 
-       target_ht_irq(irq, dest, vector & 0xff);
+       target_ht_irq(irq, dest, vector);
        set_native_irq_info(irq, mask);
 }
 #endif
@@ -2010,14 +2008,15 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
 
        vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
        if (vector >= 0) {
-               u32 low, high;
+               struct ht_irq_msg msg;
                unsigned dest;
 
                dest = cpu_mask_to_apicid(tmp);
 
-               high =  HT_IRQ_HIGH_DEST_ID(dest);
+               msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
 
-               low =   HT_IRQ_LOW_BASE |
+               msg.address_lo =
+                       HT_IRQ_LOW_BASE |
                        HT_IRQ_LOW_DEST_ID(dest) |
                        HT_IRQ_LOW_VECTOR(vector) |
                        ((INT_DEST_MODE == 0) ?
@@ -2026,10 +2025,10 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
                        HT_IRQ_LOW_RQEOI_EDGE |
                        ((INT_DELIVERY_MODE != dest_LowestPrio) ?
                                HT_IRQ_LOW_MT_FIXED :
-                               HT_IRQ_LOW_MT_ARBITRATED);
+                               HT_IRQ_LOW_MT_ARBITRATED) |
+                       HT_IRQ_LOW_IRQ_MASKED;
 
-               write_ht_irq_low(irq, low);
-               write_ht_irq_high(irq, high);
+               write_ht_irq_msg(irq, &msg);
 
                set_irq_chip_and_handler_name(irq, &ht_irq_chip,
                                              handle_edge_irq, "edge");
index 39a9f8cc6412a0faa1ed80df4ff12fbf56693f91..2af12fc4511585d4f7aab36b863378eff152764a 100644 (file)
@@ -409,14 +409,6 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
-config MSPEC
-       tristate "Memory special operations driver"
-       depends on IA64
-       help
-         If you have an ia64 and you want to enable memory special
-         operations support (formerly known as fetchop), say Y here,
-         otherwise say N.
-
 source "drivers/serial/Kconfig"
 
 config UNIX98_PTYS
index 34a4fd13fa817ec0241a05157593872716b49600..a41b8df240730f8a2fd89219fcc6b3c6100119b1 100644 (file)
@@ -376,13 +376,23 @@ static void free_recv_msg_list(struct list_head *q)
        }
 }
 
+static void free_smi_msg_list(struct list_head *q)
+{
+       struct ipmi_smi_msg *msg, *msg2;
+
+       list_for_each_entry_safe(msg, msg2, q, link) {
+               list_del(&msg->link);
+               ipmi_free_smi_msg(msg);
+       }
+}
+
 static void clean_up_interface_data(ipmi_smi_t intf)
 {
        int              i;
        struct cmd_rcvr  *rcvr, *rcvr2;
        struct list_head list;
 
-       free_recv_msg_list(&intf->waiting_msgs);
+       free_smi_msg_list(&intf->waiting_msgs);
        free_recv_msg_list(&intf->waiting_events);
 
        /* Wholesale remove all the entries from the list in the
@@ -1844,7 +1854,7 @@ static ssize_t provides_dev_sdrs_show(struct device *dev,
        struct bmc_device *bmc = dev_get_drvdata(dev);
 
        return snprintf(buf, 10, "%u\n",
-                       bmc->id.device_revision && 0x80 >> 7);
+                       (bmc->id.device_revision & 0x80) >> 7);
 }
 
 static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
@@ -1853,7 +1863,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
        struct bmc_device *bmc = dev_get_drvdata(dev);
 
        return snprintf(buf, 20, "%u\n",
-                       bmc->id.device_revision && 0x0F);
+                       bmc->id.device_revision & 0x0F);
 }
 
 static ssize_t firmware_rev_show(struct device *dev,
@@ -3232,7 +3242,9 @@ void ipmi_smi_msg_received(ipmi_smi_t          intf,
                    report the error immediately. */
                if ((msg->rsp_size >= 3) && (msg->rsp[2] != 0)
                    && (msg->rsp[2] != IPMI_NODE_BUSY_ERR)
-                   && (msg->rsp[2] != IPMI_LOST_ARBITRATION_ERR))
+                   && (msg->rsp[2] != IPMI_LOST_ARBITRATION_ERR)
+                   && (msg->rsp[2] != IPMI_BUS_ERR)
+                   && (msg->rsp[2] != IPMI_NAK_ON_WRITE_ERR))
                {
                        int chan = msg->rsp[3] & 0xf;
 
index 157fa81a264f58396a4852453e6e2ec950b61a77..abc5149e30e820c6e41c6c3477c2071f946e777c 100644 (file)
@@ -1211,7 +1211,7 @@ static void intf_mem_outb(struct si_sm_io *io, unsigned int offset,
 static unsigned char intf_mem_inw(struct si_sm_io *io, unsigned int offset)
 {
        return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift)
-               && 0xff;
+               & 0xff;
 }
 
 static void intf_mem_outw(struct si_sm_io *io, unsigned int offset,
@@ -1223,7 +1223,7 @@ static void intf_mem_outw(struct si_sm_io *io, unsigned int offset,
 static unsigned char intf_mem_inl(struct si_sm_io *io, unsigned int offset)
 {
        return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift)
-               && 0xff;
+               & 0xff;
 }
 
 static void intf_mem_outl(struct si_sm_io *io, unsigned int offset,
@@ -1236,7 +1236,7 @@ static void intf_mem_outl(struct si_sm_io *io, unsigned int offset,
 static unsigned char mem_inq(struct si_sm_io *io, unsigned int offset)
 {
        return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift)
-               && 0xff;
+               & 0xff;
 }
 
 static void mem_outq(struct si_sm_io *io, unsigned int offset,
index 5c0dec39cf6c66998cdd9b65205a78882587b0a0..235e892261124d81c7c131e06f30bc4b713ad558 100644 (file)
@@ -72,7 +72,11 @@ enum {
        MSPEC_UNCACHED
 };
 
+#ifdef CONFIG_SGI_SN
 static int is_sn2;
+#else
+#define is_sn2         0
+#endif
 
 /*
  * One of these structures is allocated when an mspec region is mmaped. The
@@ -211,7 +215,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
        if (vdata->type == MSPEC_FETCHOP)
                paddr = TO_AMO(maddr);
        else
-               paddr = __pa(TO_CAC(maddr));
+               paddr = maddr & ~__IA64_UNCACHED_OFFSET;
 
        pfn = paddr >> PAGE_SHIFT;
 
@@ -335,6 +339,7 @@ mspec_init(void)
         * The fetchop device only works on SN2 hardware, uncached and cached
         * memory drivers should both be valid on all ia64 hardware
         */
+#ifdef CONFIG_SGI_SN
        if (ia64_platform_is("sn2")) {
                is_sn2 = 1;
                if (is_shub2()) {
@@ -363,6 +368,7 @@ mspec_init(void)
                        goto free_scratch_pages;
                }
        }
+#endif
        ret = misc_register(&cached_miscdev);
        if (ret) {
                printk(KERN_ERR "%s: failed to register device %i\n",
index b4ffaa7bcbb752467591e384d052041fcdf1b2f4..09a13c1fc46aa75c56955afaeccfb2e9358821d6 100644 (file)
@@ -304,7 +304,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
        }
        addr = pci_resource_start(pdev, 0);
        len = pci_resource_len(pdev, 0);
-       ipath_cdbg(VERBOSE, "regbase (0) %llx len %d irq %x, vend %x/%x "
+       ipath_cdbg(VERBOSE, "regbase (0) %llx len %d pdev->irq %d, vend %x/%x "
                   "driver_data %lx\n", addr, len, pdev->irq, ent->vendor,
                   ent->device, ent->driver_data);
 
@@ -467,15 +467,15 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
         * check 0 irq after we return from chip-specific bus setup, since
         * that can affect this due to setup
         */
-       if (!pdev->irq)
+       if (!dd->ipath_irq)
                ipath_dev_err(dd, "irq is 0, BIOS error?  Interrupts won't "
                              "work\n");
        else {
-               ret = request_irq(pdev->irq, ipath_intr, IRQF_SHARED,
+               ret = request_irq(dd->ipath_irq, ipath_intr, IRQF_SHARED,
                                  IPATH_DRV_NAME, dd);
                if (ret) {
                        ipath_dev_err(dd, "Couldn't setup irq handler, "
-                                     "irq=%u: %d\n", pdev->irq, ret);
+                                     "irq=%d: %d\n", dd->ipath_irq, ret);
                        goto bail_iounmap;
                }
        }
@@ -637,11 +637,10 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
         * free up port 0 (kernel) rcvhdr, egr bufs, and eventually tid bufs
         * for all versions of the driver, if they were allocated
         */
-       if (pdev->irq) {
-               ipath_cdbg(VERBOSE,
-                          "unit %u free_irq of irq %x\n",
-                          dd->ipath_unit, pdev->irq);
-               free_irq(pdev->irq, dd);
+       if (dd->ipath_irq) {
+               ipath_cdbg(VERBOSE, "unit %u free irq %d\n",
+                          dd->ipath_unit, dd->ipath_irq);
+               dd->ipath_f_free_irq(dd);
        } else
                ipath_dbg("irq is 0, not doing free_irq "
                          "for unit %u\n", dd->ipath_unit);
index 9e4e8d4c6e2035769ddef2a080a1f7163bef8678..e57c7a351cb5dcb1c4dd0ac6f2cefece2fb332e0 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <linux/pci.h>
 #include <linux/delay.h>
+#include <linux/htirq.h>
 
 #include "ipath_kernel.h"
 #include "ipath_registers.h"
@@ -913,49 +914,40 @@ static void slave_or_pri_blk(struct ipath_devdata *dd, struct pci_dev *pdev,
        }
 }
 
-static int set_int_handler(struct ipath_devdata *dd, struct pci_dev *pdev,
-                           int pos)
+static int ipath_ht_intconfig(struct ipath_devdata *dd)
 {
-       u32 int_handler_addr_lower;
-       u32 int_handler_addr_upper;
-       u64 ihandler;
-       u32 intvec;
+       int ret;
 
-       /* use indirection register to get the intr handler */
-       pci_write_config_byte(pdev, pos + HT_INTR_REG_INDEX, 0x10);
-       pci_read_config_dword(pdev, pos + 4, &int_handler_addr_lower);
-       pci_write_config_byte(pdev, pos + HT_INTR_REG_INDEX, 0x11);
-       pci_read_config_dword(pdev, pos + 4, &int_handler_addr_upper);
+       if (dd->ipath_intconfig) {
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_interruptconfig,
+                                dd->ipath_intconfig);  /* interrupt address */
+               ret = 0;
+       } else {
+               ipath_dev_err(dd, "No interrupts enabled, couldn't setup "
+                             "interrupt address\n");
+               ret = -EINVAL;
+       }
 
-       ihandler = (u64) int_handler_addr_lower |
-               ((u64) int_handler_addr_upper << 32);
+       return ret;
+}
+
+static void ipath_ht_irq_update(struct pci_dev *dev, int irq,
+                               struct ht_irq_msg *msg)
+{
+       struct ipath_devdata *dd = pci_get_drvdata(dev);
+       u64 prev_intconfig = dd->ipath_intconfig;
+
+       dd->ipath_intconfig = msg->address_lo;
+       dd->ipath_intconfig |= ((u64) msg->address_hi) << 32;
 
        /*
-        * kernels with CONFIG_PCI_MSI set the vector in the irq field of
-        * struct pci_device, so we use that to program the internal
-        * interrupt register (not config space) with that value. The BIOS
-        * must still have done the basic MSI setup.
-        */
-       intvec = pdev->irq;
-       /*
-        * clear any vector bits there; normally not set but we'll overload
-        * this for some debug purposes (setting the HTC debug register
-        * value from software, rather than GPIOs), so it might be set on a
-        * driver reload.
+        * If the previous value of dd->ipath_intconfig is zero, we're
+        * getting configured for the first time, and must not program the
+        * intconfig register here (it will be programmed later, when the
+        * hardware is ready).  Otherwise, we should.
         */
-       ihandler &= ~0xff0000;
-       /* x86 vector goes in intrinfo[23:16] */
-       ihandler |= intvec << 16;
-       ipath_cdbg(VERBOSE, "ihandler lower %x, upper %x, intvec %x, "
-                  "interruptconfig %llx\n", int_handler_addr_lower,
-                  int_handler_addr_upper, intvec,
-                  (unsigned long long) ihandler);
-
-       /* can't program yet, so save for interrupt setup */
-       dd->ipath_intconfig = ihandler;
-       /* keep going, so we find link control stuff also */
-
-       return ihandler != 0;
+       if (prev_intconfig)
+               ipath_ht_intconfig(dd);
 }
 
 /**
@@ -971,12 +963,19 @@ static int set_int_handler(struct ipath_devdata *dd, struct pci_dev *pdev,
 static int ipath_setup_ht_config(struct ipath_devdata *dd,
                                 struct pci_dev *pdev)
 {
-       int pos, ret = 0;
-       int ihandler = 0;
+       int pos, ret;
+
+       ret = __ht_create_irq(pdev, 0, ipath_ht_irq_update);
+       if (ret < 0) {
+               ipath_dev_err(dd, "Couldn't create interrupt handler: "
+                             "err %d\n", ret);
+               goto bail;
+       }
+       dd->ipath_irq = ret;
+       ret = 0;
 
        /*
-        * Read the capability info to find the interrupt info, and also
-        * handle clearing CRC errors in linkctrl register if necessary.  We
+        * Handle clearing CRC errors in linkctrl register if necessary.  We
         * do this early, before we ever enable errors or hardware errors,
         * mostly to avoid causing the chip to enter freeze mode.
         */
@@ -1000,17 +999,9 @@ static int ipath_setup_ht_config(struct ipath_devdata *dd,
                }
                if (!(cap_type & 0xE0))
                        slave_or_pri_blk(dd, pdev, pos, cap_type);
-               else if (cap_type == HT_INTR_DISC_CONFIG)
-                       ihandler = set_int_handler(dd, pdev, pos);
        } while ((pos = pci_find_next_capability(pdev, pos,
                                                 PCI_CAP_ID_HT)));
 
-       if (!ihandler) {
-               ipath_dev_err(dd, "Couldn't find interrupt handler in "
-                             "config space\n");
-               ret = -ENODEV;
-       }
-
 bail:
        return ret;
 }
@@ -1360,25 +1351,6 @@ static void ipath_ht_quiet_serdes(struct ipath_devdata *dd)
        ipath_write_kreg(dd, dd->ipath_kregs->kr_serdesconfig0, val);
 }
 
-static int ipath_ht_intconfig(struct ipath_devdata *dd)
-{
-       int ret;
-
-       if (!dd->ipath_intconfig) {
-               ipath_dev_err(dd, "No interrupts enabled, couldn't setup "
-                             "interrupt address\n");
-               ret = 1;
-               goto bail;
-       }
-
-       ipath_write_kreg(dd, dd->ipath_kregs->kr_interruptconfig,
-                        dd->ipath_intconfig);  /* interrupt address */
-       ret = 0;
-
-bail:
-       return ret;
-}
-
 /**
  * ipath_pe_put_tid - write a TID in chip
  * @dd: the infinipath device
@@ -1575,6 +1547,14 @@ static int ipath_ht_get_base_info(struct ipath_portdata *pd, void *kbase)
        return 0;
 }
 
+static void ipath_ht_free_irq(struct ipath_devdata *dd)
+{
+       free_irq(dd->ipath_irq, dd);
+       ht_destroy_irq(dd->ipath_irq);
+       dd->ipath_irq = 0;
+       dd->ipath_intconfig = 0;
+}
+
 /**
  * ipath_init_iba6110_funcs - set up the chip-specific function pointers
  * @dd: the infinipath device
@@ -1598,6 +1578,7 @@ void ipath_init_iba6110_funcs(struct ipath_devdata *dd)
        dd->ipath_f_cleanup = ipath_setup_ht_cleanup;
        dd->ipath_f_setextled = ipath_setup_ht_setextled;
        dd->ipath_f_get_base_info = ipath_ht_get_base_info;
+       dd->ipath_f_free_irq = ipath_ht_free_irq;
 
        /*
         * initialize chip-specific variables
index a72ab9de386a4e0e0d92ae04afa0cba1f7b8f3f7..6af89683f7100a6f79067db031703b88c038d326 100644 (file)
@@ -851,6 +851,7 @@ static int ipath_setup_pe_config(struct ipath_devdata *dd,
        int pos, ret;
 
        dd->ipath_msi_lo = 0;   /* used as a flag during reset processing */
+       dd->ipath_irq = pdev->irq;
        ret = pci_enable_msi(dd->pcidev);
        if (ret)
                ipath_dev_err(dd, "pci_enable_msi failed: %d, "
@@ -1323,6 +1324,12 @@ done:
        return 0;
 }
 
+static void ipath_pe_free_irq(struct ipath_devdata *dd)
+{
+       free_irq(dd->ipath_irq, dd);
+       dd->ipath_irq = 0;
+}
+
 /**
  * ipath_init_iba6120_funcs - set up the chip-specific function pointers
  * @dd: the infinipath device
@@ -1349,6 +1356,7 @@ void ipath_init_iba6120_funcs(struct ipath_devdata *dd)
        dd->ipath_f_cleanup = ipath_setup_pe_cleanup;
        dd->ipath_f_setextled = ipath_setup_pe_setextled;
        dd->ipath_f_get_base_info = ipath_pe_get_base_info;
+       dd->ipath_f_free_irq = ipath_pe_free_irq;
 
        /* initialize chip-specific variables */
        dd->ipath_f_tidtemplate = ipath_pe_tidtemplate;
index d9079ee120308633c49b012988bd0b752df362eb..5652a550d442858564b39795a9809f451ce31e29 100644 (file)
@@ -710,14 +710,14 @@ static void ipath_bad_intr(struct ipath_devdata *dd, u32 * unexpectp)
                         * linuxbios development work, and it may happen in
                         * the future again.
                         */
-                       if (dd->pcidev && dd->pcidev->irq) {
+                       if (dd->pcidev && dd->ipath_irq) {
                                ipath_dev_err(dd, "Now %u unexpected "
                                              "interrupts, unregistering "
                                              "interrupt handler\n",
                                              *unexpectp);
-                               ipath_dbg("free_irq of irq %x\n",
-                                         dd->pcidev->irq);
-                               free_irq(dd->pcidev->irq, dd);
+                               ipath_dbg("free_irq of irq %d\n",
+                                         dd->ipath_irq);
+                               dd->ipath_f_free_irq(dd);
                        }
                }
                if (ipath_read_kreg32(dd, dd->ipath_kregs->kr_intmask)) {
@@ -753,7 +753,7 @@ static void ipath_bad_regread(struct ipath_devdata *dd)
                if (allbits == 2) {
                        ipath_dev_err(dd, "Still bad interrupt status, "
                                      "unregistering interrupt\n");
-                       free_irq(dd->pcidev->irq, dd);
+                       dd->ipath_f_free_irq(dd);
                } else if (allbits > 2) {
                        if ((allbits % 10000) == 0)
                                printk(".");
index 06d5020a2f60625882920c1b52c74d680fa15660..986b2125b8f5826cd4a1fd95b29014a373914f19 100644 (file)
@@ -213,6 +213,8 @@ struct ipath_devdata {
        void (*ipath_f_setextled)(struct ipath_devdata *, u64, u64);
        /* fill out chip-specific fields */
        int (*ipath_f_get_base_info)(struct ipath_portdata *, void *);
+       /* free irq */
+       void (*ipath_f_free_irq)(struct ipath_devdata *);
        struct ipath_ibdev *verbs_dev;
        struct timer_list verbs_timer;
        /* total dwords sent (summed from counter) */
@@ -328,6 +330,8 @@ struct ipath_devdata {
        /* so we can rewrite it after a chip reset */
        u32 ipath_pcibar1;
 
+       /* interrupt number */
+       int ipath_irq;
        /* HT/PCI Vendor ID (here for NodeInfo) */
        u16 ipath_vendorid;
        /* HT/PCI Device ID (here for NodeInfo) */
index d13bb15a8a02981f69706048d32bfc64b83b73c1..4510ad8f971c366f4979403f4b0e13075f9d944b 100644 (file)
@@ -606,9 +606,14 @@ static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param)
                return __get_name_cell(param->name);
 
        md = dm_get_md(huge_decode_dev(param->dev));
-       if (md)
-               mdptr = dm_get_mdptr(md);
+       if (!md)
+               goto out;
 
+       mdptr = dm_get_mdptr(md);
+       if (!mdptr)
+               dm_put(md);
+
+out:
        return mdptr;
 }
 
index 659224cb7c533d6a7dba75e84cf03ab2ced13a0c..48a653b3f518d1a066b598291c50e2ac43e516fa 100644 (file)
@@ -24,6 +24,7 @@
 
 static struct workqueue_struct *_kmirrord_wq;
 static struct work_struct _kmirrord_work;
+static DECLARE_WAIT_QUEUE_HEAD(_kmirrord_recovery_stopped);
 
 static inline void wake(void)
 {
@@ -83,6 +84,7 @@ struct region_hash {
        struct list_head *buckets;
 
        spinlock_t region_lock;
+       atomic_t recovery_in_flight;
        struct semaphore recovery_count;
        struct list_head clean_regions;
        struct list_head quiesced_regions;
@@ -191,6 +193,7 @@ static int rh_init(struct region_hash *rh, struct mirror_set *ms,
 
        spin_lock_init(&rh->region_lock);
        sema_init(&rh->recovery_count, 0);
+       atomic_set(&rh->recovery_in_flight, 0);
        INIT_LIST_HEAD(&rh->clean_regions);
        INIT_LIST_HEAD(&rh->quiesced_regions);
        INIT_LIST_HEAD(&rh->recovered_regions);
@@ -382,6 +385,8 @@ static void rh_update_states(struct region_hash *rh)
                rh->log->type->clear_region(rh->log, reg->key);
                rh->log->type->complete_resync_work(rh->log, reg->key, 1);
                dispatch_bios(rh->ms, &reg->delayed_bios);
+               if (atomic_dec_and_test(&rh->recovery_in_flight))
+                       wake_up_all(&_kmirrord_recovery_stopped);
                up(&rh->recovery_count);
                mempool_free(reg, rh->region_pool);
        }
@@ -502,11 +507,21 @@ static int __rh_recovery_prepare(struct region_hash *rh)
 
 static void rh_recovery_prepare(struct region_hash *rh)
 {
-       while (!down_trylock(&rh->recovery_count))
+       /* Extra reference to avoid race with rh_stop_recovery */
+       atomic_inc(&rh->recovery_in_flight);
+
+       while (!down_trylock(&rh->recovery_count)) {
+               atomic_inc(&rh->recovery_in_flight);
                if (__rh_recovery_prepare(rh) <= 0) {
+                       atomic_dec(&rh->recovery_in_flight);
                        up(&rh->recovery_count);
                        break;
                }
+       }
+
+       /* Drop the extra reference */
+       if (atomic_dec_and_test(&rh->recovery_in_flight))
+               wake_up_all(&_kmirrord_recovery_stopped);
 }
 
 /*
@@ -1177,6 +1192,11 @@ static void mirror_postsuspend(struct dm_target *ti)
        struct dirty_log *log = ms->rh.log;
 
        rh_stop_recovery(&ms->rh);
+
+       /* Wait for all I/O we generated to complete */
+       wait_event(_kmirrord_recovery_stopped,
+                  !atomic_read(&ms->rh.recovery_in_flight));
+
        if (log->type->suspend && log->type->suspend(log))
                /* FIXME: need better error handling */
                DMWARN("log suspend failed");
index c5a16c5501227f1097a72ddcb85f6ef37be4bec2..6f9fcd4db9b553fde5e1af06ab8d728e9c25cb7f 100644 (file)
@@ -136,7 +136,7 @@ static int rr_add_path(struct path_selector *ps, struct path *path,
 
        path->pscontext = pi;
 
-       list_add(&pi->list, &s->valid_paths);
+       list_add_tail(&pi->list, &s->valid_paths);
 
        return 0;
 }
index b5764a86c8b56f3f44b8ca2ebc38d30af8389a44..fc4f743f3b531e72bdb9c937d6cb2bf09d9ede1d 100644 (file)
@@ -1285,7 +1285,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
        down(&md->suspend_lock);
 
        if (dm_suspended(md))
-               goto out;
+               goto out_unlock;
 
        map = dm_get_table(md);
 
@@ -1361,6 +1361,8 @@ out:
        }
 
        dm_table_put(map);
+
+out_unlock:
        up(&md->suspend_lock);
        return r;
 }
index d111356044038453e782053f66b22d3b555257a7..8cbf9c9df1c3915ce109ba8daae07e5187ea7b21 100644 (file)
@@ -3200,7 +3200,7 @@ static int do_md_run(mddev_t * mddev)
 
        mddev->changed = 1;
        md_new_event(mddev);
-       kobject_uevent(&mddev->gendisk->kobj, KOBJ_ONLINE);
+       kobject_uevent(&mddev->gendisk->kobj, KOBJ_CHANGE);
        return 0;
 }
 
@@ -3314,7 +3314,6 @@ static int do_md_stop(mddev_t * mddev, int mode)
 
                        module_put(mddev->pers->owner);
                        mddev->pers = NULL;
-                       kobject_uevent(&mddev->gendisk->kobj, KOBJ_OFFLINE);
                        if (mddev->ro)
                                mddev->ro = 0;
                }
@@ -4487,6 +4486,7 @@ static int md_thread(void * arg)
         * many dirty RAID5 blocks.
         */
 
+       current->flags |= PF_NOFREEZE;
        allow_signal(SIGKILL);
        while (!kthread_should_stop()) {
 
@@ -4503,7 +4503,6 @@ static int md_thread(void * arg)
                         test_bit(THREAD_WAKEUP, &thread->flags)
                         || kthread_should_stop(),
                         thread->timeout);
-               try_to_freeze();
 
                clear_bit(THREAD_WAKEUP, &thread->flags);
 
index e14f4578072006e3b464668d3c8500187df76453..69c3e201fa3bf0ee1ea51378fd172d4d4461e612 100644 (file)
@@ -3659,7 +3659,7 @@ static void end_reshape(raid5_conf_t *conf)
                bdev = bdget_disk(conf->mddev->gendisk, 0);
                if (bdev) {
                        mutex_lock(&bdev->bd_inode->i_mutex);
-                       i_size_write(bdev->bd_inode, conf->mddev->array_size << 10);
+                       i_size_write(bdev->bd_inode, (loff_t)conf->mddev->array_size << 10);
                        mutex_unlock(&bdev->bd_inode->i_mutex);
                        bdput(bdev);
                }
index 0dc70c7b7940a33f060ac26ce409e933b08c2e1d..aa9dd8f11269aeb3fe9a692ba89bcc205a70a156 100644 (file)
@@ -337,13 +337,16 @@ static void com20020_set_mc_list(struct net_device *dev)
        }
 }
 
-#ifdef MODULE
-
+#if defined(CONFIG_ARCNET_COM20020_PCI_MODULE) || \
+    defined(CONFIG_ARCNET_COM20020_ISA_MODULE)
 EXPORT_SYMBOL(com20020_check);
 EXPORT_SYMBOL(com20020_found);
+#endif
 
 MODULE_LICENSE("GPL");
 
+#ifdef MODULE
+
 int init_module(void)
 {
        BUGLVL(D_NORMAL) printk(VERSION);
index c0bbddae4ec41ef998d38f17a0a0c4ec8bd28a54..17a461152d39884157e5e138c71b7ed236fc5427 100644 (file)
@@ -4692,6 +4692,8 @@ static int bond_check_params(struct bond_params *params)
        return 0;
 }
 
+static struct lock_class_key bonding_netdev_xmit_lock_key;
+
 /* Create a new bond based on the specified name and bonding parameters.
  * Caller must NOT hold rtnl_lock; we need to release it here before we
  * set up our sysfs entries.
@@ -4727,6 +4729,9 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
        if (res < 0) {
                goto out_bond;
        }
+
+       lockdep_set_class(&bond_dev->_xmit_lock, &bonding_netdev_xmit_lock_key);
+
        if (newbond)
                *newbond = bond_dev->priv;
 
index 966b563e42bb8a81498f8cd1176675256aa0b439..a03d781f6d0a459c56f6009d56ce64ed355e72fb 100644 (file)
@@ -509,6 +509,8 @@ etrax_ethernet_init(void)
                 * does not share cacheline with any other data (to avoid cache bug)
                 */
                RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);
+               if (!RxDescList[i].skb)
+                       return -ENOMEM;
                RxDescList[i].descr.ctrl   = 0;
                RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE;
                RxDescList[i].descr.next   = virt_to_phys(&RxDescList[i + 1]);
index 65edb56107fd0608fc1bee728a86b20c9212827a..a1b783813d8e2fb4029bcd2c883c29d2de1de621 100644 (file)
@@ -746,7 +746,7 @@ int bcm43xx_sprom_write(struct bcm43xx_private *bcm, const u16 *sprom)
        if (err)
                goto err_ctlreg;
        spromctl |= 0x10; /* SPROM WRITE enable. */
-       bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
+       err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
        if (err)
                goto err_ctlreg;
        /* We must burn lots of CPU cycles here, but that does not
@@ -768,7 +768,7 @@ int bcm43xx_sprom_write(struct bcm43xx_private *bcm, const u16 *sprom)
                mdelay(20);
        }
        spromctl &= ~0x10; /* SPROM WRITE enable. */
-       bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
+       err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCICFG_SPROMCTL, spromctl);
        if (err)
                goto err_ctlreg;
        mdelay(500);
@@ -1463,6 +1463,23 @@ static void handle_irq_transmit_status(struct bcm43xx_private *bcm)
        }
 }
 
+static void drain_txstatus_queue(struct bcm43xx_private *bcm)
+{
+       u32 dummy;
+
+       if (bcm->current_core->rev < 5)
+               return;
+       /* Read all entries from the microcode TXstatus FIFO
+        * and throw them away.
+        */
+       while (1) {
+               dummy = bcm43xx_read32(bcm, BCM43xx_MMIO_XMITSTAT_0);
+               if (!dummy)
+                       break;
+               dummy = bcm43xx_read32(bcm, BCM43xx_MMIO_XMITSTAT_1);
+       }
+}
+
 static void bcm43xx_generate_noise_sample(struct bcm43xx_private *bcm)
 {
        bcm43xx_shm_write16(bcm, BCM43xx_SHM_SHARED, 0x408, 0x7F7F);
@@ -3532,6 +3549,7 @@ int bcm43xx_select_wireless_core(struct bcm43xx_private *bcm,
        bcm43xx_macfilter_clear(bcm, BCM43xx_MACFILTER_ASSOC);
        bcm43xx_macfilter_set(bcm, BCM43xx_MACFILTER_SELF, (u8 *)(bcm->net_dev->dev_addr));
        bcm43xx_security_init(bcm);
+       drain_txstatus_queue(bcm);
        ieee80211softmac_start(bcm->net_dev);
 
        /* Let's go! Be careful after enabling the IRQs.
index 0e27f2404a83d81acd5abbae17d99483d59055a3..0a8d1cce9fa09c733601f142436a7b39f231e3ff 100644 (file)
@@ -25,97 +25,72 @@ static DEFINE_SPINLOCK(ht_irq_lock);
 
 struct ht_irq_cfg {
        struct pci_dev *dev;
+        /* Update callback used to cope with buggy hardware */
+       ht_irq_update_t *update;
        unsigned pos;
        unsigned idx;
+       struct ht_irq_msg msg;
 };
 
-void write_ht_irq_low(unsigned int irq, u32 data)
-{
-       struct ht_irq_cfg *cfg = get_irq_data(irq);
-       unsigned long flags;
-       spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx);
-       pci_write_config_dword(cfg->dev, cfg->pos + 4, data);
-       spin_unlock_irqrestore(&ht_irq_lock, flags);
-}
 
-void write_ht_irq_high(unsigned int irq, u32 data)
+void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg)
 {
        struct ht_irq_cfg *cfg = get_irq_data(irq);
        unsigned long flags;
        spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx + 1);
-       pci_write_config_dword(cfg->dev, cfg->pos + 4, data);
-       spin_unlock_irqrestore(&ht_irq_lock, flags);
-}
-
-u32 read_ht_irq_low(unsigned int irq)
-{
-       struct ht_irq_cfg *cfg = get_irq_data(irq);
-       unsigned long flags;
-       u32 data;
-       spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx);
-       pci_read_config_dword(cfg->dev, cfg->pos + 4, &data);
+       if (cfg->msg.address_lo != msg->address_lo) {
+               pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx);
+               pci_write_config_dword(cfg->dev, cfg->pos + 4, msg->address_lo);
+       }
+       if (cfg->msg.address_hi != msg->address_hi) {
+               pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx + 1);
+               pci_write_config_dword(cfg->dev, cfg->pos + 4, msg->address_hi);
+       }
+       if (cfg->update)
+               cfg->update(cfg->dev, irq, msg);
        spin_unlock_irqrestore(&ht_irq_lock, flags);
-       return data;
+       cfg->msg = *msg;
 }
 
-u32 read_ht_irq_high(unsigned int irq)
+void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg)
 {
        struct ht_irq_cfg *cfg = get_irq_data(irq);
-       unsigned long flags;
-       u32 data;
-       spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx + 1);
-       pci_read_config_dword(cfg->dev, cfg->pos + 4, &data);
-       spin_unlock_irqrestore(&ht_irq_lock, flags);
-       return data;
+       *msg = cfg->msg;
 }
 
 void mask_ht_irq(unsigned int irq)
 {
        struct ht_irq_cfg *cfg;
-       unsigned long flags;
-       u32 data;
+       struct ht_irq_msg msg;
 
        cfg = get_irq_data(irq);
 
-       spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx);
-       pci_read_config_dword(cfg->dev, cfg->pos + 4, &data);
-       data |= 1;
-       pci_write_config_dword(cfg->dev, cfg->pos + 4, data);
-       spin_unlock_irqrestore(&ht_irq_lock, flags);
+       msg = cfg->msg;
+       msg.address_lo |= 1;
+       write_ht_irq_msg(irq, &msg);
 }
 
 void unmask_ht_irq(unsigned int irq)
 {
        struct ht_irq_cfg *cfg;
-       unsigned long flags;
-       u32 data;
+       struct ht_irq_msg msg;
 
        cfg = get_irq_data(irq);
 
-       spin_lock_irqsave(&ht_irq_lock, flags);
-       pci_write_config_byte(cfg->dev, cfg->pos + 2, cfg->idx);
-       pci_read_config_dword(cfg->dev, cfg->pos + 4, &data);
-       data &= ~1;
-       pci_write_config_dword(cfg->dev, cfg->pos + 4, data);
-       spin_unlock_irqrestore(&ht_irq_lock, flags);
+       msg = cfg->msg;
+       msg.address_lo &= ~1;
+       write_ht_irq_msg(irq, &msg);
 }
 
 /**
- * ht_create_irq - create an irq and attach it to a device.
+ * __ht_create_irq - create an irq and attach it to a device.
  * @dev: The hypertransport device to find the irq capability on.
  * @idx: Which of the possible irqs to attach to.
- *
- * ht_create_irq is needs to be called for all hypertransport devices
- * that generate irqs.
+ * @update: Function to be called when changing the htirq message
  *
  * The irq number of the new irq or a negative error value is returned.
  */
-int ht_create_irq(struct pci_dev *dev, int idx)
+int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update)
 {
        struct ht_irq_cfg *cfg;
        unsigned long flags;
@@ -150,8 +125,12 @@ int ht_create_irq(struct pci_dev *dev, int idx)
                return -ENOMEM;
 
        cfg->dev = dev;
+       cfg->update = update;
        cfg->pos = pos;
        cfg->idx = 0x10 + (idx * 2);
+       /* Initialize msg to a value that will never match the first write. */
+       cfg->msg.address_lo = 0xffffffff;
+       cfg->msg.address_hi = 0xffffffff;
 
        irq = create_irq();
        if (irq < 0) {
@@ -168,6 +147,21 @@ int ht_create_irq(struct pci_dev *dev, int idx)
        return irq;
 }
 
+/**
+ * ht_create_irq - create an irq and attach it to a device.
+ * @dev: The hypertransport device to find the irq capability on.
+ * @idx: Which of the possible irqs to attach to.
+ *
+ * ht_create_irq needs to be called for all hypertransport devices
+ * that generate irqs.
+ *
+ * The irq number of the new irq or a negative error value is returned.
+ */
+int ht_create_irq(struct pci_dev *dev, int idx)
+{
+       return __ht_create_irq(dev, idx, NULL);
+}
+
 /**
  * ht_destroy_irq - destroy an irq created with ht_create_irq
  *
@@ -186,5 +180,6 @@ void ht_destroy_irq(unsigned int irq)
        kfree(cfg);
 }
 
+EXPORT_SYMBOL(__ht_create_irq);
 EXPORT_SYMBOL(ht_create_irq);
 EXPORT_SYMBOL(ht_destroy_irq);
index a1d2e979b17fdd1e431297b78c88fbf926da99ac..f952bfea48a6f972e0a1de9cc8bfc4a33920bfb7 100644 (file)
@@ -642,6 +642,9 @@ err:
  */
 void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
 {
+       if (!sysfs_initialized)
+               return;
+
        if (pdev->cfg_size < 4096)
                sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
        else
index fd9e281c3bfeed4fef893cb705e7c8331011c7bd..94a274645f6f36819c29aadb3aeff7b5290581e8 100644 (file)
@@ -631,12 +631,22 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
         * scanning run at their own risk, or supply a user level program
         * that can correctly scan.
         */
-       sdev->inquiry = kmalloc(sdev->inquiry_len, GFP_ATOMIC);
-       if (sdev->inquiry == NULL) {
+
+       /*
+        * Copy at least 36 bytes of INQUIRY data, so that we don't
+        * dereference unallocated memory when accessing the Vendor,
+        * Product, and Revision strings.  Badly behaved devices may set
+        * the INQUIRY Additional Length byte to a small value, indicating
+        * these strings are invalid, but often they contain plausible data
+        * nonetheless.  It doesn't matter if the device sent < 36 bytes
+        * total, since scsi_probe_lun() initializes inq_result with 0s.
+        */
+       sdev->inquiry = kmemdup(inq_result,
+                               max_t(size_t, sdev->inquiry_len, 36),
+                               GFP_ATOMIC);
+       if (sdev->inquiry == NULL)
                return SCSI_SCAN_NO_RESPONSE;
-       }
 
-       memcpy(sdev->inquiry, inq_result, sdev->inquiry_len);
        sdev->vendor = (char *) (sdev->inquiry + 8);
        sdev->model = (char *) (sdev->inquiry + 16);
        sdev->rev = (char *) (sdev->inquiry + 32);
index fbea4541c234bbcd4a83b9cdb4ddf75141e36aa2..8d69bcdc29c95dda937a53652445140f008eba0d 100644 (file)
@@ -1295,7 +1295,7 @@ typedef struct {
        Proc_Info_Type Info_write;
        unsigned short frame_count;
        unsigned int filter_hist[4];
-       unsigned char filter_en[4];
+       unsigned char filter_en[6];
        unsigned short proc_load;
        unsigned long framesread;
        unsigned long frameswritten;
index 9ed640d357285505f8fcceb633444bc20b66898a..ea426115c6f952ed3a83198cf8ce30adebadf80e 100644 (file)
@@ -145,12 +145,18 @@ static void nvGetClocks(struct nvidia_par *par, unsigned int *MClk,
 
        if (par->Architecture >= NV_ARCH_40) {
                pll = NV_RD32(par->PMC, 0x4020);
-               P = (pll >> 16) & 0x03;
+               P = (pll >> 16) & 0x07;
                pll = NV_RD32(par->PMC, 0x4024);
                M = pll & 0xFF;
                N = (pll >> 8) & 0xFF;
-               MB = (pll >> 16) & 0xFF;
-               NB = (pll >> 24) & 0xFF;
+               if (((par->Chipset & 0xfff0) == 0x0290) ||
+                               ((par->Chipset & 0xfff0) == 0x0390)) {
+                       MB = 1;
+                       NB = 1;
+               } else {
+                       MB = (pll >> 16) & 0xFF;
+                       NB = (pll >> 24) & 0xFF;
+               }
                *MClk = ((N * NB * par->CrystalFreqKHz) / (M * MB)) >> P;
 
                pll = NV_RD32(par->PMC, 0x4000);
index a18a9aebf05fb2f7ea9c428ee7171068b9bfd5c5..61dc46fecf2bab1ad060fa8e392278678ac3bee3 100644 (file)
@@ -359,6 +359,7 @@ int NVCommonSetup(struct fb_info *info)
        case 0x0186:
        case 0x0187:
        case 0x018D:
+       case 0x0228:
        case 0x0286:
        case 0x028C:
        case 0x0316:
@@ -382,6 +383,10 @@ int NVCommonSetup(struct fb_info *info)
        case 0x034C:
        case 0x0160:
        case 0x0166:
+       case 0x0169:
+       case 0x016B:
+       case 0x016C:
+       case 0x016D:
        case 0x00C8:
        case 0x00CC:
        case 0x0144:
@@ -639,12 +644,23 @@ int NVCommonSetup(struct fb_info *info)
                par->fpHeight = NV_RD32(par->PRAMDAC, 0x0800) + 1;
                par->fpSyncs = NV_RD32(par->PRAMDAC, 0x0848) & 0x30000033;
 
-               printk("Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
+               printk("nvidiafb: Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
        }
 
        if (monA)
                info->monspecs = *monA;
 
+       if (!par->FlatPanel || !par->twoHeads)
+               par->FPDither = 0;
+
+       par->LVDS = 0;
+       if (par->FlatPanel && par->twoHeads) {
+               NV_WR32(par->PRAMDAC0, 0x08B0, 0x00010004);
+               if (par->PRAMDAC0[0x08b4] & 1)
+                       par->LVDS = 1;
+               printk("nvidiafb: Panel is %s\n", par->LVDS ? "LVDS" : "TMDS");
+       }
+
        kfree(edidA);
        kfree(edidB);
 done:
index acdc26693402bb4486476bb9c8926ffed579eba9..86e65dea60d3a9b2aebf2136d7a2a93526a0b6f5 100644 (file)
@@ -129,6 +129,7 @@ struct nvidia_par {
        int fpHeight;
        int PanelTweak;
        int paneltweak;
+       int LVDS;
        int pm_state;
        u32 crtcSync_read;
        u32 fpSyncs;
index eb24107bcc81f539a4a7e92b87fb5efb0523f9d1..538e947610e19374dfa71c66d310f444262ac636 100644 (file)
@@ -1160,20 +1160,20 @@ static u32 __devinit nvidia_get_arch(struct fb_info *info)
        case 0x0340:            /* GeForceFX 5700 */
                arch = NV_ARCH_30;
                break;
-       case 0x0040:
-       case 0x00C0:
-       case 0x0120:
+       case 0x0040:            /* GeForce 6800 */
+       case 0x00C0:            /* GeForce 6800 */
+       case 0x0120:            /* GeForce 6800 */
        case 0x0130:
-       case 0x0140:
-       case 0x0160:
-       case 0x01D0:
-       case 0x0090:
-       case 0x0210:
-       case 0x0220:
+       case 0x0140:            /* GeForce 6600 */
+       case 0x0160:            /* GeForce 6200 */
+       case 0x01D0:            /* GeForce 7200, 7300, 7400 */
+       case 0x0090:            /* GeForce 7800 */
+       case 0x0210:            /* GeForce 6800 */
+       case 0x0220:            /* GeForce 6200 */
        case 0x0230:
-       case 0x0240:
-       case 0x0290:
-       case 0x0390:
+       case 0x0240:            /* GeForce 6100 */
+       case 0x0290:            /* GeForce 7900 */
+       case 0x0390:            /* GeForce 7600 */
                arch = NV_ARCH_40;
                break;
        case 0x0020:            /* TNT, TNT2 */
index 7e056b9b49e8bdf8d519564800d3613a8e823b8d..2436ed8fc8400e2d86b4e5bbb569b122ac013e34 100644 (file)
@@ -492,10 +492,14 @@ int cifs_close(struct inode *inode, struct file *file)
                                        the struct would be in each open file,
                                        but this should give enough time to 
                                        clear the socket */
-                                       cERROR(1,("close with pending writes"));
+#ifdef CONFIG_CIFS_DEBUG2
+                                       cFYI(1,("close delay, write pending"));
+#endif /* DEBUG2 */
                                        msleep(timeout);
                                        timeout *= 4;
-                               } 
+                               }
+                               if(atomic_read(&pSMBFile->wrtPending))
+                                       cERROR(1,("close with pending writes"));
                                rc = CIFSSMBClose(xid, pTcon,
                                                  pSMBFile->netfid);
                        }
index dffe295825f46f24073497476de7680c4f23aba6..1ad8c9fcc742394aedee8df91ddd9bc100c3d7ed 100644 (file)
@@ -1089,8 +1089,10 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
        struct kstat *stat)
 {
        int err = cifs_revalidate(dentry);
-       if (!err)
+       if (!err) {
                generic_fillattr(dentry->d_inode, stat);
+               stat->blksize = CIFS_MAX_MSGSIZE;
+       }
        return err;
 }
 
index a8a083543ba050fa65cceee9a302c9b733f68311..bbdda99dce610364b71b5218cb061b3dfc577cd9 100644 (file)
@@ -90,7 +90,9 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
        } */
        /* copy user */
        if(ses->userName == NULL) {
-               /* BB what about null user mounts - check that we do this BB */
+               /* null user mount */
+               *bcc_ptr = 0;
+               *(bcc_ptr+1) = 0;
        } else { /* 300 should be long enough for any conceivable user name */
                bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->userName,
                                          300, nls_cp);
@@ -98,10 +100,13 @@ static void unicode_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
        bcc_ptr += 2 * bytes_ret;
        bcc_ptr += 2; /* account for null termination */
        /* copy domain */
-       if(ses->domainName == NULL)
-               bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr,
-                                         "CIFS_LINUX_DOM", 32, nls_cp);
-       else
+       if(ses->domainName == NULL) {
+               /* Sending null domain better than using a bogus domain name (as
+               we did briefly in 2.6.18) since server will use its default */
+               *bcc_ptr = 0;
+               *(bcc_ptr+1) = 0;
+               bytes_ret = 0;
+       } else
                bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, ses->domainName, 
                                          256, nls_cp);
        bcc_ptr += 2 * bytes_ret;
@@ -144,13 +149,11 @@ static void ascii_ssetup_strings(char ** pbcc_area, struct cifsSesInfo *ses,
 
         /* copy domain */
        
-        if(ses->domainName == NULL) {
-                strcpy(bcc_ptr, "CIFS_LINUX_DOM");
-               bcc_ptr += 14;  /* strlen(CIFS_LINUX_DOM) */
-       } else {
+        if(ses->domainName != NULL) {
                 strncpy(bcc_ptr, ses->domainName, 256); 
                bcc_ptr += strnlen(ses->domainName, 256);
-       }
+       } /* else we will send a null domain name 
+            so the server will default to its own domain */
        *bcc_ptr = 0;
        bcc_ptr++;
 
index 64db601c2bd2e90848aa653c1fca55710fdeef4a..7f5bad0393b197915e203004b78dbb79d0eae4b9 100644 (file)
@@ -258,7 +258,7 @@ nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
        /* Now create the file and set attributes */
        nfserr = nfsd_create_v3(rqstp, dirfhp, argp->name, argp->len,
                                attr, newfhp,
-                               argp->createmode, argp->verf, NULL);
+                               argp->createmode, argp->verf, NULL, NULL);
 
        RETURN_STATUS(nfserr);
 }
index 0a7bbdc4a10aba9ea8d01059864851c7a05de179..50bc94243ca1b08d77802d785f1de83cbdcd33f6 100644 (file)
@@ -93,6 +93,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 {
        struct svc_fh resfh;
        __be32 status;
+       int created = 0;
 
        fh_init(&resfh, NFS4_FHSIZE);
        open->op_truncate = 0;
@@ -105,28 +106,27 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
                status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
                                        open->op_fname.len, &open->op_iattr,
                                        &resfh, open->op_createmode,
-                                       (u32 *)open->op_verf.data, &open->op_truncate);
-       }
-       else {
+                                       (u32 *)open->op_verf.data, &open->op_truncate, &created);
+       } else {
                status = nfsd_lookup(rqstp, current_fh,
                                     open->op_fname.data, open->op_fname.len, &resfh);
                fh_unlock(current_fh);
        }
+       if (status)
+               goto out;
 
-       if (!status) {
-               set_change_info(&open->op_cinfo, current_fh);
+       set_change_info(&open->op_cinfo, current_fh);
 
-               /* set reply cache */
-               fh_dup2(current_fh, &resfh);
-               open->op_stateowner->so_replay.rp_openfh_len =
-                       resfh.fh_handle.fh_size;
-               memcpy(open->op_stateowner->so_replay.rp_openfh,
-                               &resfh.fh_handle.fh_base,
-                               resfh.fh_handle.fh_size);
+       /* set reply cache */
+       fh_dup2(current_fh, &resfh);
+       open->op_stateowner->so_replay.rp_openfh_len = resfh.fh_handle.fh_size;
+       memcpy(open->op_stateowner->so_replay.rp_openfh,
+                       &resfh.fh_handle.fh_base, resfh.fh_handle.fh_size);
 
+       if (!created)
                status = do_open_permission(rqstp, current_fh, open, MAY_NOP);
-       }
 
+out:
        fh_put(&resfh);
        return status;
 }
index f21e917bb8ed18519e7e1eeb4aa1c28b94af4fa3..bb4d926e4487dd60f1f9a72b3b06c9bb2d496848 100644 (file)
@@ -1177,7 +1177,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
        /*
         * Get the dir op function pointer.
         */
-       err = nfserr_perm;
+       err = 0;
        switch (type) {
        case S_IFREG:
                host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
@@ -1237,7 +1237,7 @@ __be32
 nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
                char *fname, int flen, struct iattr *iap,
                struct svc_fh *resfhp, int createmode, u32 *verifier,
-               int *truncp)
+               int *truncp, int *created)
 {
        struct dentry   *dentry, *dchild = NULL;
        struct inode    *dirp;
@@ -1331,6 +1331,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
        host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
        if (host_err < 0)
                goto out_nfserr;
+       if (created)
+               *created = 1;
 
        if (EX_ISSYNC(fhp->fh_export)) {
                err = nfserrno(nfsd_sync_dir(dentry));
index 291948d5085a08ebac04c8f725c152d80a392805..b49989bb89ad225dd2636f4d783cf3d57fdf5951 100644 (file)
@@ -21,22 +21,7 @@ EXTRA_CFLAGS +=       -Ifs/xfs -Ifs/xfs/linux-2.6 -funsigned-char
 XFS_LINUX := linux-2.6
 
 ifeq ($(CONFIG_XFS_DEBUG),y)
-       EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG
-       EXTRA_CFLAGS += -DXFS_BUF_LOCK_TRACKING
-endif
-ifeq ($(CONFIG_XFS_TRACE),y)
-       EXTRA_CFLAGS += -DXFS_ALLOC_TRACE
-       EXTRA_CFLAGS += -DXFS_ATTR_TRACE
-       EXTRA_CFLAGS += -DXFS_BLI_TRACE
-       EXTRA_CFLAGS += -DXFS_BMAP_TRACE
-       EXTRA_CFLAGS += -DXFS_BMBT_TRACE
-       EXTRA_CFLAGS += -DXFS_DIR2_TRACE
-       EXTRA_CFLAGS += -DXFS_DQUOT_TRACE
-       EXTRA_CFLAGS += -DXFS_ILOCK_TRACE
-       EXTRA_CFLAGS += -DXFS_LOG_TRACE
-       EXTRA_CFLAGS += -DXFS_RW_TRACE
-       EXTRA_CFLAGS += -DXFS_BUF_TRACE
-       EXTRA_CFLAGS += -DXFS_VNODE_TRACE
+       EXTRA_CFLAGS += -g
 endif
 
 obj-$(CONFIG_XFS_FS)           += xfs.o
index db5f5a3608ca3b4f09b8ae2bb0627c6c3c0ae38d..d3382843698e869cf4367707a34c069352dfe0ae 100644 (file)
@@ -15,6 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
+#include "xfs.h"
 #include <linux/stddef.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
@@ -31,7 +32,6 @@
 #include <linux/kthread.h>
 #include <linux/migrate.h>
 #include <linux/backing-dev.h>
-#include "xfs_linux.h"
 
 STATIC kmem_zone_t *xfs_buf_zone;
 STATIC kmem_shaker_t xfs_buf_shake;
@@ -1406,7 +1406,7 @@ xfs_alloc_bufhash(
        btp->bt_hashshift = external ? 3 : 8;   /* 8 or 256 buckets */
        btp->bt_hashmask = (1 << btp->bt_hashshift) - 1;
        btp->bt_hash = kmem_zalloc((1 << btp->bt_hashshift) *
-                                       sizeof(xfs_bufhash_t), KM_SLEEP);
+                                       sizeof(xfs_bufhash_t), KM_SLEEP | KM_LARGE);
        for (i = 0; i < (1 << btp->bt_hashshift); i++) {
                spin_lock_init(&btp->bt_hash[i].bh_lock);
                INIT_LIST_HEAD(&btp->bt_hash[i].bh_list);
diff --git a/fs/xfs/linux-2.6/xfs_dmapi_priv.h b/fs/xfs/linux-2.6/xfs_dmapi_priv.h
new file mode 100644 (file)
index 0000000..a8b0b16
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2000-2006 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+#ifndef __XFS_DMAPI_PRIV_H__
+#define __XFS_DMAPI_PRIV_H__
+
+/*
+ *     Based on IO_ISDIRECT, decide which i_ flag is set.
+ */
+#define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
+                             DM_FLAGS_IMUX : 0)
+#define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_IMUX)
+
+#endif /*__XFS_DMAPI_PRIV_H__*/
index a74f854d91e6afe1d86ba2da278a733a5afa48e5..74d094829a4d5aaec02469ad6b1e4bfb643a1275 100644 (file)
@@ -341,8 +341,11 @@ xfs_open_by_handle(
                put_unused_fd(new_fd);
                return -XFS_ERROR(-PTR_ERR(filp));
        }
-       if (inode->i_mode & S_IFREG)
+       if (inode->i_mode & S_IFREG) {
+               /* invisible operation should not change atime */
+               filp->f_flags |= O_NOATIME;
                filp->f_op = &xfs_invis_file_operations;
+       }
 
        fd_install(new_fd, filp);
        return new_fd;
index 38c4d128a8c0c8675f05f6672fefd3f058dd85c2..de05abbbe7fd5b4d220b3baee7230006631cdd33 100644 (file)
@@ -227,9 +227,7 @@ xfs_initialize_vnode(
                xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
                xfs_set_inodeops(inode);
 
-               spin_lock(&ip->i_flags_lock);
-               ip->i_flags &= ~XFS_INEW;
-               spin_unlock(&ip->i_flags_lock);
+               xfs_iflags_clear(ip, XFS_INEW);
                barrier();
 
                unlock_new_inode(inode);
index c75f68361e33dda4276b29583b5d45d8f33afd15..4363512d2f90e569b07e1dd67824d25e3e464cf4 100644 (file)
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
+#include <xfs.h>
 #include "debug.h"
 #include "spin.h"
-#include <asm/page.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
 
 static char            message[256];   /* keep it off the stack */
 static DEFINE_SPINLOCK(xfs_err_lock);
index caefa17b80feafedbfa2aefa5b2b9b38d7fda0bd..ac8617ca3909a27ca620984e4c81280e009568c5 100644 (file)
@@ -22,7 +22,7 @@
  * as we go.
  */
 int
-uio_read(caddr_t src, size_t len, struct uio *uio)
+xfs_uio_read(caddr_t src, size_t len, struct uio *uio)
 {
        size_t  count;
 
index 97a2498d2da383230154e5cdd4e961728e3ae8cc..977879c24ff527b4a8e5d6062027d2747559278b 100644 (file)
@@ -65,6 +65,6 @@ struct uio {
 typedef struct uio uio_t;
 typedef struct iovec iovec_t;
 
-extern int     uio_read (caddr_t, size_t, uio_t *);
+extern int     xfs_uio_read (caddr_t, size_t, uio_t *);
 
 #endif  /* __XFS_SUPPORT_MOVE_H__ */
index 1a48dbb902a7bf214c1114dea3c0dfd5711fda83..bf0a12040b1388facefbe43de58d82690d6246c1 100644 (file)
  */
 #ifndef __XFS_H__
 #define __XFS_H__
+
+#ifdef CONFIG_XFS_DEBUG
+#define STATIC
+#define DEBUG 1
+#define XFS_BUF_LOCK_TRACKING 1
+/* #define QUOTADEBUG 1 */
+#endif
+
+#ifdef CONFIG_XFS_TRACE
+#define XFS_ALLOC_TRACE 1
+#define XFS_ATTR_TRACE 1
+#define XFS_BLI_TRACE 1
+#define XFS_BMAP_TRACE 1
+#define XFS_BMBT_TRACE 1
+#define XFS_DIR2_TRACE 1
+#define XFS_DQUOT_TRACE 1
+#define XFS_ILOCK_TRACE 1
+#define XFS_LOG_TRACE 1
+#define XFS_RW_TRACE 1
+#define XFS_BUF_TRACE 1
+#define XFS_VNODE_TRACE 1
+#endif
+
 #include <linux-2.6/xfs_linux.h>
 #endif /* __XFS_H__ */
index 8edbe1adb95ba64b1ae75e135a9828ca43a3b0e8..8e8e5279334a47953fa7922e6e14ed8422bc4186 100644 (file)
@@ -678,7 +678,7 @@ xfs_dir2_put_dirent64_uio(
        idbp->d_off = pa->cook;
        idbp->d_name[namelen] = '\0';
        memcpy(idbp->d_name, pa->name, namelen);
-       rval = uio_read((caddr_t)idbp, reclen, uio);
+       rval = xfs_uio_read((caddr_t)idbp, reclen, uio);
        pa->done = (rval == 0);
        return rval;
 }
index 4e7865ad6f0ee74fe83a08d6f53a6a21d0c4dd2e..adc3d251240d79e6023fc6de599dd2e4e31d588d 100644 (file)
@@ -157,27 +157,9 @@ typedef enum {
 #define DM_FLAGS_IALLOCSEM_WR  0x020   /* thread holds i_alloc_sem wr */
 
 /*
- *     Based on IO_ISDIRECT, decide which i_ flag is set.
+ *     Pull in platform specific event flags defines
  */
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
-#define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
-                             DM_FLAGS_IMUX : 0)
-#define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_IMUX)
-#endif
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) && \
-    (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,22))
-#define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
-                             DM_FLAGS_IALLOCSEM_RD : DM_FLAGS_IMUX)
-#define DM_SEM_FLAG_WR (DM_FLAGS_IALLOCSEM_WR | DM_FLAGS_IMUX)
-#endif
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,21)
-#define DM_SEM_FLAG_RD(ioflags) (((ioflags) & IO_ISDIRECT) ? \
-                             0 : DM_FLAGS_IMUX)
-#define DM_SEM_FLAG_WR (DM_FLAGS_IMUX)
-#endif
-
+#include "xfs_dmapi_priv.h"
 
 /*
  *     Macros to turn caller specified delay/block flags into
index b73d216ecaf939aa4df49f8a89a6cff9e2fafd16..c1c89dac19cceceed3aff020651b9eac349cf98e 100644 (file)
@@ -215,7 +215,7 @@ again:
                         * If INEW is set this inode is being set up
                         * we need to pause and try again.
                         */
-                       if (ip->i_flags & XFS_INEW) {
+                       if (xfs_iflags_test(ip, XFS_INEW)) {
                                read_unlock(&ih->ih_lock);
                                delay(1);
                                XFS_STATS_INC(xs_ig_frecycle);
@@ -230,22 +230,50 @@ again:
                                 * on its way out of the system,
                                 * we need to pause and try again.
                                 */
-                               if (ip->i_flags & XFS_IRECLAIM) {
+                               if (xfs_iflags_test(ip, XFS_IRECLAIM)) {
                                        read_unlock(&ih->ih_lock);
                                        delay(1);
                                        XFS_STATS_INC(xs_ig_frecycle);
 
                                        goto again;
                                }
+                               ASSERT(xfs_iflags_test(ip, XFS_IRECLAIMABLE));
+
+                               /*
+                                * If lookup is racing with unlink, then we
+                                * should return an error immediately so we
+                                * don't remove it from the reclaim list and
+                                * potentially leak the inode.
+                                */
+                               if ((ip->i_d.di_mode == 0) &&
+                                   !(flags & XFS_IGET_CREATE)) {
+                                       read_unlock(&ih->ih_lock);
+                                       return ENOENT;
+                               }
+
+                               /*
+                                * There may be transactions sitting in the
+                                * incore log buffers or being flushed to disk
+                                * at this time.  We can't clear the
+                                * XFS_IRECLAIMABLE flag until these
+                                * transactions have hit the disk, otherwise we
+                                * will void the guarantee the flag provides
+                                * xfs_iunpin()
+                                */
+                               if (xfs_ipincount(ip)) {
+                                       read_unlock(&ih->ih_lock);
+                                       xfs_log_force(mp, 0,
+                                               XFS_LOG_FORCE|XFS_LOG_SYNC);
+                                       XFS_STATS_INC(xs_ig_frecycle);
+                                       goto again;
+                               }
 
                                vn_trace_exit(vp, "xfs_iget.alloc",
                                        (inst_t *)__return_address);
 
                                XFS_STATS_INC(xs_ig_found);
 
-                               spin_lock(&ip->i_flags_lock);
-                               ip->i_flags &= ~XFS_IRECLAIMABLE;
-                               spin_unlock(&ip->i_flags_lock);
+                               xfs_iflags_clear(ip, XFS_IRECLAIMABLE);
                                version = ih->ih_version;
                                read_unlock(&ih->ih_lock);
                                xfs_ihash_promote(ih, ip, version);
@@ -299,10 +327,7 @@ finish_inode:
                        if (lock_flags != 0)
                                xfs_ilock(ip, lock_flags);
 
-                       spin_lock(&ip->i_flags_lock);
-                       ip->i_flags &= ~XFS_ISTALE;
-                       spin_unlock(&ip->i_flags_lock);
-
+                       xfs_iflags_clear(ip, XFS_ISTALE);
                        vn_trace_exit(vp, "xfs_iget.found",
                                                (inst_t *)__return_address);
                        goto return_ip;
@@ -371,10 +396,7 @@ finish_inode:
        ih->ih_next = ip;
        ip->i_udquot = ip->i_gdquot = NULL;
        ih->ih_version++;
-       spin_lock(&ip->i_flags_lock);
-       ip->i_flags |= XFS_INEW;
-       spin_unlock(&ip->i_flags_lock);
-
+       xfs_iflags_set(ip, XFS_INEW);
        write_unlock(&ih->ih_lock);
 
        /*
@@ -625,7 +647,7 @@ xfs_iput_new(xfs_inode_t    *ip,
        vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address);
 
        if ((ip->i_d.di_mode == 0)) {
-               ASSERT(!(ip->i_flags & XFS_IRECLAIMABLE));
+               ASSERT(!xfs_iflags_test(ip, XFS_IRECLAIMABLE));
                vn_mark_bad(vp);
        }
        if (inode->i_state & I_NEW)
@@ -683,6 +705,7 @@ xfs_ireclaim(xfs_inode_t *ip)
        /*
         * Free all memory associated with the inode.
         */
+       xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
        xfs_idestroy(ip);
 }
 
index c27d7d495aa0f498ade09aa6a5db5a67a8fa01ce..d72c80dbfbb1fd64629c72b6d5797beb8008624c 100644 (file)
@@ -2193,7 +2193,7 @@ xfs_ifree_cluster(
                        /* Inode not in memory or we found it already,
                         * nothing to do
                         */
-                       if (!ip || (ip->i_flags & XFS_ISTALE)) {
+                       if (!ip || xfs_iflags_test(ip, XFS_ISTALE)) {
                                read_unlock(&ih->ih_lock);
                                continue;
                        }
@@ -2215,10 +2215,7 @@ xfs_ifree_cluster(
 
                        if (ip == free_ip) {
                                if (xfs_iflock_nowait(ip)) {
-                                       spin_lock(&ip->i_flags_lock);
-                                       ip->i_flags |= XFS_ISTALE;
-                                       spin_unlock(&ip->i_flags_lock);
-
+                                       xfs_iflags_set(ip, XFS_ISTALE);
                                        if (xfs_inode_clean(ip)) {
                                                xfs_ifunlock(ip);
                                        } else {
@@ -2231,9 +2228,7 @@ xfs_ifree_cluster(
 
                        if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) {
                                if (xfs_iflock_nowait(ip)) {
-                                       spin_lock(&ip->i_flags_lock);
-                                       ip->i_flags |= XFS_ISTALE;
-                                       spin_unlock(&ip->i_flags_lock);
+                                       xfs_iflags_set(ip, XFS_ISTALE);
 
                                        if (xfs_inode_clean(ip)) {
                                                xfs_ifunlock(ip);
@@ -2263,9 +2258,7 @@ xfs_ifree_cluster(
                                AIL_LOCK(mp,s);
                                iip->ili_flush_lsn = iip->ili_item.li_lsn;
                                AIL_UNLOCK(mp, s);
-                               spin_lock(&iip->ili_inode->i_flags_lock);
-                               iip->ili_inode->i_flags |= XFS_ISTALE;
-                               spin_unlock(&iip->ili_inode->i_flags_lock);
+                               xfs_iflags_set(ip, XFS_ISTALE);
                                pre_flushed++;
                        }
                        lip = lip->li_bio_list;
@@ -2748,42 +2741,39 @@ xfs_iunpin(
 {
        ASSERT(atomic_read(&ip->i_pincount) > 0);
 
-       if (atomic_dec_and_test(&ip->i_pincount)) {
+       if (atomic_dec_and_lock(&ip->i_pincount, &ip->i_flags_lock)) {
+
                /*
-                * If the inode is currently being reclaimed, the
-                * linux inode _and_ the xfs vnode may have been
-                * freed so we cannot reference either of them safely.
-                * Hence we should not try to do anything to them
-                * if the xfs inode is currently in the reclaim
-                * path.
+                * If the inode is currently being reclaimed, the link between
+                * the bhv_vnode and the xfs_inode will be broken after the
+                * XFS_IRECLAIM* flag is set. Hence, if these flags are not
+                * set, then we can move forward and mark the linux inode dirty
+                * knowing that it is still valid as it won't freed until after
+                * the bhv_vnode<->xfs_inode link is broken in xfs_reclaim. The
+                * i_flags_lock is used to synchronise the setting of the
+                * XFS_IRECLAIM* flags and the breaking of the link, and so we
+                * can execute atomically w.r.t to reclaim by holding this lock
+                * here.
                 *
-                * However, we still need to issue the unpin wakeup
-                * call as the inode reclaim may be blocked waiting for
-                * the inode to become unpinned.
+                * However, we still need to issue the unpin wakeup call as the
+                * inode reclaim may be blocked waiting for the inode to become
+                * unpinned.
                 */
-               struct inode *inode = NULL;
 
-               spin_lock(&ip->i_flags_lock);
-               if (!(ip->i_flags & (XFS_IRECLAIM|XFS_IRECLAIMABLE))) {
+               if (!__xfs_iflags_test(ip, XFS_IRECLAIM|XFS_IRECLAIMABLE)) {
                        bhv_vnode_t     *vp = XFS_ITOV_NULL(ip);
+                       struct inode *inode = NULL;
+
+                       BUG_ON(vp == NULL);
+                       inode = vn_to_inode(vp);
+                       BUG_ON(inode->i_state & I_CLEAR);
 
                        /* make sync come back and flush this inode */
-                       if (vp) {
-                               inode = vn_to_inode(vp);
-
-                               if (!(inode->i_state &
-                                               (I_NEW|I_FREEING|I_CLEAR))) {
-                                       inode = igrab(inode);
-                                       if (inode)
-                                               mark_inode_dirty_sync(inode);
-                               } else
-                                       inode = NULL;
-                       }
+                       if (!(inode->i_state & (I_NEW|I_FREEING)))
+                               mark_inode_dirty_sync(inode);
                }
                spin_unlock(&ip->i_flags_lock);
                wake_up(&ip->i_ipin_wait);
-               if (inode)
-                       iput(inode);
        }
 }
 
index e96eb0835fe658a9a2ba8df257eb94a1f130a15d..bc823720d88f4116bff4eccc42fb07b6d1ab971d 100644 (file)
@@ -305,6 +305,47 @@ typedef struct xfs_inode {
 #endif
 } xfs_inode_t;
 
+
+/*
+ * i_flags helper functions
+ */
+static inline void
+__xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
+{
+       ip->i_flags |= flags;
+}
+
+static inline void
+xfs_iflags_set(xfs_inode_t *ip, unsigned short flags)
+{
+       spin_lock(&ip->i_flags_lock);
+       __xfs_iflags_set(ip, flags);
+       spin_unlock(&ip->i_flags_lock);
+}
+
+static inline void
+xfs_iflags_clear(xfs_inode_t *ip, unsigned short flags)
+{
+       spin_lock(&ip->i_flags_lock);
+       ip->i_flags &= ~flags;
+       spin_unlock(&ip->i_flags_lock);
+}
+
+static inline int
+__xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
+{
+       return (ip->i_flags & flags);
+}
+
+static inline int
+xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
+{
+       int ret;
+       spin_lock(&ip->i_flags_lock);
+       ret = __xfs_iflags_test(ip, flags);
+       spin_unlock(&ip->i_flags_lock);
+       return ret;
+}
 #endif /* __KERNEL__ */
 
 
index 061e2ffdd1dee3613bedb671dbdbb9256350aac8..bda774a04b8f1c89d3d256bdd98d1b84e8a83adb 100644 (file)
@@ -1013,7 +1013,7 @@ xfs_readlink(
        pathlen = (int)ip->i_d.di_size;
 
        if (ip->i_df.if_flags & XFS_IFINLINE) {
-               error = uio_read(ip->i_df.if_u1.if_data, pathlen, uiop);
+               error = xfs_uio_read(ip->i_df.if_u1.if_data, pathlen, uiop);
        }
        else {
                /*
@@ -1044,7 +1044,7 @@ xfs_readlink(
                                byte_cnt = pathlen;
                        pathlen -= byte_cnt;
 
-                       error = uio_read(XFS_BUF_PTR(bp), byte_cnt, uiop);
+                       error = xfs_uio_read(XFS_BUF_PTR(bp), byte_cnt, uiop);
                        xfs_buf_relse (bp);
                }
 
@@ -3827,11 +3827,16 @@ xfs_reclaim(
         */
        xfs_synchronize_atime(ip);
 
-       /* If we have nothing to flush with this inode then complete the
-        * teardown now, otherwise break the link between the xfs inode
-        * and the linux inode and clean up the xfs inode later. This
-        * avoids flushing the inode to disk during the delete operation
-        * itself.
+       /*
+        * If we have nothing to flush with this inode then complete the
+        * teardown now, otherwise break the link between the xfs inode and the
+        * linux inode and clean up the xfs inode later. This avoids flushing
+        * the inode to disk during the delete operation itself.
+        *
+        * When breaking the link, we need to set the XFS_IRECLAIMABLE flag
+        * first to ensure that xfs_iunpin() will never see an xfs inode
+        * that has a linux inode being reclaimed. Synchronisation is provided
+        * by the i_flags_lock.
         */
        if (!ip->i_update_core && (ip->i_itemp == NULL)) {
                xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -3840,13 +3845,13 @@ xfs_reclaim(
        } else {
                xfs_mount_t     *mp = ip->i_mount;
 
-               /* Protect sync from us */
+               /* Protect sync and unpin from us */
                XFS_MOUNT_ILOCK(mp);
-               vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
-               list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
                spin_lock(&ip->i_flags_lock);
-               ip->i_flags |= XFS_IRECLAIMABLE;
+               __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
+               vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
                spin_unlock(&ip->i_flags_lock);
+               list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
                XFS_MOUNT_IUNLOCK(mp);
        }
        return 0;
@@ -3872,8 +3877,8 @@ xfs_finish_reclaim(
         */
        write_lock(&ih->ih_lock);
        spin_lock(&ip->i_flags_lock);
-       if ((ip->i_flags & XFS_IRECLAIM) ||
-           (!(ip->i_flags & XFS_IRECLAIMABLE) && vp == NULL)) {
+       if (__xfs_iflags_test(ip, XFS_IRECLAIM) ||
+           (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) {
                spin_unlock(&ip->i_flags_lock);
                write_unlock(&ih->ih_lock);
                if (locked) {
@@ -3882,7 +3887,7 @@ xfs_finish_reclaim(
                }
                return 1;
        }
-       ip->i_flags |= XFS_IRECLAIM;
+       __xfs_iflags_set(ip, XFS_IRECLAIM);
        spin_unlock(&ip->i_flags_lock);
        write_unlock(&ih->ih_lock);
 
index 1d9efe541662927819dc2c70220da507ea6f98dd..e715c794b1865d0216cc9697b8b716e139f89c93 100644 (file)
  */
 #define TO_PHYS(x)             (TO_PHYS_MASK & (x))
 #define TO_CAC(x)              (CAC_BASE     | TO_PHYS(x))
+#ifdef CONFIG_SGI_SN
 #define TO_AMO(x)              (AMO_BASE     | TO_PHYS(x))
 #define TO_GET(x)              (GET_BASE     | TO_PHYS(x))
-
+#else
+#define TO_AMO(x)              ({ BUG(); x; })
+#define TO_GET(x)              ({ BUG(); x; })
+#endif
 
 /*
  * Covert from processor physical address to II/TIO physical address:
index 1f15ce279a237a9984b076f4bb903419140ba317..c96ea46737d03067afeeeeb4191c29c3ec438d6f 100644 (file)
@@ -1,15 +1,23 @@
 #ifndef LINUX_HTIRQ_H
 #define LINUX_HTIRQ_H
 
+struct ht_irq_msg {
+       u32     address_lo;     /* low 32 bits of the ht irq message */
+       u32     address_hi;     /* high 32 bits of the it irq message */
+};
+
 /* Helper functions.. */
-void write_ht_irq_low(unsigned int irq, u32 data);
-void write_ht_irq_high(unsigned int irq, u32 data);
-u32  read_ht_irq_low(unsigned int irq);
-u32  read_ht_irq_high(unsigned int irq);
+void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
+void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
 void mask_ht_irq(unsigned int irq);
 void unmask_ht_irq(unsigned int irq);
 
 /* The arch hook for getting things started */
 int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
 
+/* For drivers of buggy hardware */
+typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq,
+                              struct ht_irq_msg *msg);
+int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
+
 #endif /* LINUX_HTIRQ_H */
index 22f5e2afda4f2f4d16b9b0f834e7eb107f44246c..4d04d8b58a0a55a13a59ef9055cdd5eac81e4d08 100644 (file)
@@ -75,6 +75,8 @@
 #define IPMI_INVALID_COMMAND_ERR       0xc1
 #define IPMI_ERR_MSG_TRUNCATED         0xc6
 #define IPMI_LOST_ARBITRATION_ERR      0x81
+#define IPMI_BUS_ERR                   0x82
+#define IPMI_NAK_ON_WRITE_ERR          0x83
 #define IPMI_ERR_UNSPECIFIED           0xff
 
 #define IPMI_CHANNEL_PROTOCOL_IPMB     1
index eb231143d5794fa4783e235e7a0d28032470a254..edb54c3171b35b792eef3d8c047112698d706fa2 100644 (file)
@@ -89,7 +89,7 @@ __be32                nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
 __be32         nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
                                char *name, int len, struct iattr *attrs,
                                struct svc_fh *res, int createmode,
-                               u32 *verifier, int *truncp);
+                               u32 *verifier, int *truncp, int *created);
 __be32         nfsd_commit(struct svc_rqst *, struct svc_fh *,
                                loff_t, unsigned long);
 #endif /* CONFIG_NFSD_V3 */
index bf4cf2080e5cb1c0ba57abf88b7a85951fd0d7fb..012cd558189b443e6f3856426313cd783c6a36ce 100644 (file)
@@ -114,7 +114,7 @@ struct exec_domain {
  * Change personality of the currently running process.
  */
 #define set_personality(pers) \
-       ((current->personality == pers) ? 0 : __set_personality(pers))
+       ((current->personality == (pers)) ? 0 : __set_personality(pers))
 
 #endif /* __KERNEL__ */
 
index dc9a29d84abc85d1d79ae25a0bb976d527958a94..924e502905d40a27cdd6e7afe5d37e9d88b526b4 100644 (file)
@@ -23,13 +23,14 @@ struct vm_area_struct;
 #endif
 
 struct vm_struct {
+       /* keep next,addr,size together to speedup lookups */
+       struct vm_struct        *next;
        void                    *addr;
        unsigned long           size;
        unsigned long           flags;
        struct page             **pages;
        unsigned int            nr_pages;
        unsigned long           phys_addr;
-       struct vm_struct        *next;
 };
 
 /*
index 49c717e3b040075562728bbda430369adf89aa93..903108e583f886431f4aa876c2cedf1adabd6a7d 100644 (file)
@@ -7,6 +7,7 @@
 #define _IP_VS_H
 
 #include <asm/types.h>         /* For __uXX types */
+#include <linux/types.h>       /* For __beXX types in userland */
 
 #define IP_VS_VERSION_CODE     0x010201
 #define NVERSION(version)                      \
index c8b2624af1767398632f68825014c825fbb7fe8e..176f7e5136c74d2db3923c69751121cdb460d451 100644 (file)
@@ -304,20 +304,19 @@ config UID16
 
 config SYSCTL_SYSCALL
        bool "Sysctl syscall support" if EMBEDDED
-       default n
+       default y
        select SYSCTL
        ---help---
-         Enable the deprecated sysctl system call.  sys_sysctl uses
-         binary paths that have been found to be a major pain to maintain
-         and use.  The interface in /proc/sys is now the primary and what
-         everyone uses.
+         sys_sysctl uses binary paths that have been found challenging
+         to properly maintain and use.  The interface in /proc/sys
+         using paths with ascii names is now the primary path to this
+         information.
 
-         Nothing has been using the binary sysctl interface for some
-         time now so nothing should break if you disable sysctl syscall
-         support, and your kernel will get marginally smaller.
+         Almost nothing using the binary sysctl interface so if you are
+         trying to save some space it is probably safe to disable this,
+         making your kernel marginally smaller.
 
-         Unless you have an application that uses the sys_sysctl interface
-         you should probably say N here.
+         If unsure say Y here.
 
 config KALLSYMS
         bool "Load all symbols for debugging/kksymoops" if EMBEDDED
index 3da978eec791216dd796cd704aed67b263713fa1..4b4eab2a316136fc3bd44bdb7e55eeee509b1030 100644 (file)
@@ -687,6 +687,7 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
                 * the latest pointer.
                 */
                spin_lock(&oldf->file_lock);
+               open_files = count_open_files(old_fdt);
                old_fdt = files_fdtable(oldf);
        }
 
index 543ea2e5ad9301944ab520303bd7fe84e4e92f88..9c7e2e4c1fe717ef0f309eed0163a2d28a6cd5a7 100644 (file)
@@ -147,7 +147,11 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
        if (unlikely(irqfixup)) {
                /* Don't punish working computers */
                if ((irqfixup == 2 && irq == 0) || action_ret == IRQ_NONE) {
-                       int ok = misrouted_irq(irq);
+                       int ok;
+
+                       spin_unlock(&desc->lock);
+                       ok = misrouted_irq(irq);
+                       spin_lock(&desc->lock);
                        if (action_ret == IRQ_NONE)
                                desc->irqs_unhandled -= ok;
                }
index 46606c133e824ea4a12f8ae7ca818c333a938628..7dc6aa745166cf680092103195e725619c4ce633 100644 (file)
@@ -186,10 +186,8 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long fl
        if (unlikely(!area))
                return NULL;
 
-       if (unlikely(!size)) {
-               kfree (area);
+       if (unlikely(!size))
                return NULL;
-       }
 
        /*
         * We always allocate a guard page.
@@ -532,11 +530,12 @@ void *vmalloc_user(unsigned long size)
        void *ret;
 
        ret = __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
-       write_lock(&vmlist_lock);
-       area = __find_vm_area(ret);
-       area->flags |= VM_USERMAP;
-       write_unlock(&vmlist_lock);
-
+       if (ret) {
+               write_lock(&vmlist_lock);
+               area = __find_vm_area(ret);
+               area->flags |= VM_USERMAP;
+               write_unlock(&vmlist_lock);
+       }
        return ret;
 }
 EXPORT_SYMBOL(vmalloc_user);
@@ -605,11 +604,12 @@ void *vmalloc_32_user(unsigned long size)
        void *ret;
 
        ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
-       write_lock(&vmlist_lock);
-       area = __find_vm_area(ret);
-       area->flags |= VM_USERMAP;
-       write_unlock(&vmlist_lock);
-
+       if (ret) {
+               write_lock(&vmlist_lock);
+               area = __find_vm_area(ret);
+               area->flags |= VM_USERMAP;
+               write_unlock(&vmlist_lock);
+       }
        return ret;
 }
 EXPORT_SYMBOL(vmalloc_32_user);
index 6d398f10aa9170881b8f383382b2c96286460a7d..687c1de1146fa7a6b510a88e563c8ab6037c48b4 100644 (file)
@@ -200,7 +200,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
                from = n_cp->vaddr;
                port = n_cp->vport;
                sprintf(buf,"%d,%d,%d,%d,%d,%d", NIPQUAD(from),
-                       ntohs(port)&255, (ntohs(port)>>8)&255);
+                       (ntohs(port)>>8)&255, ntohs(port)&255);
                buf_len = strlen(buf);
 
                /*
index bfe779e74590e14be21af29fa35c6a54551ec231..6ff05c3a32e67913191c114dc2644dbfafbfe1fd 100644 (file)
@@ -117,7 +117,7 @@ tcp_fast_csum_update(struct tcphdr *tcph, __be32 oldip, __be32 newip,
 {
        tcph->check =
                ip_vs_check_diff(~oldip, newip,
-                                ip_vs_check_diff(oldport ^ htonl(0xFFFF),
+                                ip_vs_check_diff(oldport ^ htons(0xFFFF),
                                                  newport, tcph->check));
 }
 
index 54aa7603591f5c3e9091cb341d6ae4aab4bcd96f..691c8b637b2937bb6ab62574a4bd5dac76d200b6 100644 (file)
@@ -122,10 +122,10 @@ udp_fast_csum_update(struct udphdr *uhdr, __be32 oldip, __be32 newip,
 {
        uhdr->check =
                ip_vs_check_diff(~oldip, newip,
-                                ip_vs_check_diff(oldport ^ htonl(0xFFFF),
+                                ip_vs_check_diff(oldport ^ htons(0xFFFF),
                                                  newport, uhdr->check));
        if (!uhdr->check)
-               uhdr->check = htonl(0xFFFF);
+               uhdr->check = -1;
 }
 
 static int
@@ -173,7 +173,7 @@ udp_snat_handler(struct sk_buff **pskb,
                                                cp->protocol,
                                                (*pskb)->csum);
                if (udph->check == 0)
-                       udph->check = htonl(0xFFFF);
+                       udph->check = -1;
                IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
                          pp->name, udph->check,
                          (char*)&(udph->check) - (char*)udph);
@@ -228,7 +228,7 @@ udp_dnat_handler(struct sk_buff **pskb,
                                                cp->protocol,
                                                (*pskb)->csum);
                if (udph->check == 0)
-                       udph->check = 0xFFFF;
+                       udph->check = -1;
                (*pskb)->ip_summed = CHECKSUM_UNNECESSARY;
        }
        return 1;
index e8ad1f6b3da4891f5996735afa64603ae018f916..b49584c932cc21bf371d29cb0cafd0361d64061f 100644 (file)
@@ -6,6 +6,8 @@ lex.*.c
 *.tab.c
 *.tab.h
 zconf.hash.c
+*.moc
+lkc_defs.h
 
 #
 # configuration programs