From a5dc77297dd535b4dccad3779224bfef3890727f Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 15 Jul 2010 11:01:17 +0100 Subject: [PATCH] --- yaml --- r: 201458 b: refs/heads/master c: 3126c7bc4106c572ef47e2c220df5a00e7973379 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/00-INDEX | 6 +- ...s-virt-phys-mapping.txt => IO-mapping.txt} | 0 trunk/MAINTAINERS | 1 - trunk/arch/arm/mach-bcmring/core.c | 23 +- trunk/arch/arm/mach-ep93xx/clock.c | 2 +- trunk/arch/arm/mach-integrator/core.c | 7 +- trunk/arch/arm/mach-nomadik/clock.c | 4 + trunk/arch/arm/mach-omap2/clock3xxx_data.c | 5 + trunk/arch/arm/mach-realview/core.c | 7 +- trunk/arch/arm/mach-spear3xx/clock.c | 3 + trunk/arch/arm/mach-spear6xx/clock.c | 3 + trunk/arch/arm/mach-u300/clock.c | 6 + trunk/arch/arm/mach-ux500/clock.c | 4 + trunk/arch/arm/mach-versatile/core.c | 7 +- trunk/arch/arm/mach-vexpress/v2m.c | 7 +- trunk/arch/arm/mach-w90x900/dev.c | 96 +----- .../arm/mach-w90x900/include/mach/regs-gcr.h | 39 --- trunk/arch/arm/mach-w90x900/mach-nuc950evb.c | 44 +++ trunk/arch/arm/mach-w90x900/nuc910.c | 2 - trunk/arch/arm/mach-w90x900/nuc950.c | 2 + trunk/arch/sparc/configs/sparc64_defconfig | 49 +-- trunk/arch/sparc/include/asm/cache.h | 1 + trunk/arch/sparc/include/asm/pgtable_32.h | 5 +- trunk/arch/sparc/kernel/perf_event.c | 1 - trunk/arch/sparc/kernel/sun4d_irq.c | 2 +- trunk/arch/sparc/kernel/ttable.S | 2 +- trunk/arch/sparc/mm/srmmu.c | 2 + trunk/arch/sparc/mm/sun4c.c | 3 + trunk/arch/x86/kernel/apic/apic.c | 2 +- trunk/arch/x86/kernel/early-quirks.c | 18 - trunk/arch/x86/kernel/kprobes.c | 2 +- trunk/arch/x86/kernel/quirks.c | 5 + trunk/arch/x86/kernel/setup_percpu.c | 17 +- trunk/arch/x86/kvm/mmu.c | 2 +- trunk/arch/x86/pci/i386.c | 1 - trunk/arch/x86/pci/mrst.c | 7 +- trunk/crypto/ablkcipher.c | 2 +- trunk/drivers/clocksource/cs5535-clockevt.c | 2 +- trunk/drivers/edac/Kconfig | 2 +- trunk/drivers/edac/mpc85xx_edac.c | 1 - trunk/drivers/gpio/cs5535-gpio.c | 2 +- trunk/drivers/gpu/drm/i915/i915_gem.c | 13 +- trunk/drivers/gpu/drm/i915/i915_reg.h | 64 ---- trunk/drivers/gpu/drm/nouveau/nouveau_bios.c | 33 +- trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c | 3 +- trunk/drivers/gpu/drm/radeon/r100.c | 1 - trunk/drivers/gpu/drm/radeon/r300.c | 3 - trunk/drivers/gpu/drm/radeon/r520.c | 1 - trunk/drivers/gpu/drm/radeon/r600.c | 1 - trunk/drivers/gpu/drm/radeon/r600_blit.c | 5 +- trunk/drivers/gpu/drm/radeon/radeon.h | 1 - .../drivers/gpu/drm/radeon/radeon_atombios.c | 20 +- .../gpu/drm/radeon/radeon_connectors.c | 23 +- trunk/drivers/gpu/drm/radeon/radeon_device.c | 8 +- .../drivers/gpu/drm/radeon/radeon_legacy_tv.c | 4 +- trunk/drivers/gpu/drm/radeon/rs400.c | 5 +- trunk/drivers/gpu/drm/radeon/rs600.c | 1 - trunk/drivers/gpu/drm/radeon/rs690.c | 1 - trunk/drivers/gpu/drm/radeon/rv515.c | 1 - trunk/drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 +- trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 1 - trunk/drivers/input/mouse/synaptics.c | 1 - trunk/drivers/input/touchscreen/w90p910_ts.c | 2 +- trunk/drivers/misc/cs5535-mfgpt.c | 2 +- trunk/drivers/mmc/host/sdhci-s3c.c | 20 -- trunk/drivers/net/ibmveth.c | 4 +- trunk/drivers/net/pcmcia/axnet_cs.c | 7 +- trunk/drivers/net/r8169.c | 2 +- .../drivers/net/wireless/ath/ath9k/hif_usb.c | 8 +- .../drivers/net/wireless/hostap/hostap_pci.c | 1 - trunk/drivers/net/wireless/iwlwifi/iwl-sta.h | 11 - trunk/drivers/net/wireless/rt2x00/rt2x00dev.c | 10 +- trunk/drivers/pci/setup-res.c | 32 -- trunk/drivers/pcmcia/pcmcia_resource.c | 4 +- trunk/drivers/platform/x86/intel_scu_ipc.c | 12 +- trunk/drivers/power/ds2782_battery.c | 2 +- trunk/drivers/s390/block/dasd_devmap.c | 4 +- trunk/drivers/s390/cio/chsc.c | 2 +- trunk/drivers/sbus/char/openprom.c | 4 +- trunk/drivers/serial/suncore.c | 4 +- trunk/drivers/serial/sunsu.c | 13 +- trunk/drivers/usb/gadget/f_fs.c | 2 +- trunk/drivers/vhost/net.c | 13 +- trunk/drivers/video/aty/radeon_pm.c | 2 +- trunk/fs/btrfs/ctree.c | 129 +------- trunk/fs/btrfs/ioctl.c | 20 +- trunk/fs/ceph/auth_x.c | 3 - trunk/fs/ceph/mds_client.c | 35 +- trunk/fs/ceph/mds_client.h | 1 - trunk/fs/ceph/messenger.c | 71 ++-- trunk/fs/ceph/osdmap.c | 1 - trunk/fs/dcache.c | 2 +- trunk/fs/gfs2/bmap.c | 1 - trunk/fs/gfs2/dir.c | 2 +- trunk/fs/gfs2/glock.c | 12 +- trunk/fs/gfs2/inode.c | 12 +- trunk/fs/gfs2/quota.c | 10 +- trunk/fs/gfs2/quota.h | 2 +- trunk/fs/inode.c | 2 +- trunk/fs/jbd2/journal.c | 15 +- trunk/fs/jbd2/transaction.c | 9 +- trunk/fs/jffs2/xattr.c | 2 +- trunk/fs/mbcache.c | 5 +- trunk/fs/nfs/dir.c | 2 +- trunk/fs/nfs/internal.h | 3 +- trunk/fs/ocfs2/aops.c | 94 +++--- trunk/fs/ocfs2/dlm/dlmdomain.c | 3 +- trunk/fs/ocfs2/dlm/dlmmaster.c | 22 +- trunk/fs/ocfs2/dlm/dlmrecovery.c | 2 +- trunk/fs/ocfs2/file.c | 309 ++++-------------- trunk/fs/ocfs2/file.h | 6 +- trunk/fs/ocfs2/journal.c | 30 +- trunk/fs/ocfs2/localalloc.c | 7 - trunk/fs/ocfs2/quota_global.c | 2 +- trunk/fs/ocfs2/quota_local.c | 4 +- trunk/fs/ocfs2/refcounttree.c | 12 - trunk/fs/ocfs2/suballoc.c | 2 +- trunk/fs/ocfs2/xattr.c | 200 ++++-------- trunk/fs/partitions/ibm.c | 14 +- trunk/fs/quota/dquot.c | 2 +- trunk/fs/ubifs/shrinker.c | 2 +- trunk/fs/ubifs/ubifs.h | 2 +- trunk/fs/xfs/linux-2.6/xfs_buf.c | 5 +- trunk/fs/xfs/linux-2.6/xfs_super.c | 2 + trunk/fs/xfs/linux-2.6/xfs_sync.c | 130 +++----- trunk/fs/xfs/linux-2.6/xfs_sync.h | 2 + trunk/fs/xfs/linux-2.6/xfs_trace.h | 3 - trunk/fs/xfs/quota/xfs_qm.c | 7 +- trunk/fs/xfs/xfs_mount.h | 2 +- trunk/include/linux/fb.h | 2 - trunk/include/linux/fdtable.h | 3 +- trunk/include/linux/i8042.h | 12 +- trunk/include/linux/jbd2.h | 11 +- trunk/include/linux/mm.h | 2 +- trunk/include/linux/pci.h | 1 - trunk/include/linux/syscalls.h | 6 +- trunk/include/linux/vgaarb.h | 1 - trunk/include/math-emu/op-common.h | 2 +- trunk/include/net/sock.h | 7 +- trunk/ipc/sem.c | 46 +-- trunk/kernel/early_res.c | 6 - trunk/mm/bootmem.c | 24 +- trunk/mm/page_alloc.c | 8 - trunk/mm/page_cgroup.c | 7 - trunk/mm/vmscan.c | 10 +- trunk/net/bluetooth/hci_conn.c | 5 - trunk/net/bluetooth/hci_event.c | 2 - trunk/net/bluetooth/l2cap.c | 14 +- trunk/net/bridge/br_device.c | 9 + trunk/net/bridge/br_forward.c | 23 +- trunk/net/core/dev.c | 20 +- trunk/net/core/neighbour.c | 5 +- trunk/net/dsa/Kconfig | 2 +- trunk/net/ipv4/ipmr.c | 8 +- trunk/net/ipv4/tcp.c | 1 - trunk/net/ipv4/tcp_output.c | 3 - trunk/net/ipv6/mip6.c | 3 +- trunk/net/phonet/pep.c | 1 - trunk/net/sched/act_nat.c | 5 +- trunk/net/sunrpc/auth.c | 2 +- trunk/net/xfrm/xfrm_policy.c | 15 +- trunk/sound/soc/codecs/Kconfig | 4 +- trunk/sound/soc/codecs/wm8727.c | 2 - trunk/sound/soc/codecs/wm8776.c | 1 + trunk/sound/soc/codecs/wm8988.c | 1 + trunk/sound/soc/sh/fsi.c | 27 +- trunk/tools/perf/arch/sparc/Makefile | 4 - trunk/tools/perf/arch/sparc/util/dwarf-regs.c | 43 --- trunk/tools/perf/builtin-report.c | 2 +- trunk/tools/perf/util/PERF-VERSION-GEN | 17 +- trunk/tools/perf/util/callchain.c | 35 +- trunk/tools/perf/util/callchain.h | 5 +- 173 files changed, 768 insertions(+), 1595 deletions(-) rename trunk/Documentation/{bus-virt-phys-mapping.txt => IO-mapping.txt} (100%) delete mode 100644 trunk/arch/arm/mach-w90x900/include/mach/regs-gcr.h delete mode 100644 trunk/tools/perf/arch/sparc/Makefile delete mode 100644 trunk/tools/perf/arch/sparc/util/dwarf-regs.c diff --git a/[refs] b/[refs] index 8a0e986d9aaf..8ccc217058d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4f5e28d2ee02e3b68da4a8b6156f3b4872d03be +refs/heads/master: 3126c7bc4106c572ef47e2c220df5a00e7973379 diff --git a/trunk/Documentation/00-INDEX b/trunk/Documentation/00-INDEX index 5405f7aecefc..dd10b51b4e65 100644 --- a/trunk/Documentation/00-INDEX +++ b/trunk/Documentation/00-INDEX @@ -32,6 +32,8 @@ DocBook/ - directory with DocBook templates etc. for kernel documentation. HOWTO - the process and procedures of how to do Linux kernel development. +IO-mapping.txt + - how to access I/O mapped memory from within device drivers. IPMI.txt - info on Linux Intelligent Platform Management Interface (IPMI) Driver. IRQ-affinity.txt @@ -82,8 +84,6 @@ blockdev/ - info on block devices & drivers btmrvl.txt - info on Marvell Bluetooth driver usage. -bus-virt-phys-mapping.txt - - how to access I/O mapped memory from within device drivers. cachetlb.txt - describes the cache/TLB flushing interfaces Linux uses. cdrom/ @@ -168,8 +168,6 @@ initrd.txt - how to use the RAM disk as an initial/temporary root filesystem. input/ - info on Linux input device support. -io-mapping.txt - - description of io_mapping functions in linux/io-mapping.h io_ordering.txt - info on ordering I/O writes to memory-mapped addresses. ioctl/ diff --git a/trunk/Documentation/bus-virt-phys-mapping.txt b/trunk/Documentation/IO-mapping.txt similarity index 100% rename from trunk/Documentation/bus-virt-phys-mapping.txt rename to trunk/Documentation/IO-mapping.txt diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index db3d0f5061f9..58848125b8bf 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -5336,7 +5336,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git S: Maintained F: arch/sparc/ -F: drivers/sbus SPARC SERIAL DRIVERS M: "David S. Miller" diff --git a/trunk/arch/arm/mach-bcmring/core.c b/trunk/arch/arm/mach-bcmring/core.c index 72e405df0fb0..d3f959e92b2d 100644 --- a/trunk/arch/arm/mach-bcmring/core.c +++ b/trunk/arch/arm/mach-bcmring/core.c @@ -91,14 +91,23 @@ static struct clk uart_clk = { .parent = &pll1_clk, }; +static struct clk dummy_apb_pclk = { + .name = "BUSCLK", + .type = CLK_TYPE_PRIMARY, + .mode = CLK_MODE_XTAL, +}; + static struct clk_lookup lookups[] = { - { /* UART0 */ - .dev_id = "uarta", - .clk = &uart_clk, - }, { /* UART1 */ - .dev_id = "uartb", - .clk = &uart_clk, - } + { /* Bus clock */ + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, { /* UART0 */ + .dev_id = "uarta", + .clk = &uart_clk, + }, { /* UART1 */ + .dev_id = "uartb", + .clk = &uart_clk, + } }; static struct amba_device *amba_devs[] __initdata = { diff --git a/trunk/arch/arm/mach-ep93xx/clock.c b/trunk/arch/arm/mach-ep93xx/clock.c index e29bdef9b2e2..7f3039761d91 100644 --- a/trunk/arch/arm/mach-ep93xx/clock.c +++ b/trunk/arch/arm/mach-ep93xx/clock.c @@ -185,7 +185,7 @@ static struct clk_lookup clocks[] = { INIT_CK(NULL, "pll1", &clk_pll1), INIT_CK(NULL, "fclk", &clk_f), INIT_CK(NULL, "hclk", &clk_h), - INIT_CK(NULL, "pclk", &clk_p), + INIT_CK(NULL, "apb_pclk", &clk_p), INIT_CK(NULL, "pll2", &clk_pll2), INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), INIT_CK("ep93xx-keypad", NULL, &clk_keypad), diff --git a/trunk/arch/arm/mach-integrator/core.c b/trunk/arch/arm/mach-integrator/core.c index b02cfc06e0ae..a04d38609839 100644 --- a/trunk/arch/arm/mach-integrator/core.c +++ b/trunk/arch/arm/mach-integrator/core.c @@ -119,8 +119,13 @@ static struct clk uartclk = { .rate = 14745600, }; +static struct clk dummy_apb_pclk; + static struct clk_lookup lookups[] = { - { /* UART0 */ + { /* Bus clock */ + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, { /* UART0 */ .dev_id = "mb:16", .clk = &uartclk, }, { /* UART1 */ diff --git a/trunk/arch/arm/mach-nomadik/clock.c b/trunk/arch/arm/mach-nomadik/clock.c index f035f4185274..89f793adf776 100644 --- a/trunk/arch/arm/mach-nomadik/clock.c +++ b/trunk/arch/arm/mach-nomadik/clock.c @@ -53,6 +53,10 @@ static struct clk clk_default; } static struct clk_lookup lookups[] = { + { + .con_id = "apb_pclk", + .clk = &clk_default, + }, CLK(&clk_24, "mtu0"), CLK(&clk_24, "mtu1"), CLK(&clk_48, "uart0"), diff --git a/trunk/arch/arm/mach-omap2/clock3xxx_data.c b/trunk/arch/arm/mach-omap2/clock3xxx_data.c index 41b155acfca7..d33744117ce2 100644 --- a/trunk/arch/arm/mach-omap2/clock3xxx_data.c +++ b/trunk/arch/arm/mach-omap2/clock3xxx_data.c @@ -3166,6 +3166,10 @@ static struct clk uart4_ick_am35xx = { .recalc = &followparent_recalc, }; +static struct clk dummy_apb_pclk = { + .name = "apb_pclk", + .ops = &clkops_null, +}; /* * clkdev @@ -3173,6 +3177,7 @@ static struct clk uart4_ick_am35xx = { /* XXX At some point we should rename this file to clock3xxx_data.c */ static struct omap_clk omap3xxx_clks[] = { + CLK(NULL, "apb_pclk", &dummy_apb_pclk, CK_3XXX), CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX), CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX), diff --git a/trunk/arch/arm/mach-realview/core.c b/trunk/arch/arm/mach-realview/core.c index 595be19f8ad5..4aba15f7f812 100644 --- a/trunk/arch/arm/mach-realview/core.c +++ b/trunk/arch/arm/mach-realview/core.c @@ -300,8 +300,13 @@ static struct clk ref24_clk = { .rate = 24000000, }; +static struct clk dummy_apb_pclk; + static struct clk_lookup lookups[] = { - { /* UART0 */ + { /* Bus clock */ + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, { /* UART0 */ .dev_id = "dev:uart0", .clk = &ref24_clk, }, { /* UART1 */ diff --git a/trunk/arch/arm/mach-spear3xx/clock.c b/trunk/arch/arm/mach-spear3xx/clock.c index 39f6ccf22294..18febf92f20a 100644 --- a/trunk/arch/arm/mach-spear3xx/clock.c +++ b/trunk/arch/arm/mach-spear3xx/clock.c @@ -341,8 +341,11 @@ static struct clk gpio_clk = { .recalc = &follow_parent, }; +static struct clk dummy_apb_pclk; + /* array of all spear 3xx clock lookups */ static struct clk_lookup spear_clk_lookups[] = { + { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, /* root clks */ { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, { .con_id = "osc_24m_clk", .clk = &osc_24m_clk}, diff --git a/trunk/arch/arm/mach-spear6xx/clock.c b/trunk/arch/arm/mach-spear6xx/clock.c index 13e27c769685..36ff056b7321 100644 --- a/trunk/arch/arm/mach-spear6xx/clock.c +++ b/trunk/arch/arm/mach-spear6xx/clock.c @@ -428,8 +428,11 @@ static struct clk gpio2_clk = { .recalc = &follow_parent, }; +static struct clk dummy_apb_pclk; + /* array of all spear 6xx clock lookups */ static struct clk_lookup spear_clk_lookups[] = { + { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, /* root clks */ { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, { .con_id = "osc_30m_clk", .clk = &osc_30m_clk}, diff --git a/trunk/arch/arm/mach-u300/clock.c b/trunk/arch/arm/mach-u300/clock.c index 5af71d5ba665..5d12d547789e 100644 --- a/trunk/arch/arm/mach-u300/clock.c +++ b/trunk/arch/arm/mach-u300/clock.c @@ -1212,6 +1212,8 @@ static struct clk ppm_clk = { }; #endif +static struct clk dummy_apb_pclk; + #define DEF_LOOKUP(devid, clkref) \ { \ .dev_id = devid, \ @@ -1223,6 +1225,10 @@ static struct clk ppm_clk = { * look up through clockdevice. */ static struct clk_lookup lookups[] = { + { + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, /* Connected directly to the AMBA bus */ DEF_LOOKUP("amba", &amba_clk), DEF_LOOKUP("cpu", &cpu_clk), diff --git a/trunk/arch/arm/mach-ux500/clock.c b/trunk/arch/arm/mach-ux500/clock.c index 0a1318fc8e2b..d8ab7f184fe4 100644 --- a/trunk/arch/arm/mach-ux500/clock.c +++ b/trunk/arch/arm/mach-ux500/clock.c @@ -453,7 +453,11 @@ static DEFINE_PRCC_CLK_CUSTOM(7, mtu0_ed, 2, -1, NULL, clk_mtu_get_rate, 0); static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL); static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL); +static struct clk clk_dummy_apb_pclk; + static struct clk_lookup u8500_common_clks[] = { + CLK(dummy_apb_pclk, NULL, "apb_pclk"), + /* Peripheral Cluster #1 */ CLK(gpio0, "gpio.0", NULL), CLK(gpio0, "gpio.1", NULL), diff --git a/trunk/arch/arm/mach-versatile/core.c b/trunk/arch/arm/mach-versatile/core.c index 3dff8641b03f..145803c006b4 100644 --- a/trunk/arch/arm/mach-versatile/core.c +++ b/trunk/arch/arm/mach-versatile/core.c @@ -400,8 +400,13 @@ static struct clk ref24_clk = { .rate = 24000000, }; +static struct clk dummy_apb_pclk; + static struct clk_lookup lookups[] = { - { /* UART0 */ + { /* AMBA bus clock */ + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, { /* UART0 */ .dev_id = "dev:f1", .clk = &ref24_clk, }, { /* UART1 */ diff --git a/trunk/arch/arm/mach-vexpress/v2m.c b/trunk/arch/arm/mach-vexpress/v2m.c index d250711b8c7a..d6db3453908b 100644 --- a/trunk/arch/arm/mach-vexpress/v2m.c +++ b/trunk/arch/arm/mach-vexpress/v2m.c @@ -298,8 +298,13 @@ static struct clk osc2_clk = { .rate = 24000000, }; +static struct clk dummy_apb_pclk; + static struct clk_lookup v2m_lookups[] = { - { /* UART0 */ + { /* AMBA bus clock */ + .con_id = "apb_pclk", + .clk = &dummy_apb_pclk, + }, { /* UART0 */ .dev_id = "mb:uart0", .clk = &osc2_clk, }, { /* UART1 */ diff --git a/trunk/arch/arm/mach-w90x900/dev.c b/trunk/arch/arm/mach-w90x900/dev.c index 7a1fa6adb7c3..b2eda4dc1c34 100644 --- a/trunk/arch/arm/mach-w90x900/dev.c +++ b/trunk/arch/arm/mach-w90x900/dev.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include "cpu.h" @@ -209,7 +207,7 @@ static struct nuc900_spi_info nuc900_spiflash_data = { .divider = 24, .sleep = 0, .txnum = 0, - .txbitlen = 8, + .txbitlen = 1, .bus_num = 0, }; @@ -258,7 +256,7 @@ static struct spi_board_info nuc900_spi_board_info[] __initdata = { .modalias = "m25p80", .max_speed_hz = 20000000, .bus_num = 0, - .chip_select = 0, + .chip_select = 1, .platform_data = &nuc900_spi_flash_data, .mode = SPI_MODE_0, }, @@ -363,39 +361,6 @@ struct platform_device nuc900_device_fmi = { /* KPI controller*/ -static int nuc900_keymap[] = { - KEY(0, 0, KEY_A), - KEY(0, 1, KEY_B), - KEY(0, 2, KEY_C), - KEY(0, 3, KEY_D), - - KEY(1, 0, KEY_E), - KEY(1, 1, KEY_F), - KEY(1, 2, KEY_G), - KEY(1, 3, KEY_H), - - KEY(2, 0, KEY_I), - KEY(2, 1, KEY_J), - KEY(2, 2, KEY_K), - KEY(2, 3, KEY_L), - - KEY(3, 0, KEY_M), - KEY(3, 1, KEY_N), - KEY(3, 2, KEY_O), - KEY(3, 3, KEY_P), -}; - -static struct matrix_keymap_data nuc900_map_data = { - .keymap = nuc900_keymap, - .keymap_size = ARRAY_SIZE(nuc900_keymap), -}; - -struct w90p910_keypad_platform_data nuc900_keypad_info = { - .keymap_data = &nuc900_map_data, - .prescale = 0xfa, - .debounce = 0x50, -}; - static struct resource nuc900_kpi_resource[] = { [0] = { .start = W90X900_PA_KPI, @@ -415,49 +380,9 @@ struct platform_device nuc900_device_kpi = { .id = -1, .num_resources = ARRAY_SIZE(nuc900_kpi_resource), .resource = nuc900_kpi_resource, - .dev = { - .platform_data = &nuc900_keypad_info, - } }; -/* LCD controller*/ - -static struct nuc900fb_display __initdata nuc900_lcd_info[] = { - /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ - [0] = { - .type = LCM_DCCS_VA_SRC_RGB565, - .width = 320, - .height = 240, - .xres = 320, - .yres = 240, - .bpp = 16, - .pixclock = 200000, - .left_margin = 34, - .right_margin = 54, - .hsync_len = 10, - .upper_margin = 18, - .lower_margin = 4, - .vsync_len = 1, - .dccs = 0x8e00041a, - .devctl = 0x060800c0, - .fbctrl = 0x00a000a0, - .scale = 0x04000400, - }, -}; - -static struct nuc900fb_mach_info nuc900_fb_info __initdata = { -#if defined(CONFIG_GPM1040A0_320X240) - .displays = &nuc900_lcd_info[0], -#else - .displays = nuc900_lcd_info, -#endif - .num_displays = ARRAY_SIZE(nuc900_lcd_info), - .default_display = 0, - .gpio_dir = 0x00000004, - .gpio_dir_mask = 0xFFFFFFFD, - .gpio_data = 0x00000004, - .gpio_data_mask = 0xFFFFFFFD, -}; +#ifdef CONFIG_FB_NUC900 static struct resource nuc900_lcd_resource[] = { [0] = { @@ -481,10 +406,23 @@ struct platform_device nuc900_device_lcd = { .dev = { .dma_mask = &nuc900_device_lcd_dmamask, .coherent_dma_mask = -1, - .platform_data = &nuc900_fb_info, } }; +void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd) +{ + struct nuc900fb_mach_info *npd; + + npd = kmalloc(sizeof(*npd), GFP_KERNEL); + if (npd) { + memcpy(npd, pd, sizeof(*npd)); + nuc900_device_lcd.dev.platform_data = npd; + } else { + printk(KERN_ERR "no memory for LCD platform data\n"); + } +} +#endif + /* AUDIO controller*/ static u64 nuc900_device_audio_dmamask = -1; static struct resource nuc900_ac97_resource[] = { diff --git a/trunk/arch/arm/mach-w90x900/include/mach/regs-gcr.h b/trunk/arch/arm/mach-w90x900/include/mach/regs-gcr.h deleted file mode 100644 index 6087abd93ef5..000000000000 --- a/trunk/arch/arm/mach-w90x900/include/mach/regs-gcr.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * arch/arm/mach-w90x900/include/mach/regs-gcr.h - * - * Copyright (c) 2010 Nuvoton technology corporation - * All rights reserved. - * - * Wan ZongShun - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - */ - -#ifndef __ASM_ARCH_REGS_GCR_H -#define __ASM_ARCH_REGS_GCR_H - -/* Global control registers */ - -#define GCR_BA W90X900_VA_GCR -#define REG_PDID (GCR_BA+0x000) -#define REG_PWRON (GCR_BA+0x004) -#define REG_ARBCON (GCR_BA+0x008) -#define REG_MFSEL (GCR_BA+0x00C) -#define REG_EBIDPE (GCR_BA+0x010) -#define REG_LCDDPE (GCR_BA+0x014) -#define REG_GPIOCPE (GCR_BA+0x018) -#define REG_GPIODPE (GCR_BA+0x01C) -#define REG_GPIOEPE (GCR_BA+0x020) -#define REG_GPIOFPE (GCR_BA+0x024) -#define REG_GPIOGPE (GCR_BA+0x028) -#define REG_GPIOHPE (GCR_BA+0x02C) -#define REG_GPIOIPE (GCR_BA+0x030) -#define REG_GTMP1 (GCR_BA+0x034) -#define REG_GTMP2 (GCR_BA+0x038) -#define REG_GTMP3 (GCR_BA+0x03C) - -#endif /* __ASM_ARCH_REGS_GCR_H */ diff --git a/trunk/arch/arm/mach-w90x900/mach-nuc950evb.c b/trunk/arch/arm/mach-w90x900/mach-nuc950evb.c index 04d295f89eb0..b3edc3cccf52 100644 --- a/trunk/arch/arm/mach-w90x900/mach-nuc950evb.c +++ b/trunk/arch/arm/mach-w90x900/mach-nuc950evb.c @@ -20,10 +20,51 @@ #include #include #include +#include #include #include "nuc950.h" +#ifdef CONFIG_FB_NUC900 +/* LCD Controller */ +static struct nuc900fb_display __initdata nuc950_lcd_info[] = { + /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ + [0] = { + .type = LCM_DCCS_VA_SRC_RGB565, + .width = 320, + .height = 240, + .xres = 320, + .yres = 240, + .bpp = 16, + .pixclock = 200000, + .left_margin = 34, + .right_margin = 54, + .hsync_len = 10, + .upper_margin = 18, + .lower_margin = 4, + .vsync_len = 1, + .dccs = 0x8e00041a, + .devctl = 0x060800c0, + .fbctrl = 0x00a000a0, + .scale = 0x04000400, + }, +}; + +static struct nuc900fb_mach_info nuc950_fb_info __initdata = { +#if defined(CONFIG_GPM1040A0_320X240) + .displays = &nuc950_lcd_info[0], +#else + .displays = nuc950_lcd_info, +#endif + .num_displays = ARRAY_SIZE(nuc950_lcd_info), + .default_display = 0, + .gpio_dir = 0x00000004, + .gpio_dir_mask = 0xFFFFFFFD, + .gpio_data = 0x00000004, + .gpio_data_mask = 0xFFFFFFFD, +}; +#endif + static void __init nuc950evb_map_io(void) { nuc950_map_io(); @@ -33,6 +74,9 @@ static void __init nuc950evb_map_io(void) static void __init nuc950evb_init(void) { nuc950_board_init(); +#ifdef CONFIG_FB_NUC900 + nuc900_fb_set_platdata(&nuc950_fb_info); +#endif } MACHINE_START(W90P950EVB, "W90P950EVB") diff --git a/trunk/arch/arm/mach-w90x900/nuc910.c b/trunk/arch/arm/mach-w90x900/nuc910.c index 1523f4136985..656f03b3b629 100644 --- a/trunk/arch/arm/mach-w90x900/nuc910.c +++ b/trunk/arch/arm/mach-w90x900/nuc910.c @@ -26,8 +26,6 @@ static struct platform_device *nuc910_dev[] __initdata = { &nuc900_device_ts, &nuc900_device_rtc, - &nuc900_device_lcd, - &nuc900_device_kpi, }; /* define specific CPU platform io map */ diff --git a/trunk/arch/arm/mach-w90x900/nuc950.c b/trunk/arch/arm/mach-w90x900/nuc950.c index 5704f74a50ee..4d1f1ab044c4 100644 --- a/trunk/arch/arm/mach-w90x900/nuc950.c +++ b/trunk/arch/arm/mach-w90x900/nuc950.c @@ -26,7 +26,9 @@ static struct platform_device *nuc950_dev[] __initdata = { &nuc900_device_kpi, &nuc900_device_fmi, +#ifdef CONFIG_FB_NUC900 &nuc900_device_lcd, +#endif }; /* define specific CPU platform io map */ diff --git a/trunk/arch/sparc/configs/sparc64_defconfig b/trunk/arch/sparc/configs/sparc64_defconfig index 1dc07a0014c1..259e3fd50993 100644 --- a/trunk/arch/sparc/configs/sparc64_defconfig +++ b/trunk/arch/sparc/configs/sparc64_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.34 -# Wed May 26 21:14:01 2010 +# Linux kernel version: 2.6.34-rc3 +# Sat Apr 3 15:49:56 2010 # CONFIG_64BIT=y CONFIG_SPARC=y @@ -107,9 +107,10 @@ CONFIG_PERF_COUNTERS=y # CONFIG_DEBUG_PERF_USE_VMALLOC is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_PCI_QUIRKS=y +CONFIG_SLUB_DEBUG=y # CONFIG_COMPAT_BRK is not set -CONFIG_SLAB=y -# CONFIG_SLUB is not set +# CONFIG_SLAB is not set +CONFIG_SLUB=y # CONFIG_SLOB is not set CONFIG_PROFILING=y CONFIG_TRACEPOINTS=y @@ -238,7 +239,6 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y CONFIG_SPARSEMEM_VMEMMAP=y CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_COMPACTION is not set CONFIG_MIGRATION=y CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_ZONE_DMA_FLAG=0 @@ -351,7 +351,6 @@ CONFIG_IPV6_TUNNEL=m # CONFIG_RDS is not set # CONFIG_TIPC is not set # CONFIG_ATM is not set -# CONFIG_L2TP is not set # CONFIG_BRIDGE is not set # CONFIG_NET_DSA is not set CONFIG_VLAN_8021Q=m @@ -368,7 +367,6 @@ CONFIG_VLAN_8021Q=m # CONFIG_IEEE802154 is not set # CONFIG_NET_SCHED is not set # CONFIG_DCB is not set -CONFIG_RPS=y # # Network testing @@ -388,14 +386,9 @@ CONFIG_WIRELESS=y # # CFG80211 needs to be enabled for MAC80211 # - -# -# Some wireless drivers require a rate control algorithm -# # CONFIG_WIMAX is not set # CONFIG_RFKILL is not set # CONFIG_NET_9P is not set -# CONFIG_CAIF is not set # # Device Drivers @@ -665,7 +658,6 @@ CONFIG_PHYLIB=m # CONFIG_NATIONAL_PHY is not set # CONFIG_STE10XP is not set # CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_MICREL_PHY is not set # CONFIG_MDIO_BITBANG is not set CONFIG_NET_ETHERNET=y CONFIG_MII=m @@ -742,8 +734,6 @@ CONFIG_NETDEV_10000=y # CONFIG_CHELSIO_T1 is not set CONFIG_CHELSIO_T3_DEPENDS=y # CONFIG_CHELSIO_T3 is not set -CONFIG_CHELSIO_T4_DEPENDS=y -# CONFIG_CHELSIO_T4 is not set # CONFIG_ENIC is not set # CONFIG_IXGBE is not set # CONFIG_IXGBEVF is not set @@ -776,7 +766,6 @@ CONFIG_NIU=m # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set -# CONFIG_USB_IPHETH is not set # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set @@ -789,6 +778,7 @@ CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m CONFIG_PPP_MPPE=m CONFIG_PPPOE=m +# CONFIG_PPPOL2TP is not set # CONFIG_SLIP is not set CONFIG_SLHC=m # CONFIG_NET_FC is not set @@ -826,7 +816,6 @@ CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_QT2160 is not set CONFIG_KEYBOARD_LKKBD=m -# CONFIG_KEYBOARD_TCA6416 is not set # CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_OPENCORES is not set @@ -851,7 +840,6 @@ CONFIG_MOUSE_SERIAL=y # CONFIG_INPUT_TABLET is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y -# CONFIG_INPUT_AD714X is not set CONFIG_INPUT_SPARCSPKR=y # CONFIG_INPUT_ATI_REMOTE is not set # CONFIG_INPUT_ATI_REMOTE2 is not set @@ -860,7 +848,6 @@ CONFIG_INPUT_SPARCSPKR=y # CONFIG_INPUT_YEALINK is not set # CONFIG_INPUT_CM109 is not set # CONFIG_INPUT_UINPUT is not set -# CONFIG_INPUT_PCF8574 is not set # # Hardware I/O ports @@ -884,7 +871,6 @@ CONFIG_HW_CONSOLE=y # CONFIG_VT_HW_CONSOLE_BINDING is not set # CONFIG_DEVKMEM is not set # CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set # CONFIG_NOZOMI is not set # @@ -907,8 +893,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set # CONFIG_SERIAL_TIMBERDALE is not set # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set CONFIG_UNIX98_PTYS=y # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set # CONFIG_LEGACY_PTYS is not set @@ -1322,14 +1306,11 @@ CONFIG_USB_HIDDEV=y CONFIG_HID_A4TECH=y CONFIG_HID_APPLE=y CONFIG_HID_BELKIN=y -# CONFIG_HID_CANDO is not set CONFIG_HID_CHERRY=y CONFIG_HID_CHICONY=y -# CONFIG_HID_PRODIKEYS is not set CONFIG_HID_CYPRESS=y CONFIG_HID_DRAGONRISE=y # CONFIG_DRAGONRISE_FF is not set -# CONFIG_HID_EGALAX is not set CONFIG_HID_EZKEY=y CONFIG_HID_KYE=y CONFIG_HID_GYRATION=y @@ -1347,9 +1328,7 @@ CONFIG_HID_ORTEK=y CONFIG_HID_PANTHERLORD=y # CONFIG_PANTHERLORD_FF is not set CONFIG_HID_PETALYNX=y -# CONFIG_HID_PICOLCD is not set # CONFIG_HID_QUANTA is not set -# CONFIG_HID_ROCCAT_KONE is not set CONFIG_HID_SAMSUNG=y CONFIG_HID_SONY=y # CONFIG_HID_STANTUM is not set @@ -1363,7 +1342,6 @@ CONFIG_HID_THRUSTMASTER=y # CONFIG_THRUSTMASTER_FF is not set CONFIG_HID_ZEROPLUS=y # CONFIG_ZEROPLUS_FF is not set -# CONFIG_HID_ZYDACRON is not set CONFIG_USB_SUPPORT=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y @@ -1378,6 +1356,7 @@ CONFIG_USB=y # CONFIG_USB_DEVICEFS is not set # CONFIG_USB_DEVICE_CLASS is not set # CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set # CONFIG_USB_MON is not set # CONFIG_USB_WUSB is not set # CONFIG_USB_WUSB_CBAF is not set @@ -1542,6 +1521,10 @@ CONFIG_RTC_DRV_STARFIRE=y # CONFIG_DMADEVICES is not set # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set + +# +# TI VLYNQ +# # CONFIG_STAGING is not set # @@ -1723,8 +1706,8 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 CONFIG_SCHEDSTATS=y # CONFIG_TIMER_STATS is not set # CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set @@ -1759,9 +1742,6 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y # CONFIG_DEBUG_PAGEALLOC is not set CONFIG_NOP_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y -CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y @@ -1789,12 +1769,12 @@ CONFIG_BLK_DEV_IO_TRACE=y # CONFIG_RING_BUFFER_BENCHMARK is not set # CONFIG_DYNAMIC_DEBUG is not set # CONFIG_DMA_API_DEBUG is not set -# CONFIG_ATOMIC64_SELFTEST is not set # CONFIG_SAMPLES is not set CONFIG_HAVE_ARCH_KGDB=y # CONFIG_KGDB is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUG_DCFLUSH is not set +# CONFIG_STACK_DEBUG is not set # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set # @@ -1915,7 +1895,6 @@ CONFIG_CRYPTO_DEFLATE=y # # CONFIG_CRYPTO_ANSI_CPRNG is not set CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_NIAGARA2 is not set # CONFIG_CRYPTO_DEV_HIFN_795X is not set CONFIG_BINARY_PRINTF=y diff --git a/trunk/arch/sparc/include/asm/cache.h b/trunk/arch/sparc/include/asm/cache.h index 69358b590c91..0588b8c7faa2 100644 --- a/trunk/arch/sparc/include/asm/cache.h +++ b/trunk/arch/sparc/include/asm/cache.h @@ -11,6 +11,7 @@ #define L1_CACHE_SHIFT 5 #define L1_CACHE_BYTES 32 +#define L1_CACHE_ALIGN(x) ((((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))) #ifdef CONFIG_SPARC32 #define SMP_CACHE_BYTES_SHIFT 5 diff --git a/trunk/arch/sparc/include/asm/pgtable_32.h b/trunk/arch/sparc/include/asm/pgtable_32.h index 0ece77f47753..77f906d8cc21 100644 --- a/trunk/arch/sparc/include/asm/pgtable_32.h +++ b/trunk/arch/sparc/include/asm/pgtable_32.h @@ -142,12 +142,13 @@ BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t) #define pmd_page(pmd) BTFIXUP_CALL(pmd_page)(pmd) #define pgd_page_vaddr(pgd) BTFIXUP_CALL(pgd_page_vaddr)(pgd) +BTFIXUPDEF_SETHI(none_mask) BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) BTFIXUPDEF_CALL(void, pte_clear, pte_t *) static inline int pte_none(pte_t pte) { - return !pte_val(pte); + return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask)); } #define pte_present(pte) BTFIXUP_CALL(pte_present)(pte) @@ -159,7 +160,7 @@ BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *) static inline int pmd_none(pmd_t pmd) { - return !pmd_val(pmd); + return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask)); } #define pmd_bad(pmd) BTFIXUP_CALL(pmd_bad)(pmd) diff --git a/trunk/arch/sparc/kernel/perf_event.c b/trunk/arch/sparc/kernel/perf_event.c index 44faabc3c02c..0ec92c8861dd 100644 --- a/trunk/arch/sparc/kernel/perf_event.c +++ b/trunk/arch/sparc/kernel/perf_event.c @@ -657,7 +657,6 @@ static u64 maybe_change_configuration(struct cpu_hw_events *cpuc, u64 pcr) cpuc->current_idx[i] = idx; enc = perf_event_get_enc(cpuc->events[i]); - pcr &= ~mask_for_index(idx); pcr |= event_encoding(enc, idx); } out: diff --git a/trunk/arch/sparc/kernel/sun4d_irq.c b/trunk/arch/sparc/kernel/sun4d_irq.c index e11b4612dabb..ab036a72de5a 100644 --- a/trunk/arch/sparc/kernel/sun4d_irq.c +++ b/trunk/arch/sparc/kernel/sun4d_irq.c @@ -183,7 +183,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) goto out_unlock; } - if (tmp) + if (action && tmp) tmp->next = action->next; else *actionp = action->next; diff --git a/trunk/arch/sparc/kernel/ttable.S b/trunk/arch/sparc/kernel/ttable.S index c6dfdaa29e20..76d837fc47d3 100644 --- a/trunk/arch/sparc/kernel/ttable.S +++ b/trunk/arch/sparc/kernel/ttable.S @@ -64,7 +64,7 @@ tl0_irq6: TRAP_IRQ(smp_call_function_single_client, 6) tl0_irq6: BTRAP(0x46) #endif tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7) -#if defined(CONFIG_KGDB) && defined(CONFIG_SMP) +#ifdef CONFIG_KGDB tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8) #else tl0_irq8: BTRAP(0x48) diff --git a/trunk/arch/sparc/mm/srmmu.c b/trunk/arch/sparc/mm/srmmu.c index b0b43aa5e45a..f5f75a58e0b3 100644 --- a/trunk/arch/sparc/mm/srmmu.c +++ b/trunk/arch/sparc/mm/srmmu.c @@ -2215,6 +2215,8 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_CALL(pmd_page, srmmu_pmd_page, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM); + BTFIXUPSET_SETHI(none_mask, 0xF0000000); + BTFIXUPSET_CALL(pte_present, srmmu_pte_present, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(pte_clear, srmmu_pte_clear, BTFIXUPCALL_SWAPO0G0); diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index 4289f90f8697..cf38846753dd 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -2087,6 +2087,9 @@ void __init ld_mmu_sun4c(void) BTFIXUPSET_CALL(set_pte, sun4c_set_pte, BTFIXUPCALL_STO1O0); + /* The 2.4.18 code does not set this on sun4c, how does it work? XXX */ + /* BTFIXUPSET_SETHI(none_mask, 0x00000000); */ /* Defaults to zero? */ + BTFIXUPSET_CALL(pte_pfn, sun4c_pte_pfn, BTFIXUPCALL_NORM); #if 0 /* PAGE_SHIFT <= 12 */ /* Eek. Investigate. XXX */ BTFIXUPSET_CALL(pmd_page, sun4c_pmd_page, BTFIXUPCALL_ANDNINT(PAGE_SIZE - 1)); diff --git a/trunk/arch/x86/kernel/apic/apic.c b/trunk/arch/x86/kernel/apic/apic.c index a96489ee6cab..c02cc692985c 100644 --- a/trunk/arch/x86/kernel/apic/apic.c +++ b/trunk/arch/x86/kernel/apic/apic.c @@ -921,7 +921,7 @@ void disable_local_APIC(void) unsigned int value; /* APIC hasn't been mapped yet */ - if (!x2apic_mode && !apic_phys) + if (!apic_phys) return; clear_local_APIC(); diff --git a/trunk/arch/x86/kernel/early-quirks.c b/trunk/arch/x86/kernel/early-quirks.c index e5cc7e82e60d..ebdb85cf2686 100644 --- a/trunk/arch/x86/kernel/early-quirks.c +++ b/trunk/arch/x86/kernel/early-quirks.c @@ -18,7 +18,6 @@ #include #include #include -#include static void __init fix_hypertransport_config(int num, int slot, int func) { @@ -192,21 +191,6 @@ static void __init ati_bugs_contd(int num, int slot, int func) } #endif -/* - * Force the read back of the CMP register in hpet_next_event() - * to work around the problem that the CMP register write seems to be - * delayed. See hpet_next_event() for details. - * - * We do this on all SMBUS incarnations for now until we have more - * information about the affected chipsets. - */ -static void __init ati_hpet_bugs(int num, int slot, int func) -{ -#ifdef CONFIG_HPET_TIMER - hpet_readback_cmp = 1; -#endif -} - #define QFLAG_APPLY_ONCE 0x1 #define QFLAG_APPLIED 0x2 #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) @@ -236,8 +220,6 @@ static struct chipset early_qrk[] __initdata = { PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, - { PCI_VENDOR_ID_ATI, PCI_ANY_ID, - PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_hpet_bugs }, {} }; diff --git a/trunk/arch/x86/kernel/kprobes.c b/trunk/arch/x86/kernel/kprobes.c index 675879b65ce6..345a4b1fe144 100644 --- a/trunk/arch/x86/kernel/kprobes.c +++ b/trunk/arch/x86/kernel/kprobes.c @@ -640,8 +640,8 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) /* Skip cs, ip, orig_ax and gs. */ \ " subl $16, %esp\n" \ " pushl %fs\n" \ - " pushl %es\n" \ " pushl %ds\n" \ + " pushl %es\n" \ " pushl %eax\n" \ " pushl %ebp\n" \ " pushl %edi\n" \ diff --git a/trunk/arch/x86/kernel/quirks.c b/trunk/arch/x86/kernel/quirks.c index 939b9e98245f..e72d3fc6547d 100644 --- a/trunk/arch/x86/kernel/quirks.c +++ b/trunk/arch/x86/kernel/quirks.c @@ -498,10 +498,15 @@ void force_hpet_resume(void) * See erratum #27 (Misinterpreted MSI Requests May Result in * Corrupted LPC DMA Data) in AMD Publication #46837, * "SB700 Family Product Errata", Rev. 1.0, March 2010. + * + * Also force the read back of the CMP register in hpet_next_event() + * to work around the problem that the CMP register write seems to be + * delayed. See hpet_next_event() for details. */ static void force_disable_hpet_msi(struct pci_dev *unused) { hpet_msi_disable = 1; + hpet_readback_cmp = 1; } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, diff --git a/trunk/arch/x86/kernel/setup_percpu.c b/trunk/arch/x86/kernel/setup_percpu.c index a60df9ae6454..de3b63ae3da2 100644 --- a/trunk/arch/x86/kernel/setup_percpu.c +++ b/trunk/arch/x86/kernel/setup_percpu.c @@ -238,15 +238,6 @@ void __init setup_per_cpu_areas(void) #ifdef CONFIG_NUMA per_cpu(x86_cpu_to_node_map, cpu) = early_per_cpu_map(x86_cpu_to_node_map, cpu); - /* - * Ensure that the boot cpu numa_node is correct when the boot - * cpu is on a node that doesn't have memory installed. - * Also cpu_up() will call cpu_to_node() for APs when - * MEMORY_HOTPLUG is defined, before per_cpu(numa_node) is set - * up later with c_init aka intel_init/amd_init. - * So set them all (boot cpu and all APs). - */ - set_cpu_numa_node(cpu, early_cpu_to_node(cpu)); #endif #endif /* @@ -266,6 +257,14 @@ void __init setup_per_cpu_areas(void) early_per_cpu_ptr(x86_cpu_to_node_map) = NULL; #endif +#if defined(CONFIG_X86_64) && defined(CONFIG_NUMA) + /* + * make sure boot cpu numa_node is right, when boot cpu is on the + * node that doesn't have mem installed + */ + set_cpu_numa_node(boot_cpu_id, early_cpu_to_node(boot_cpu_id)); +#endif + /* Setup node to cpumask map */ setup_node_to_cpumask_map(); diff --git a/trunk/arch/x86/kvm/mmu.c b/trunk/arch/x86/kvm/mmu.c index b1ed0a1a5913..3699613e8830 100644 --- a/trunk/arch/x86/kvm/mmu.c +++ b/trunk/arch/x86/kvm/mmu.c @@ -2926,7 +2926,7 @@ static int kvm_mmu_remove_some_alloc_mmu_pages(struct kvm *kvm) return kvm_mmu_zap_page(kvm, page) + 1; } -static int mmu_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) +static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask) { struct kvm *kvm; struct kvm *kvm_freed = NULL; diff --git a/trunk/arch/x86/pci/i386.c b/trunk/arch/x86/pci/i386.c index 55253095be84..6fdb3ec30c31 100644 --- a/trunk/arch/x86/pci/i386.c +++ b/trunk/arch/x86/pci/i386.c @@ -184,7 +184,6 @@ static void __init pcibios_allocate_resources(int pass) idx, r, disabled, pass); if (pci_claim_resource(dev, idx) < 0) { /* We'll assign a new address later */ - dev->fw_addr[idx] = r->start; r->end -= r->start; r->start = 0; } diff --git a/trunk/arch/x86/pci/mrst.c b/trunk/arch/x86/pci/mrst.c index cb29191cee58..7ef3a2735df3 100644 --- a/trunk/arch/x86/pci/mrst.c +++ b/trunk/arch/x86/pci/mrst.c @@ -66,9 +66,8 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn) devfn, pos, 4, &pcie_cap)) return 0; - if (PCI_EXT_CAP_ID(pcie_cap) == 0x0000 || - PCI_EXT_CAP_ID(pcie_cap) == 0xffff) - break; + if (pcie_cap == 0xffffffff) + return 0; if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) { raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number, @@ -77,7 +76,7 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn) return pos; } - pos = PCI_EXT_CAP_NEXT(pcie_cap); + pos = pcie_cap >> 20; } return 0; diff --git a/trunk/crypto/ablkcipher.c b/trunk/crypto/ablkcipher.c index a854df2a5a4b..98a66103f4f2 100644 --- a/trunk/crypto/ablkcipher.c +++ b/trunk/crypto/ablkcipher.c @@ -165,7 +165,7 @@ static inline int ablkcipher_next_slow(struct ablkcipher_request *req, p = kmalloc(n, GFP_ATOMIC); if (!p) - return ablkcipher_walk_done(req, walk, -ENOMEM); + ablkcipher_walk_done(req, walk, -ENOMEM); base = p + 1; diff --git a/trunk/drivers/clocksource/cs5535-clockevt.c b/trunk/drivers/clocksource/cs5535-clockevt.c index b7dab32ce63c..d7be69f13154 100644 --- a/trunk/drivers/clocksource/cs5535-clockevt.c +++ b/trunk/drivers/clocksource/cs5535-clockevt.c @@ -194,6 +194,6 @@ static int __init cs5535_mfgpt_init(void) module_init(cs5535_mfgpt_init); -MODULE_AUTHOR("Andres Salomon "); +MODULE_AUTHOR("Andres Salomon "); MODULE_DESCRIPTION("CS5535/CS5536 MFGPT clock event driver"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/edac/Kconfig b/trunk/drivers/edac/Kconfig index 0d2f9dbb47e4..aedef7941b22 100644 --- a/trunk/drivers/edac/Kconfig +++ b/trunk/drivers/edac/Kconfig @@ -209,7 +209,7 @@ config EDAC_I5100 config EDAC_MPC85XX tristate "Freescale MPC83xx / MPC85xx" - depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || PPC_85xx) + depends on EDAC_MM_EDAC && FSL_SOC && (PPC_83xx || MPC85xx) help Support for error detection and correction on the Freescale MPC8349, MPC8560, MPC8540, MPC8548 diff --git a/trunk/drivers/edac/mpc85xx_edac.c b/trunk/drivers/edac/mpc85xx_edac.c index f39b00a46eda..52ca09bf4726 100644 --- a/trunk/drivers/edac/mpc85xx_edac.c +++ b/trunk/drivers/edac/mpc85xx_edac.c @@ -1120,7 +1120,6 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = { { .compatible = "fsl,mpc8555-memory-controller", }, { .compatible = "fsl,mpc8560-memory-controller", }, { .compatible = "fsl,mpc8568-memory-controller", }, - { .compatible = "fsl,mpc8569-memory-controller", }, { .compatible = "fsl,mpc8572-memory-controller", }, { .compatible = "fsl,mpc8349-memory-controller", }, { .compatible = "fsl,p2020-memory-controller", }, diff --git a/trunk/drivers/gpio/cs5535-gpio.c b/trunk/drivers/gpio/cs5535-gpio.c index e23c06893d19..f73a1555e49d 100644 --- a/trunk/drivers/gpio/cs5535-gpio.c +++ b/trunk/drivers/gpio/cs5535-gpio.c @@ -352,6 +352,6 @@ static void __exit cs5535_gpio_exit(void) module_init(cs5535_gpio_init); module_exit(cs5535_gpio_exit); -MODULE_AUTHOR("Andres Salomon "); +MODULE_AUTHOR("Andres Salomon "); MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/gpu/drm/i915/i915_gem.c b/trunk/drivers/gpu/drm/i915/i915_gem.c index 51bd301cf10d..074385882ccf 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem.c @@ -2241,7 +2241,6 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, page = read_cache_page_gfp(mapping, i, GFP_HIGHUSER | __GFP_COLD | - __GFP_RECLAIMABLE | gfpmask); if (IS_ERR(page)) goto err_pages; @@ -4742,16 +4741,6 @@ i915_gem_load(struct drm_device *dev) list_add(&dev_priv->mm.shrink_list, &shrink_list); spin_unlock(&shrink_list_lock); - /* On GEN3 we really need to make sure the ARB C3 LP bit is set */ - if (IS_GEN3(dev)) { - u32 tmp = I915_READ(MI_ARB_STATE); - if (!(tmp & MI_ARB_C3_LP_WRITE_ENABLE)) { - /* arb state is a masked write, so set bit + bit in mask */ - tmp = MI_ARB_C3_LP_WRITE_ENABLE | (MI_ARB_C3_LP_WRITE_ENABLE << MI_ARB_MASK_SHIFT); - I915_WRITE(MI_ARB_STATE, tmp); - } - } - /* Old X drivers will take 0-2 for front, back, depth buffers */ if (!drm_core_check_feature(dev, DRIVER_MODESET)) dev_priv->fence_reg_start = 3; @@ -4988,7 +4977,7 @@ i915_gpu_is_active(struct drm_device *dev) } static int -i915_gem_shrink(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) +i915_gem_shrink(int nr_to_scan, gfp_t gfp_mask) { drm_i915_private_t *dev_priv, *next_dev; struct drm_i915_gem_object *obj_priv, *next_obj; diff --git a/trunk/drivers/gpu/drm/i915/i915_reg.h b/trunk/drivers/gpu/drm/i915/i915_reg.h index 6d9b0288272a..150400f40534 100644 --- a/trunk/drivers/gpu/drm/i915/i915_reg.h +++ b/trunk/drivers/gpu/drm/i915/i915_reg.h @@ -359,70 +359,6 @@ #define LM_BURST_LENGTH 0x00000700 #define LM_FIFO_WATERMARK 0x0000001F #define MI_ARB_STATE 0x020e4 /* 915+ only */ -#define MI_ARB_MASK_SHIFT 16 /* shift for enable bits */ - -/* Make render/texture TLB fetches lower priorty than associated data - * fetches. This is not turned on by default - */ -#define MI_ARB_RENDER_TLB_LOW_PRIORITY (1 << 15) - -/* Isoch request wait on GTT enable (Display A/B/C streams). - * Make isoch requests stall on the TLB update. May cause - * display underruns (test mode only) - */ -#define MI_ARB_ISOCH_WAIT_GTT (1 << 14) - -/* Block grant count for isoch requests when block count is - * set to a finite value. - */ -#define MI_ARB_BLOCK_GRANT_MASK (3 << 12) -#define MI_ARB_BLOCK_GRANT_8 (0 << 12) /* for 3 display planes */ -#define MI_ARB_BLOCK_GRANT_4 (1 << 12) /* for 2 display planes */ -#define MI_ARB_BLOCK_GRANT_2 (2 << 12) /* for 1 display plane */ -#define MI_ARB_BLOCK_GRANT_0 (3 << 12) /* don't use */ - -/* Enable render writes to complete in C2/C3/C4 power states. - * If this isn't enabled, render writes are prevented in low - * power states. That seems bad to me. - */ -#define MI_ARB_C3_LP_WRITE_ENABLE (1 << 11) - -/* This acknowledges an async flip immediately instead - * of waiting for 2TLB fetches. - */ -#define MI_ARB_ASYNC_FLIP_ACK_IMMEDIATE (1 << 10) - -/* Enables non-sequential data reads through arbiter - */ -#define MI_ARB_DUAL_DATA_PHASE_DISABLE (1 << 9) - -/* Disable FSB snooping of cacheable write cycles from binner/render - * command stream - */ -#define MI_ARB_CACHE_SNOOP_DISABLE (1 << 8) - -/* Arbiter time slice for non-isoch streams */ -#define MI_ARB_TIME_SLICE_MASK (7 << 5) -#define MI_ARB_TIME_SLICE_1 (0 << 5) -#define MI_ARB_TIME_SLICE_2 (1 << 5) -#define MI_ARB_TIME_SLICE_4 (2 << 5) -#define MI_ARB_TIME_SLICE_6 (3 << 5) -#define MI_ARB_TIME_SLICE_8 (4 << 5) -#define MI_ARB_TIME_SLICE_10 (5 << 5) -#define MI_ARB_TIME_SLICE_14 (6 << 5) -#define MI_ARB_TIME_SLICE_16 (7 << 5) - -/* Low priority grace period page size */ -#define MI_ARB_LOW_PRIORITY_GRACE_4KB (0 << 4) /* default */ -#define MI_ARB_LOW_PRIORITY_GRACE_8KB (1 << 4) - -/* Disable display A/B trickle feed */ -#define MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE (1 << 2) - -/* Set display plane priority */ -#define MI_ARB_DISPLAY_PRIORITY_A_B (0 << 0) /* display A > display B */ -#define MI_ARB_DISPLAY_PRIORITY_B_A (1 << 0) /* display B > display A */ - #define CACHE_MODE_0 0x02120 /* 915+ only */ #define CM0_MASK_SHIFT 16 #define CM0_IZ_OPT_DISABLE (1<<6) diff --git a/trunk/drivers/gpu/drm/nouveau/nouveau_bios.c b/trunk/drivers/gpu/drm/nouveau/nouveau_bios.c index e492919faf44..fc924b649195 100644 --- a/trunk/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/trunk/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -203,26 +203,36 @@ struct methods { const bool rw; }; -static struct methods shadow_methods[] = { - { "PRAMIN", load_vbios_pramin, true }, +static struct methods nv04_methods[] = { { "PROM", load_vbios_prom, false }, + { "PRAMIN", load_vbios_pramin, true }, { "PCIROM", load_vbios_pci, true }, +}; + +static struct methods nv50_methods[] = { { "ACPI", load_vbios_acpi, true }, + { "PRAMIN", load_vbios_pramin, true }, + { "PROM", load_vbios_prom, false }, + { "PCIROM", load_vbios_pci, true }, }; +#define METHODCNT 3 + static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) { - const int nr_methods = ARRAY_SIZE(shadow_methods); - struct methods *methods = shadow_methods; + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct methods *methods; + int i; int testscore = 3; - int scores[nr_methods], i; + int scores[METHODCNT]; if (nouveau_vbios) { - for (i = 0; i < nr_methods; i++) + methods = nv04_methods; + for (i = 0; i < METHODCNT; i++) if (!strcasecmp(nouveau_vbios, methods[i].desc)) break; - if (i < nr_methods) { + if (i < METHODCNT) { NV_INFO(dev, "Attempting to use BIOS image from %s\n", methods[i].desc); @@ -234,7 +244,12 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios); } - for (i = 0; i < nr_methods; i++) { + if (dev_priv->card_type < NV_50) + methods = nv04_methods; + else + methods = nv50_methods; + + for (i = 0; i < METHODCNT; i++) { NV_TRACE(dev, "Attempting to load BIOS image from %s\n", methods[i].desc); data[0] = data[1] = 0; /* avoid reuse of previous image */ @@ -245,7 +260,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data) } while (--testscore > 0) { - for (i = 0; i < nr_methods; i++) { + for (i = 0; i < METHODCNT; i++) { if (scores[i] == testscore) { NV_TRACE(dev, "Using BIOS image from %s\n", methods[i].desc); diff --git a/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 257ea130ae13..c9a4a0d2a115 100644 --- a/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -387,8 +387,7 @@ int nouveau_fbcon_init(struct drm_device *dev) dev_priv->nfbdev = nfbdev; nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; - ret = drm_fb_helper_init(dev, &nfbdev->helper, - nv_two_heads(dev) ? 2 : 1, 4); + ret = drm_fb_helper_init(dev, &nfbdev->helper, 2, 4); if (ret) { kfree(nfbdev); return ret; diff --git a/trunk/drivers/gpu/drm/radeon/r100.c b/trunk/drivers/gpu/drm/radeon/r100.c index aab5ba040bd6..3970e62eaab8 100644 --- a/trunk/drivers/gpu/drm/radeon/r100.c +++ b/trunk/drivers/gpu/drm/radeon/r100.c @@ -2354,7 +2354,6 @@ void r100_mc_init(struct radeon_device *rdev) if (rdev->flags & RADEON_IS_IGP) base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = 0; if (!(rdev->flags & RADEON_IS_AGP)) radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); diff --git a/trunk/drivers/gpu/drm/radeon/r300.c b/trunk/drivers/gpu/drm/radeon/r300.c index 19a7ef7ee344..7e81db5eb804 100644 --- a/trunk/drivers/gpu/drm/radeon/r300.c +++ b/trunk/drivers/gpu/drm/radeon/r300.c @@ -481,7 +481,6 @@ void r300_mc_init(struct radeon_device *rdev) if (rdev->flags & RADEON_IS_IGP) base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = 0; if (!(rdev->flags & RADEON_IS_AGP)) radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); @@ -1177,8 +1176,6 @@ int r300_cs_parse(struct radeon_cs_parser *p) int r; track = kzalloc(sizeof(*track), GFP_KERNEL); - if (track == NULL) - return -ENOMEM; r100_cs_track_clear(p->rdev, track); p->track = track; do { diff --git a/trunk/drivers/gpu/drm/radeon/r520.c b/trunk/drivers/gpu/drm/radeon/r520.c index 694af7cc23ac..34330df28483 100644 --- a/trunk/drivers/gpu/drm/radeon/r520.c +++ b/trunk/drivers/gpu/drm/radeon/r520.c @@ -125,7 +125,6 @@ void r520_mc_init(struct radeon_device *rdev) r520_vram_get_type(rdev); r100_vram_init_sizes(rdev); radeon_vram_location(rdev, &rdev->mc, 0); - rdev->mc.gtt_base_align = 0; if (!(rdev->flags & RADEON_IS_AGP)) radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); diff --git a/trunk/drivers/gpu/drm/radeon/r600.c b/trunk/drivers/gpu/drm/radeon/r600.c index e100f69faeec..3d6645ce2151 100644 --- a/trunk/drivers/gpu/drm/radeon/r600.c +++ b/trunk/drivers/gpu/drm/radeon/r600.c @@ -1179,7 +1179,6 @@ void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) if (rdev->flags & RADEON_IS_IGP) base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = 0; radeon_gtt_location(rdev, mc); } } diff --git a/trunk/drivers/gpu/drm/radeon/r600_blit.c b/trunk/drivers/gpu/drm/radeon/r600_blit.c index ca5c29f70779..f4fb88ece2bb 100644 --- a/trunk/drivers/gpu/drm/radeon/r600_blit.c +++ b/trunk/drivers/gpu/drm/radeon/r600_blit.c @@ -538,12 +538,9 @@ int r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv) { drm_radeon_private_t *dev_priv = dev->dev_private; - int ret; DRM_DEBUG("\n"); - ret = r600_nomm_get_vb(dev); - if (ret) - return ret; + r600_nomm_get_vb(dev); dev_priv->blit_vb->file_priv = file_priv; diff --git a/trunk/drivers/gpu/drm/radeon/radeon.h b/trunk/drivers/gpu/drm/radeon/radeon.h index 2f94dc66c183..ab61aaa887bb 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon.h +++ b/trunk/drivers/gpu/drm/radeon/radeon.h @@ -351,7 +351,6 @@ struct radeon_mc { int vram_mtrr; bool vram_is_ddr; bool igp_sideport_enabled; - u64 gtt_base_align; }; bool radeon_combios_sideport_present(struct radeon_device *rdev); diff --git a/trunk/drivers/gpu/drm/radeon/radeon_atombios.c b/trunk/drivers/gpu/drm/radeon/radeon_atombios.c index 10673ae59cfa..99bd8a9c56b3 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_atombios.c @@ -280,15 +280,6 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, } } - /* ASUS HD 3600 board lists the DVI port as HDMI */ - if ((dev->pdev->device == 0x9598) && - (dev->pdev->subsystem_vendor == 0x1043) && - (dev->pdev->subsystem_device == 0x01e4)) { - if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) { - *connector_type = DRM_MODE_CONNECTOR_DVII; - } - } - /* ASUS HD 3450 board lists the DVI port as HDMI */ if ((dev->pdev->device == 0x95C5) && (dev->pdev->subsystem_vendor == 0x1043) && @@ -1038,15 +1029,8 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev) data_offset); switch (crev) { case 1: - /* AMD IGPS */ - if ((rdev->family == CHIP_RS690) || - (rdev->family == CHIP_RS740)) { - if (igp_info->info.ulBootUpMemoryClock) - return true; - } else { - if (igp_info->info.ucMemoryType & 0xf0) - return true; - } + if (igp_info->info.ucMemoryType & 0xf0) + return true; break; case 2: if (igp_info->info_2.ucMemoryType & 0x0f) diff --git a/trunk/drivers/gpu/drm/radeon/radeon_connectors.c b/trunk/drivers/gpu/drm/radeon/radeon_connectors.c index adccbc2c202c..f58f8bd8f77b 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_connectors.c @@ -771,14 +771,14 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect } else ret = connector_status_connected; - /* This gets complicated. We have boards with VGA + HDMI with a - * shared DDC line and we have boards with DVI-D + HDMI with a shared - * DDC line. The latter is more complex because with DVI<->HDMI adapters - * you don't really know what's connected to which port as both are digital. + /* multiple connectors on the same encoder with the same ddc line + * This tends to be HDMI and DVI on the same encoder with the + * same ddc line. If the edid says HDMI, consider the HDMI port + * connected and the DVI port disconnected. If the edid doesn't + * say HDMI, vice versa. */ if (radeon_connector->shared_ddc && (ret == connector_status_connected)) { struct drm_device *dev = connector->dev; - struct radeon_device *rdev = dev->dev_private; struct drm_connector *list_connector; struct radeon_connector *list_radeon_connector; list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { @@ -788,10 +788,15 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect if (list_radeon_connector->shared_ddc && (list_radeon_connector->ddc_bus->rec.i2c_id == radeon_connector->ddc_bus->rec.i2c_id)) { - /* cases where both connectors are digital */ - if (list_connector->connector_type != DRM_MODE_CONNECTOR_VGA) { - /* hpd is our only option in this case */ - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { + if (drm_detect_hdmi_monitor(radeon_connector->edid)) { + if (connector->connector_type == DRM_MODE_CONNECTOR_DVID) { + kfree(radeon_connector->edid); + radeon_connector->edid = NULL; + ret = connector_status_disconnected; + } + } else { + if ((connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) || + (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)) { kfree(radeon_connector->edid); radeon_connector->edid = NULL; ret = connector_status_disconnected; diff --git a/trunk/drivers/gpu/drm/radeon/radeon_device.c b/trunk/drivers/gpu/drm/radeon/radeon_device.c index dd279da90546..5f317317aba2 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_device.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_device.c @@ -226,20 +226,20 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) { u64 size_af, size_bf; - size_af = ((0xFFFFFFFF - mc->vram_end) + mc->gtt_base_align) & ~mc->gtt_base_align; - size_bf = mc->vram_start & ~mc->gtt_base_align; + size_af = 0xFFFFFFFF - mc->vram_end; + size_bf = mc->vram_start; if (size_bf > size_af) { if (mc->gtt_size > size_bf) { dev_warn(rdev->dev, "limiting GTT\n"); mc->gtt_size = size_bf; } - mc->gtt_start = (mc->vram_start & ~mc->gtt_base_align) - mc->gtt_size; + mc->gtt_start = mc->vram_start - mc->gtt_size; } else { if (mc->gtt_size > size_af) { dev_warn(rdev->dev, "limiting GTT\n"); mc->gtt_size = size_af; } - mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; + mc->gtt_start = mc->vram_end + 1; } mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n", diff --git a/trunk/drivers/gpu/drm/radeon/radeon_legacy_tv.c b/trunk/drivers/gpu/drm/radeon/radeon_legacy_tv.c index 032040397743..f2ed27c8055b 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_legacy_tv.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_legacy_tv.c @@ -642,8 +642,8 @@ void radeon_legacy_tv_mode_set(struct drm_encoder *encoder, } flicker_removal = (tmp + 500) / 1000; - if (flicker_removal < 3) - flicker_removal = 3; + if (flicker_removal < 2) + flicker_removal = 2; for (i = 0; i < ARRAY_SIZE(SLOPE_limit); ++i) { if (flicker_removal == SLOPE_limit[i]) break; diff --git a/trunk/drivers/gpu/drm/radeon/rs400.c b/trunk/drivers/gpu/drm/radeon/rs400.c index f454c9a5e7f2..9e4240b3bf0b 100644 --- a/trunk/drivers/gpu/drm/radeon/rs400.c +++ b/trunk/drivers/gpu/drm/radeon/rs400.c @@ -57,9 +57,7 @@ void rs400_gart_adjust_size(struct radeon_device *rdev) } if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) { /* FIXME: RS400 & RS480 seems to have issue with GART size - * if 4G of system memory (needs more testing) - */ - /* XXX is this still an issue with proper alignment? */ + * if 4G of system memory (needs more testing) */ rdev->mc.gtt_size = 32 * 1024 * 1024; DRM_ERROR("Forcing to 32M GART size (because of ASIC bug ?)\n"); } @@ -265,7 +263,6 @@ void rs400_mc_init(struct radeon_device *rdev) r100_vram_init_sizes(rdev); base = (RREG32(RADEON_NB_TOM) & 0xffff) << 16; radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1; radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); } diff --git a/trunk/drivers/gpu/drm/radeon/rs600.c b/trunk/drivers/gpu/drm/radeon/rs600.c index 6dc15ea8ba33..7bb4c3e52f3b 100644 --- a/trunk/drivers/gpu/drm/radeon/rs600.c +++ b/trunk/drivers/gpu/drm/radeon/rs600.c @@ -698,7 +698,6 @@ void rs600_mc_init(struct radeon_device *rdev) base = G_000004_MC_FB_START(base) << 16; rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = 0; radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); } diff --git a/trunk/drivers/gpu/drm/radeon/rs690.c b/trunk/drivers/gpu/drm/radeon/rs690.c index ce4ecbe10816..f4f0a61bcdce 100644 --- a/trunk/drivers/gpu/drm/radeon/rs690.c +++ b/trunk/drivers/gpu/drm/radeon/rs690.c @@ -162,7 +162,6 @@ void rs690_mc_init(struct radeon_device *rdev) rs690_pm_info(rdev); rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); radeon_vram_location(rdev, &rdev->mc, base); - rdev->mc.gtt_base_align = rdev->mc.gtt_size - 1; radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); } diff --git a/trunk/drivers/gpu/drm/radeon/rv515.c b/trunk/drivers/gpu/drm/radeon/rv515.c index 0c9c169a6852..7d9a7b0a180a 100644 --- a/trunk/drivers/gpu/drm/radeon/rv515.c +++ b/trunk/drivers/gpu/drm/radeon/rv515.c @@ -195,7 +195,6 @@ void rv515_mc_init(struct radeon_device *rdev) rv515_vram_get_type(rdev); r100_vram_init_sizes(rdev); radeon_vram_location(rdev, &rdev->mc, 0); - rdev->mc.gtt_base_align = 0; if (!(rdev->flags & RADEON_IS_AGP)) radeon_gtt_location(rdev, &rdev->mc); radeon_update_bandwidth_info(rdev); diff --git a/trunk/drivers/gpu/drm/ttm/ttm_page_alloc.c b/trunk/drivers/gpu/drm/ttm/ttm_page_alloc.c index d233c65f3f7f..b1d67dc973dc 100644 --- a/trunk/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/trunk/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -40,9 +40,7 @@ #include #include -#ifdef TTM_HAS_AGP #include -#endif #include "ttm/ttm_bo_driver.h" #include "ttm/ttm_page_alloc.h" @@ -394,7 +392,7 @@ static int ttm_pool_get_num_unused_pages(void) /** * Callback for mm to request pool to reduce number of page held. */ -static int ttm_pool_mm_shrink(struct shrinker *shrink, int shrink_pages, gfp_t gfp_mask) +static int ttm_pool_mm_shrink(int shrink_pages, gfp_t gfp_mask) { static atomic_t start_pool = ATOMIC_INIT(0); unsigned i; diff --git a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 437ac786277a..f1d626112415 100644 --- a/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/trunk/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -972,7 +972,6 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, ret = copy_from_user(rects, user_rects, rects_size); if (unlikely(ret != 0)) { DRM_ERROR("Failed to get rects.\n"); - ret = -EFAULT; goto out_free; } diff --git a/trunk/drivers/input/mouse/synaptics.c b/trunk/drivers/input/mouse/synaptics.c index 9ba9c4a17e15..40cea334ad13 100644 --- a/trunk/drivers/input/mouse/synaptics.c +++ b/trunk/drivers/input/mouse/synaptics.c @@ -206,7 +206,6 @@ static int synaptics_resolution(struct psmouse *psmouse) unsigned char max[3]; if (SYN_ID_MAJOR(priv->identity) < 4) - return 0; if (synaptics_send_cmd(psmouse, SYN_QUE_RESOLUTION, res) == 0) { if (res[0] != 0 && (res[1] & 0x80) && res[2] != 0) { diff --git a/trunk/drivers/input/touchscreen/w90p910_ts.c b/trunk/drivers/input/touchscreen/w90p910_ts.c index 7a45d68c3516..cc18265be1a8 100644 --- a/trunk/drivers/input/touchscreen/w90p910_ts.c +++ b/trunk/drivers/input/touchscreen/w90p910_ts.c @@ -233,7 +233,7 @@ static int __devinit w90x900ts_probe(struct platform_device *pdev) w90p910_ts->state = TS_IDLE; spin_lock_init(&w90p910_ts->lock); setup_timer(&w90p910_ts->timer, w90p910_check_pen_up, - (unsigned long)w90p910_ts); + (unsigned long)&w90p910_ts); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { diff --git a/trunk/drivers/misc/cs5535-mfgpt.c b/trunk/drivers/misc/cs5535-mfgpt.c index 2d44b3300104..9bec24db4d41 100644 --- a/trunk/drivers/misc/cs5535-mfgpt.c +++ b/trunk/drivers/misc/cs5535-mfgpt.c @@ -366,6 +366,6 @@ static int __init cs5535_mfgpt_init(void) module_init(cs5535_mfgpt_init); -MODULE_AUTHOR("Andres Salomon "); +MODULE_AUTHOR("Andres Salomon "); MODULE_DESCRIPTION("CS5535/CS5536 MFGPT timer driver"); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/mmc/host/sdhci-s3c.c b/trunk/drivers/mmc/host/sdhci-s3c.c index ad30f074ee15..af217924a76e 100644 --- a/trunk/drivers/mmc/host/sdhci-s3c.c +++ b/trunk/drivers/mmc/host/sdhci-s3c.c @@ -365,26 +365,6 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) static int __devexit sdhci_s3c_remove(struct platform_device *pdev) { - struct sdhci_host *host = platform_get_drvdata(pdev); - struct sdhci_s3c *sc = sdhci_priv(host); - int ptr; - - sdhci_remove_host(host, 1); - - for (ptr = 0; ptr < 3; ptr++) { - clk_disable(sc->clk_bus[ptr]); - clk_put(sc->clk_bus[ptr]); - } - clk_disable(sc->clk_io); - clk_put(sc->clk_io); - - iounmap(host->ioaddr); - release_resource(sc->ioarea); - kfree(sc->ioarea); - - sdhci_free_host(host); - platform_set_drvdata(pdev, NULL); - return 0; } diff --git a/trunk/drivers/net/ibmveth.c b/trunk/drivers/net/ibmveth.c index 2602852cc55a..7acb3edc47ef 100644 --- a/trunk/drivers/net/ibmveth.c +++ b/trunk/drivers/net/ibmveth.c @@ -677,7 +677,7 @@ static int ibmveth_close(struct net_device *netdev) if (!adapter->pool_config) netif_stop_queue(netdev); - h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); + free_irq(netdev->irq, netdev); do { lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); @@ -689,8 +689,6 @@ static int ibmveth_close(struct net_device *netdev) lpar_rc); } - free_irq(netdev->irq, netdev); - adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8); ibmveth_cleanup(adapter); diff --git a/trunk/drivers/net/pcmcia/axnet_cs.c b/trunk/drivers/net/pcmcia/axnet_cs.c index 33525bf2a3d3..5b3dfb4ab279 100644 --- a/trunk/drivers/net/pcmcia/axnet_cs.c +++ b/trunk/drivers/net/pcmcia/axnet_cs.c @@ -1168,7 +1168,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) int interrupts, nr_serviced = 0, i; struct ei_device *ei_local; int handled = 0; - unsigned long flags; e8390_base = dev->base_addr; ei_local = netdev_priv(dev); @@ -1177,7 +1176,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) * Protect the irq test too. */ - spin_lock_irqsave(&ei_local->page_lock, flags); + spin_lock(&ei_local->page_lock); if (ei_local->irqlock) { @@ -1189,7 +1188,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) dev->name, inb_p(e8390_base + EN0_ISR), inb_p(e8390_base + EN0_IMR)); #endif - spin_unlock_irqrestore(&ei_local->page_lock, flags); + spin_unlock(&ei_local->page_lock); return IRQ_NONE; } @@ -1262,7 +1261,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) ei_local->irqlock = 0; outb_p(ENISR_ALL, e8390_base + EN0_IMR); - spin_unlock_irqrestore(&ei_local->page_lock, flags); + spin_unlock(&ei_local->page_lock); return IRQ_RETVAL(handled); } diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c index cdc6a5c2e70d..96b6cfbf0a3a 100644 --- a/trunk/drivers/net/r8169.c +++ b/trunk/drivers/net/r8169.c @@ -1316,7 +1316,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp, { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_26 }, /* 8168C family. */ - { 0x7cf00000, 0x3cb00000, RTL_GIGA_MAC_VER_24 }, + { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 }, { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 }, { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 }, { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 }, diff --git a/trunk/drivers/net/wireless/ath/ath9k/hif_usb.c b/trunk/drivers/net/wireless/ath/ath9k/hif_usb.c index 23c15aa9fbd5..77b359162d6c 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/trunk/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -730,17 +730,13 @@ static int ath9k_hif_usb_alloc_urbs(struct hif_device_usb *hif_dev) /* RX */ if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0) - goto err_rx; + goto err; /* Register Read */ if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0) - goto err_reg; + goto err; return 0; -err_reg: - ath9k_hif_usb_dealloc_rx_urbs(hif_dev); -err_rx: - ath9k_hif_usb_dealloc_tx_urbs(hif_dev); err: return -ENOMEM; } diff --git a/trunk/drivers/net/wireless/hostap/hostap_pci.c b/trunk/drivers/net/wireless/hostap/hostap_pci.c index 972a9c3af39e..d24dc7dc0723 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_pci.c +++ b/trunk/drivers/net/wireless/hostap/hostap_pci.c @@ -330,7 +330,6 @@ static int prism2_pci_probe(struct pci_dev *pdev, dev->irq = pdev->irq; hw_priv->mem_start = mem; - dev->base_addr = (unsigned long) mem; prism2_pci_cor_sreset(local); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.h b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.h index dc43ebd1f1fd..c2a453a1a991 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.h @@ -97,17 +97,6 @@ static inline void iwl_clear_driver_stations(struct iwl_priv *priv) spin_lock_irqsave(&priv->sta_lock, flags); memset(priv->stations, 0, sizeof(priv->stations)); priv->num_stations = 0; - - /* - * Remove all key information that is not stored as part of station - * information since mac80211 may not have had a - * chance to remove all the keys. When device is reconfigured by - * mac80211 after an error all keys will be reconfigured. - */ - priv->ucode_key_table = 0; - priv->key_mapping_key = 0; - memset(priv->wep_keys, 0, sizeof(priv->wep_keys)); - spin_unlock_irqrestore(&priv->sta_lock, flags); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c index f20d3eeeea7f..3ae468c4d760 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -853,11 +853,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) BIT(NL80211_IFTYPE_MESH_POINT) | BIT(NL80211_IFTYPE_WDS); - /* - * Initialize configuration work. - */ - INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); - /* * Let the driver probe the device to detect the capabilities. */ @@ -867,6 +862,11 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) goto exit; } + /* + * Initialize configuration work. + */ + INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); + /* * Allocate queue array. */ diff --git a/trunk/drivers/pci/setup-res.c b/trunk/drivers/pci/setup-res.c index 2aaa13150de3..92379e2d37e7 100644 --- a/trunk/drivers/pci/setup-res.c +++ b/trunk/drivers/pci/setup-res.c @@ -156,38 +156,6 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, pcibios_align_resource, dev); } - if (ret < 0 && dev->fw_addr[resno]) { - struct resource *root, *conflict; - resource_size_t start, end; - - /* - * If we failed to assign anything, let's try the address - * where firmware left it. That at least has a chance of - * working, which is better than just leaving it disabled. - */ - - if (res->flags & IORESOURCE_IO) - root = &ioport_resource; - else - root = &iomem_resource; - - start = res->start; - end = res->end; - res->start = dev->fw_addr[resno]; - res->end = res->start + size - 1; - dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", - resno, res); - conflict = request_resource_conflict(root, res); - if (conflict) { - dev_info(&dev->dev, - "BAR %d: %pR conflicts with %s %pR\n", resno, - res, conflict->name, conflict); - res->start = start; - res->end = end; - } else - ret = 0; - } - if (!ret) { res->flags &= ~IORESOURCE_STARTALIGN; dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); diff --git a/trunk/drivers/pcmcia/pcmcia_resource.c b/trunk/drivers/pcmcia/pcmcia_resource.c index a4cd9adfcbc0..29f91fac1dff 100644 --- a/trunk/drivers/pcmcia/pcmcia_resource.c +++ b/trunk/drivers/pcmcia/pcmcia_resource.c @@ -857,10 +857,8 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) { pcmcia_release_configuration(p_dev); pcmcia_release_io(p_dev, &p_dev->io); - if (p_dev->_irq) { + if (p_dev->_irq) free_irq(p_dev->irq, p_dev->priv); - p_dev->_irq = 0; - } if (p_dev->win) pcmcia_release_window(p_dev, p_dev->win); } diff --git a/trunk/drivers/platform/x86/intel_scu_ipc.c b/trunk/drivers/platform/x86/intel_scu_ipc.c index bb2f1fba637b..40658e3385b4 100644 --- a/trunk/drivers/platform/x86/intel_scu_ipc.c +++ b/trunk/drivers/platform/x86/intel_scu_ipc.c @@ -489,7 +489,7 @@ int intel_scu_ipc_simple_command(int cmd, int sub) mutex_unlock(&ipclock); return -ENODEV; } - ipc_command(sub << 12 | cmd); + ipc_command(cmd << 12 | sub); err = busy_loop(); mutex_unlock(&ipclock); return err; @@ -501,9 +501,9 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command); * @cmd: command * @sub: sub type * @in: input data - * @inlen: input length in dwords + * @inlen: input length * @out: output data - * @outlein: output length in dwords + * @outlein: output length * * Issue a command to the SCU which involves data transfers. Do the * data copies under the lock but leave it for the caller to interpret @@ -524,7 +524,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, for (i = 0; i < inlen; i++) ipc_data_writel(*in++, 4 * i); - ipc_command((sub << 12) | cmd | (inlen << 18)); + ipc_command((cmd << 12) | sub | (inlen << 18)); err = busy_loop(); for (i = 0; i < outlen; i++) @@ -556,10 +556,6 @@ int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data) u32 cmd = 0; mutex_lock(&ipclock); - if (ipcdev.pdev == NULL) { - mutex_unlock(&ipclock); - return -ENODEV; - } cmd = (addr >> 24) & 0xFF; if (cmd == IPC_I2C_READ) { writel(addr, ipcdev.i2c_base + IPC_I2C_CNTRL_ADDR); diff --git a/trunk/drivers/power/ds2782_battery.c b/trunk/drivers/power/ds2782_battery.c index 2afbeec8b791..d762a0cbc6af 100644 --- a/trunk/drivers/power/ds2782_battery.c +++ b/trunk/drivers/power/ds2782_battery.c @@ -163,7 +163,7 @@ static int ds2782_get_capacity(struct ds278x_info *info, int *capacity) if (err) return err; *capacity = raw; - return 0; + return raw; } static int ds2786_get_current(struct ds278x_info *info, int *current_uA) diff --git a/trunk/drivers/s390/block/dasd_devmap.c b/trunk/drivers/s390/block/dasd_devmap.c index bed7b4634ccd..34d51dd4c539 100644 --- a/trunk/drivers/s390/block/dasd_devmap.c +++ b/trunk/drivers/s390/block/dasd_devmap.c @@ -948,10 +948,8 @@ static ssize_t dasd_alias_show(struct device *dev, if (device->discipline && device->discipline->get_uid && !device->discipline->get_uid(device, &uid)) { if (uid.type == UA_BASE_PAV_ALIAS || - uid.type == UA_HYPER_PAV_ALIAS) { - dasd_put_device(device); + uid.type == UA_HYPER_PAV_ALIAS) return sprintf(buf, "1\n"); - } } dasd_put_device(device); diff --git a/trunk/drivers/s390/cio/chsc.c b/trunk/drivers/s390/cio/chsc.c index 407d0e9adfaf..ce7cb87479fe 100644 --- a/trunk/drivers/s390/cio/chsc.c +++ b/trunk/drivers/s390/cio/chsc.c @@ -713,7 +713,7 @@ int chsc_determine_base_channel_path_desc(struct chp_id chpid, ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, chsc_resp); if (ret) goto out_free; - memcpy(desc, &chsc_resp->data, sizeof(*desc)); + memcpy(desc, &chsc_resp->data, chsc_resp->length); out_free: kfree(chsc_resp); return ret; diff --git a/trunk/drivers/sbus/char/openprom.c b/trunk/drivers/sbus/char/openprom.c index aacbe14e2e7a..d53e62ab09da 100644 --- a/trunk/drivers/sbus/char/openprom.c +++ b/trunk/drivers/sbus/char/openprom.c @@ -554,7 +554,7 @@ static int opiocgetnext(unsigned int cmd, void __user *argp) static int openprom_bsd_ioctl(struct file * file, unsigned int cmd, unsigned long arg) { - DATA *data = file->private_data; + DATA *data = (DATA *) file->private_data; void __user *argp = (void __user *)arg; int err; @@ -601,7 +601,7 @@ static int openprom_bsd_ioctl(struct file * file, static long openprom_ioctl(struct file * file, unsigned int cmd, unsigned long arg) { - DATA *data = file->private_data; + DATA *data = (DATA *) file->private_data; switch (cmd) { case OPROMGETOPT: diff --git a/trunk/drivers/serial/suncore.c b/trunk/drivers/serial/suncore.c index 544f2e25d0e5..ed7d958b0a01 100644 --- a/trunk/drivers/serial/suncore.c +++ b/trunk/drivers/serial/suncore.c @@ -71,9 +71,7 @@ int sunserial_console_match(struct console *con, struct device_node *dp, con->index = line; drv->cons = con; - - if (!console_set_on_cmdline) - add_preferred_console(con->name, line, NULL); + add_preferred_console(con->name, line, NULL); return 1; } diff --git a/trunk/drivers/serial/sunsu.c b/trunk/drivers/serial/sunsu.c index ffbf4553f665..234459c2f012 100644 --- a/trunk/drivers/serial/sunsu.c +++ b/trunk/drivers/serial/sunsu.c @@ -1500,25 +1500,20 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m static int __devexit su_remove(struct of_device *op) { struct uart_sunsu_port *up = dev_get_drvdata(&op->dev); - bool kbdms = false; if (up->su_type == SU_PORT_MS || - up->su_type == SU_PORT_KBD) - kbdms = true; - - if (kbdms) { + up->su_type == SU_PORT_KBD) { #ifdef CONFIG_SERIO serio_unregister_port(&up->serio); #endif - } else if (up->port.type != PORT_UNKNOWN) + kfree(up); + } else if (up->port.type != PORT_UNKNOWN) { uart_remove_one_port(&sunsu_reg, &up->port); + } if (up->port.membase) of_iounmap(&op->resource[0], up->port.membase, up->reg_size); - if (kbdms) - kfree(up); - dev_set_drvdata(&op->dev, NULL); return 0; diff --git a/trunk/drivers/usb/gadget/f_fs.c b/trunk/drivers/usb/gadget/f_fs.c index 2aaa0f75c6cf..d69eccf5f197 100644 --- a/trunk/drivers/usb/gadget/f_fs.c +++ b/trunk/drivers/usb/gadget/f_fs.c @@ -136,7 +136,7 @@ struct ffs_data { * handling setup requests immidiatelly user space may be so * slow that another setup will be sent to the gadget but this * time not to us but another function and then there could be - * a race. Is that the case? Or maybe we can use cdev->req + * a race. Is taht the case? Or maybe we can use cdev->req * after all, maybe we just need some spinlock for that? */ struct usb_request *ep0req; /* P: mutex */ struct completion ep0req_completion; /* P: mutex */ diff --git a/trunk/drivers/vhost/net.c b/trunk/drivers/vhost/net.c index d219070fed3d..57a593c58cf4 100644 --- a/trunk/drivers/vhost/net.c +++ b/trunk/drivers/vhost/net.c @@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net) break; } if (err != len) - pr_debug("Truncated TX packet: " - " len %d != %zd\n", err, len); + pr_err("Truncated TX packet: " + " len %d != %zd\n", err, len); vhost_add_used_and_signal(&net->dev, vq, head, 0); total_len += len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { @@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net) } /* TODO: Should check and handle checksum. */ if (err > len) { - pr_debug("Discarded truncated rx packet: " - " len %d > %zd\n", err, len); + pr_err("Discarded truncated rx packet: " + " len %d > %zd\n", err, len); vhost_discard_vq_desc(vq); continue; } @@ -534,16 +534,11 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) rcu_assign_pointer(vq->private_data, sock); vhost_net_enable_vq(n, vq); done: - mutex_unlock(&vq->mutex); - if (oldsock) { vhost_net_flush_vq(n, index); fput(oldsock->file); } - mutex_unlock(&n->dev.mutex); - return 0; - err_vq: mutex_unlock(&vq->mutex); err: diff --git a/trunk/drivers/video/aty/radeon_pm.c b/trunk/drivers/video/aty/radeon_pm.c index c4e17642d9c5..515cf1978d19 100644 --- a/trunk/drivers/video/aty/radeon_pm.c +++ b/trunk/drivers/video/aty/radeon_pm.c @@ -2872,7 +2872,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis } #if 0 - /* Power down TV DAC, that saves a significant amount of power, + /* Power down TV DAC, taht saves a significant amount of power, * we'll have something better once we actually have some TVOut * support */ diff --git a/trunk/fs/btrfs/ctree.c b/trunk/fs/btrfs/ctree.c index c3df14ce2cc2..0d1d966b0fe4 100644 --- a/trunk/fs/btrfs/ctree.c +++ b/trunk/fs/btrfs/ctree.c @@ -2304,17 +2304,12 @@ noinline int btrfs_leaf_free_space(struct btrfs_root *root, return ret; } -/* - * min slot controls the lowest index we're willing to push to the - * right. We'll push up to and including min_slot, but no lower - */ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int data_size, int empty, struct extent_buffer *right, - int free_space, u32 left_nritems, - u32 min_slot) + int free_space, u32 left_nritems) { struct extent_buffer *left = path->nodes[0]; struct extent_buffer *upper = path->nodes[1]; @@ -2332,7 +2327,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, if (empty) nr = 0; else - nr = max_t(u32, 1, min_slot); + nr = 1; if (path->slots[0] >= left_nritems) push_space += data_size; @@ -2474,14 +2469,10 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans, * * returns 1 if the push failed because the other node didn't have enough * room, 0 if everything worked out and < 0 if there were major errors. - * - * this will push starting from min_slot to the end of the leaf. It won't - * push any slot lower than min_slot */ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root - *root, struct btrfs_path *path, - int min_data_size, int data_size, - int empty, u32 min_slot) + *root, struct btrfs_path *path, int data_size, + int empty) { struct extent_buffer *left = path->nodes[0]; struct extent_buffer *right; @@ -2523,8 +2514,8 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root if (left_nritems == 0) goto out_unlock; - return __push_leaf_right(trans, root, path, min_data_size, empty, - right, free_space, left_nritems, min_slot); + return __push_leaf_right(trans, root, path, data_size, empty, + right, free_space, left_nritems); out_unlock: btrfs_tree_unlock(right); free_extent_buffer(right); @@ -2534,17 +2525,12 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root /* * push some data in the path leaf to the left, trying to free up at * least data_size bytes. returns zero if the push worked, nonzero otherwise - * - * max_slot can put a limit on how far into the leaf we'll push items. The - * item at 'max_slot' won't be touched. Use (u32)-1 to make us do all the - * items */ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int data_size, int empty, struct extent_buffer *left, - int free_space, u32 right_nritems, - u32 max_slot) + int free_space, int right_nritems) { struct btrfs_disk_key disk_key; struct extent_buffer *right = path->nodes[0]; @@ -2563,9 +2549,9 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, slot = path->slots[1]; if (empty) - nr = min(right_nritems, max_slot); + nr = right_nritems; else - nr = min(right_nritems - 1, max_slot); + nr = right_nritems - 1; for (i = 0; i < nr; i++) { item = btrfs_item_nr(right, i); @@ -2726,14 +2712,10 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, /* * push some data in the path leaf to the left, trying to free up at * least data_size bytes. returns zero if the push worked, nonzero otherwise - * - * max_slot can put a limit on how far into the leaf we'll push items. The - * item at 'max_slot' won't be touched. Use (u32)-1 to make us push all the - * items */ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root - *root, struct btrfs_path *path, int min_data_size, - int data_size, int empty, u32 max_slot) + *root, struct btrfs_path *path, int data_size, + int empty) { struct extent_buffer *right = path->nodes[0]; struct extent_buffer *left; @@ -2779,9 +2761,8 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root goto out; } - return __push_leaf_left(trans, root, path, min_data_size, - empty, left, free_space, right_nritems, - max_slot); + return __push_leaf_left(trans, root, path, data_size, + empty, left, free_space, right_nritems); out: btrfs_tree_unlock(left); free_extent_buffer(left); @@ -2873,64 +2854,6 @@ static noinline int copy_for_split(struct btrfs_trans_handle *trans, return ret; } -/* - * double splits happen when we need to insert a big item in the middle - * of a leaf. A double split can leave us with 3 mostly empty leaves: - * leaf: [ slots 0 - N] [ our target ] [ N + 1 - total in leaf ] - * A B C - * - * We avoid this by trying to push the items on either side of our target - * into the adjacent leaves. If all goes well we can avoid the double split - * completely. - */ -static noinline int push_for_double_split(struct btrfs_trans_handle *trans, - struct btrfs_root *root, - struct btrfs_path *path, - int data_size) -{ - int ret; - int progress = 0; - int slot; - u32 nritems; - - slot = path->slots[0]; - - /* - * try to push all the items after our slot into the - * right leaf - */ - ret = push_leaf_right(trans, root, path, 1, data_size, 0, slot); - if (ret < 0) - return ret; - - if (ret == 0) - progress++; - - nritems = btrfs_header_nritems(path->nodes[0]); - /* - * our goal is to get our slot at the start or end of a leaf. If - * we've done so we're done - */ - if (path->slots[0] == 0 || path->slots[0] == nritems) - return 0; - - if (btrfs_leaf_free_space(root, path->nodes[0]) >= data_size) - return 0; - - /* try to push all the items before our slot into the next leaf */ - slot = path->slots[0]; - ret = push_leaf_left(trans, root, path, 1, data_size, 0, slot); - if (ret < 0) - return ret; - - if (ret == 0) - progress++; - - if (progress) - return 0; - return 1; -} - /* * split the path's leaf in two, making sure there is at least data_size * available for the resulting leaf level of the path. @@ -2953,7 +2876,6 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, int wret; int split; int num_doubles = 0; - int tried_avoid_double = 0; l = path->nodes[0]; slot = path->slots[0]; @@ -2962,14 +2884,12 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, return -EOVERFLOW; /* first try to make some room by pushing left and right */ - if (data_size) { - wret = push_leaf_right(trans, root, path, data_size, - data_size, 0, 0); + if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) { + wret = push_leaf_right(trans, root, path, data_size, 0); if (wret < 0) return wret; if (wret) { - wret = push_leaf_left(trans, root, path, data_size, - data_size, 0, (u32)-1); + wret = push_leaf_left(trans, root, path, data_size, 0); if (wret < 0) return wret; } @@ -3003,8 +2923,6 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, if (mid != nritems && leaf_space_used(l, mid, nritems - mid) + data_size > BTRFS_LEAF_DATA_SIZE(root)) { - if (data_size && !tried_avoid_double) - goto push_for_double; split = 2; } } @@ -3021,8 +2939,6 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, if (mid != nritems && leaf_space_used(l, mid, nritems - mid) + data_size > BTRFS_LEAF_DATA_SIZE(root)) { - if (data_size && !tried_avoid_double) - goto push_for_double; split = 2 ; } } @@ -3103,13 +3019,6 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, } return ret; - -push_for_double: - push_for_double_split(trans, root, path, data_size); - tried_avoid_double = 1; - if (btrfs_leaf_free_space(root, path->nodes[0]) >= data_size) - return 0; - goto again; } static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans, @@ -4006,15 +3915,13 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, extent_buffer_get(leaf); btrfs_set_path_blocking(path); - wret = push_leaf_left(trans, root, path, 1, 1, - 1, (u32)-1); + wret = push_leaf_left(trans, root, path, 1, 1); if (wret < 0 && wret != -ENOSPC) ret = wret; if (path->nodes[0] == leaf && btrfs_header_nritems(leaf)) { - wret = push_leaf_right(trans, root, path, 1, - 1, 1, 0); + wret = push_leaf_right(trans, root, path, 1, 1); if (wret < 0 && wret != -ENOSPC) ret = wret; } diff --git a/trunk/fs/btrfs/ioctl.c b/trunk/fs/btrfs/ioctl.c index 9254b3d58dbe..4dbaf89b1337 100644 --- a/trunk/fs/btrfs/ioctl.c +++ b/trunk/fs/btrfs/ioctl.c @@ -1458,7 +1458,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, */ /* the destination must be opened for writing */ - if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) + if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; ret = mnt_want_write(file->f_path.mnt); @@ -1511,7 +1511,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, /* determine range to clone */ ret = -EINVAL; - if (off + len > src->i_size || off + len < off) + if (off >= src->i_size || off + len > src->i_size) goto out_unlock; if (len == 0) olen = len = src->i_size - off; @@ -1578,7 +1578,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, u64 disko = 0, diskl = 0; u64 datao = 0, datal = 0; u8 comp; - u64 endoff; size = btrfs_item_size_nr(leaf, slot); read_extent_buffer(leaf, buf, @@ -1713,18 +1712,9 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, btrfs_release_path(root, path); inode->i_mtime = inode->i_ctime = CURRENT_TIME; - - /* - * we round up to the block size at eof when - * determining which extents to clone above, - * but shouldn't round up the file size - */ - endoff = new_key.offset + datal; - if (endoff > off+olen) - endoff = off+olen; - if (endoff > inode->i_size) - btrfs_i_size_write(inode, endoff); - + if (new_key.offset + datal > inode->i_size) + btrfs_i_size_write(inode, + new_key.offset + datal); BTRFS_I(inode)->flags = BTRFS_I(src)->flags; ret = btrfs_update_inode(trans, root, inode); BUG_ON(ret); diff --git a/trunk/fs/ceph/auth_x.c b/trunk/fs/ceph/auth_x.c index 6d44053ecff1..3fe49042d8ad 100644 --- a/trunk/fs/ceph/auth_x.c +++ b/trunk/fs/ceph/auth_x.c @@ -613,9 +613,6 @@ static void ceph_x_destroy(struct ceph_auth_client *ac) remove_ticket_handler(ac, th); } - if (xi->auth_authorizer.buf) - ceph_buffer_put(xi->auth_authorizer.buf); - kfree(ac->private); ac->private = NULL; } diff --git a/trunk/fs/ceph/mds_client.c b/trunk/fs/ceph/mds_client.c index 416c08d315db..3ab79f6c4ce8 100644 --- a/trunk/fs/ceph/mds_client.c +++ b/trunk/fs/ceph/mds_client.c @@ -1514,9 +1514,6 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc, ceph_encode_filepath(&p, end, ino1, path1); ceph_encode_filepath(&p, end, ino2, path2); - /* make note of release offset, in case we need to replay */ - req->r_request_release_offset = p - msg->front.iov_base; - /* cap releases */ releases = 0; if (req->r_inode_drop) @@ -1583,32 +1580,6 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc, dout("prepare_send_request %p tid %lld %s (attempt %d)\n", req, req->r_tid, ceph_mds_op_name(req->r_op), req->r_attempts); - if (req->r_got_unsafe) { - /* - * Replay. Do not regenerate message (and rebuild - * paths, etc.); just use the original message. - * Rebuilding paths will break for renames because - * d_move mangles the src name. - */ - msg = req->r_request; - rhead = msg->front.iov_base; - - flags = le32_to_cpu(rhead->flags); - flags |= CEPH_MDS_FLAG_REPLAY; - rhead->flags = cpu_to_le32(flags); - - if (req->r_target_inode) - rhead->ino = cpu_to_le64(ceph_ino(req->r_target_inode)); - - rhead->num_retry = req->r_attempts - 1; - - /* remove cap/dentry releases from message */ - rhead->num_releases = 0; - msg->hdr.front_len = cpu_to_le32(req->r_request_release_offset); - msg->front.iov_len = req->r_request_release_offset; - return 0; - } - if (req->r_request) { ceph_msg_put(req->r_request); req->r_request = NULL; @@ -1630,9 +1601,13 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc, rhead->flags = cpu_to_le32(flags); rhead->num_fwd = req->r_num_fwd; rhead->num_retry = req->r_attempts - 1; - rhead->ino = 0; dout(" r_locked_dir = %p\n", req->r_locked_dir); + + if (req->r_target_inode && req->r_got_unsafe) + rhead->ino = cpu_to_le64(ceph_ino(req->r_target_inode)); + else + rhead->ino = 0; return 0; } diff --git a/trunk/fs/ceph/mds_client.h b/trunk/fs/ceph/mds_client.h index 952410c60d09..b292fa42a66d 100644 --- a/trunk/fs/ceph/mds_client.h +++ b/trunk/fs/ceph/mds_client.h @@ -188,7 +188,6 @@ struct ceph_mds_request { int r_old_inode_drop, r_old_inode_unless; struct ceph_msg *r_request; /* original request */ - int r_request_release_offset; struct ceph_msg *r_reply; struct ceph_mds_reply_info_parsed r_reply_info; int r_err; diff --git a/trunk/fs/ceph/messenger.c b/trunk/fs/ceph/messenger.c index 15167b2daa55..9ad43a310a41 100644 --- a/trunk/fs/ceph/messenger.c +++ b/trunk/fs/ceph/messenger.c @@ -43,8 +43,7 @@ static void ceph_fault(struct ceph_connection *con); * nicely render a sockaddr as a string. */ #define MAX_ADDR_STR 20 -#define MAX_ADDR_STR_LEN 60 -static char addr_str[MAX_ADDR_STR][MAX_ADDR_STR_LEN]; +static char addr_str[MAX_ADDR_STR][40]; static DEFINE_SPINLOCK(addr_str_lock); static int last_addr_str; @@ -53,6 +52,7 @@ const char *pr_addr(const struct sockaddr_storage *ss) int i; char *s; struct sockaddr_in *in4 = (void *)ss; + unsigned char *quad = (void *)&in4->sin_addr.s_addr; struct sockaddr_in6 *in6 = (void *)ss; spin_lock(&addr_str_lock); @@ -64,13 +64,25 @@ const char *pr_addr(const struct sockaddr_storage *ss) switch (ss->ss_family) { case AF_INET: - snprintf(s, MAX_ADDR_STR_LEN, "%pI4:%u", &in4->sin_addr, - (unsigned int)ntohs(in4->sin_port)); + sprintf(s, "%u.%u.%u.%u:%u", + (unsigned int)quad[0], + (unsigned int)quad[1], + (unsigned int)quad[2], + (unsigned int)quad[3], + (unsigned int)ntohs(in4->sin_port)); break; case AF_INET6: - snprintf(s, MAX_ADDR_STR_LEN, "[%pI6c]:%u", &in6->sin6_addr, - (unsigned int)ntohs(in6->sin6_port)); + sprintf(s, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%u", + in6->sin6_addr.s6_addr16[0], + in6->sin6_addr.s6_addr16[1], + in6->sin6_addr.s6_addr16[2], + in6->sin6_addr.s6_addr16[3], + in6->sin6_addr.s6_addr16[4], + in6->sin6_addr.s6_addr16[5], + in6->sin6_addr.s6_addr16[6], + in6->sin6_addr.s6_addr16[7], + (unsigned int)ntohs(in6->sin6_port)); break; default: @@ -203,13 +215,12 @@ static void set_sock_callbacks(struct socket *sock, */ static struct socket *ceph_tcp_connect(struct ceph_connection *con) { - struct sockaddr_storage *paddr = &con->peer_addr.in_addr; + struct sockaddr *paddr = (struct sockaddr *)&con->peer_addr.in_addr; struct socket *sock; int ret; BUG_ON(con->sock); - ret = sock_create_kern(con->peer_addr.in_addr.ss_family, SOCK_STREAM, - IPPROTO_TCP, &sock); + ret = sock_create_kern(AF_INET, SOCK_STREAM, IPPROTO_TCP, &sock); if (ret) return ERR_PTR(ret); con->sock = sock; @@ -223,8 +234,7 @@ static struct socket *ceph_tcp_connect(struct ceph_connection *con) dout("connect %s\n", pr_addr(&con->peer_addr.in_addr)); - ret = sock->ops->connect(sock, (struct sockaddr *)paddr, sizeof(*paddr), - O_NONBLOCK); + ret = sock->ops->connect(sock, paddr, sizeof(*paddr), O_NONBLOCK); if (ret == -EINPROGRESS) { dout("connect %s EINPROGRESS sk_state = %u\n", pr_addr(&con->peer_addr.in_addr), @@ -999,31 +1009,18 @@ int ceph_parse_ips(const char *c, const char *end, struct sockaddr_in *in4 = (void *)ss; struct sockaddr_in6 *in6 = (void *)ss; int port; - char delim = ','; - - if (*p == '[') { - delim = ']'; - p++; - } memset(ss, 0, sizeof(*ss)); if (in4_pton(p, end - p, (u8 *)&in4->sin_addr.s_addr, - delim, &ipend)) + ',', &ipend)) { ss->ss_family = AF_INET; - else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr, - delim, &ipend)) + } else if (in6_pton(p, end - p, (u8 *)&in6->sin6_addr.s6_addr, + ',', &ipend)) { ss->ss_family = AF_INET6; - else + } else { goto bad; - p = ipend; - - if (delim == ']') { - if (*p != ']') { - dout("missing matching ']'\n"); - goto bad; - } - p++; } + p = ipend; /* port? */ if (p < end && *p == ':') { @@ -1058,7 +1055,7 @@ int ceph_parse_ips(const char *c, const char *end, return 0; bad: - pr_err("parse_ips bad ip '%.*s'\n", (int)(end - c), c); + pr_err("parse_ips bad ip '%s'\n", c); return -EINVAL; } @@ -2018,20 +2015,20 @@ void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg) { mutex_lock(&con->mutex); if (!list_empty(&msg->list_head)) { - dout("con_revoke %p msg %p - was on queue\n", con, msg); + dout("con_revoke %p msg %p\n", con, msg); list_del_init(&msg->list_head); ceph_msg_put(msg); msg->hdr.seq = 0; - } - if (con->out_msg == msg) { - dout("con_revoke %p msg %p - was sending\n", con, msg); - con->out_msg = NULL; + if (con->out_msg == msg) { + ceph_msg_put(con->out_msg); + con->out_msg = NULL; + } if (con->out_kvec_is_msg) { con->out_skip = con->out_kvec_bytes; con->out_kvec_is_msg = false; } - ceph_msg_put(msg); - msg->hdr.seq = 0; + } else { + dout("con_revoke %p msg %p - not queued (sent?)\n", con, msg); } mutex_unlock(&con->mutex); } diff --git a/trunk/fs/ceph/osdmap.c b/trunk/fs/ceph/osdmap.c index 277f8b339577..50ce64ebd330 100644 --- a/trunk/fs/ceph/osdmap.c +++ b/trunk/fs/ceph/osdmap.c @@ -568,7 +568,6 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) if (ev > CEPH_PG_POOL_VERSION) { pr_warning("got unknown v %d > %d of ceph_pg_pool\n", ev, CEPH_PG_POOL_VERSION); - kfree(pi); goto bad; } __decode_pool(p, pi); diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 86d4db15473e..c8c78ba07827 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -896,7 +896,7 @@ EXPORT_SYMBOL(shrink_dcache_parent); * * In this case we return -1 to tell the caller that we baled. */ -static int shrink_dcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) +static int shrink_dcache_memory(int nr, gfp_t gfp_mask) { if (nr) { if (!(gfp_mask & __GFP_FS)) diff --git a/trunk/fs/gfs2/bmap.c b/trunk/fs/gfs2/bmap.c index 84da64b551b2..4a48c0f4b402 100644 --- a/trunk/fs/gfs2/bmap.c +++ b/trunk/fs/gfs2/bmap.c @@ -1041,7 +1041,6 @@ static int trunc_start(struct gfs2_inode *ip, u64 size) if (gfs2_is_stuffed(ip)) { u64 dsize = size + sizeof(struct gfs2_inode); - ip->i_disksize = size; ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; gfs2_trans_add_bh(ip->i_gl, dibh, 1); gfs2_dinode_out(ip, dibh->b_data); diff --git a/trunk/fs/gfs2/dir.c b/trunk/fs/gfs2/dir.c index 26ca3361a8bc..8295c5b5d4a9 100644 --- a/trunk/fs/gfs2/dir.c +++ b/trunk/fs/gfs2/dir.c @@ -392,7 +392,7 @@ static int gfs2_dirent_find_space(const struct gfs2_dirent *dent, unsigned totlen = be16_to_cpu(dent->de_rec_len); if (gfs2_dirent_sentinel(dent)) - actual = 0; + actual = GFS2_DIRENT_SIZE(0); if (totlen - actual >= required) return 1; return 0; diff --git a/trunk/fs/gfs2/glock.c b/trunk/fs/gfs2/glock.c index 0898f3ec8212..ddcdbf493536 100644 --- a/trunk/fs/gfs2/glock.c +++ b/trunk/fs/gfs2/glock.c @@ -706,18 +706,8 @@ static void glock_work_func(struct work_struct *work) { unsigned long delay = 0; struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work); - struct gfs2_holder *gh; int drop_ref = 0; - if (unlikely(test_bit(GLF_FROZEN, &gl->gl_flags))) { - spin_lock(&gl->gl_spin); - gh = find_first_waiter(gl); - if (gh && (gh->gh_flags & LM_FLAG_NOEXP) && - test_and_clear_bit(GLF_FROZEN, &gl->gl_flags)) - set_bit(GLF_REPLY_PENDING, &gl->gl_flags); - spin_unlock(&gl->gl_spin); - } - if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) { finish_xmote(gl, gl->gl_reply); drop_ref = 1; @@ -1358,7 +1348,7 @@ void gfs2_glock_complete(struct gfs2_glock *gl, int ret) } -static int gfs2_shrink_glock_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) +static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask) { struct gfs2_glock *gl; int may_demote; diff --git a/trunk/fs/gfs2/inode.c b/trunk/fs/gfs2/inode.c index f03afd9c44bc..b5612cbb62a5 100644 --- a/trunk/fs/gfs2/inode.c +++ b/trunk/fs/gfs2/inode.c @@ -169,7 +169,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, { struct inode *inode; struct gfs2_inode *ip; - struct gfs2_glock *io_gl = NULL; + struct gfs2_glock *io_gl; int error; inode = gfs2_iget(sb, no_addr); @@ -198,7 +198,6 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, ip->i_iopen_gh.gh_gl->gl_object = ip; gfs2_glock_put(io_gl); - io_gl = NULL; if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) goto gfs2_nfsbypass; @@ -229,8 +228,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, fail_glock: gfs2_glock_dq(&ip->i_iopen_gh); fail_iopen: - if (io_gl) - gfs2_glock_put(io_gl); + gfs2_glock_put(io_gl); fail_put: if (inode->i_state & I_NEW) ip->i_gl->gl_object = NULL; @@ -258,7 +256,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) { struct gfs2_sbd *sdp; struct gfs2_inode *ip; - struct gfs2_glock *io_gl = NULL; + struct gfs2_glock *io_gl; int error; struct gfs2_holder gh; struct inode *inode; @@ -295,7 +293,6 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) ip->i_iopen_gh.gh_gl->gl_object = ip; gfs2_glock_put(io_gl); - io_gl = NULL; inode->i_mode = DT2IF(DT_UNKNOWN); @@ -322,8 +319,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) fail_glock: gfs2_glock_dq(&ip->i_iopen_gh); fail_iopen: - if (io_gl) - gfs2_glock_put(io_gl); + gfs2_glock_put(io_gl); fail_put: ip->i_gl->gl_object = NULL; gfs2_glock_put(ip->i_gl); diff --git a/trunk/fs/gfs2/quota.c b/trunk/fs/gfs2/quota.c index 8f02d3db8f42..49667d68769e 100644 --- a/trunk/fs/gfs2/quota.c +++ b/trunk/fs/gfs2/quota.c @@ -77,7 +77,7 @@ static LIST_HEAD(qd_lru_list); static atomic_t qd_lru_count = ATOMIC_INIT(0); static DEFINE_SPINLOCK(qd_lru_lock); -int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) +int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask) { struct gfs2_quota_data *qd; struct gfs2_sbd *sdp; @@ -694,8 +694,10 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, if (!buffer_mapped(bh)) goto unlock_out; /* If it's a newly allocated disk block for quota, zero it */ - if (buffer_new(bh)) - zero_user(page, pos - blocksize, bh->b_size); + if (buffer_new(bh)) { + memset(bh->b_data, 0, bh->b_size); + set_buffer_uptodate(bh); + } } if (PageUptodate(page)) @@ -721,7 +723,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, /* If quota straddles page boundary, we need to update the rest of the * quota at the beginning of the next page */ - if ((offset + sizeof(struct gfs2_quota)) > PAGE_CACHE_SIZE) { + if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */ ptr = ptr + nbytes; nbytes = sizeof(struct gfs2_quota) - nbytes; offset = 0; diff --git a/trunk/fs/gfs2/quota.h b/trunk/fs/gfs2/quota.h index e7d236ca48bd..195f60c8bd14 100644 --- a/trunk/fs/gfs2/quota.h +++ b/trunk/fs/gfs2/quota.h @@ -51,7 +51,7 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) return ret; } -extern int gfs2_shrink_qd_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask); +extern int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask); extern const struct quotactl_ops gfs2_quotactl_ops; #endif /* __QUOTA_DOT_H__ */ diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index 722860b323a9..2bee20ae3d65 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -512,7 +512,7 @@ static void prune_icache(int nr_to_scan) * This function is passed the number of inodes to scan, and it returns the * total number of remaining possibly-reclaimable inodes. */ -static int shrink_icache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) +static int shrink_icache_memory(int nr, gfp_t gfp_mask) { if (nr) { /* diff --git a/trunk/fs/jbd2/journal.c b/trunk/fs/jbd2/journal.c index 036880895bfc..bc2ff5932769 100644 --- a/trunk/fs/jbd2/journal.c +++ b/trunk/fs/jbd2/journal.c @@ -297,6 +297,7 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, struct page *new_page; unsigned int new_offset; struct buffer_head *bh_in = jh2bh(jh_in); + struct jbd2_buffer_trigger_type *triggers; journal_t *journal = transaction->t_journal; /* @@ -327,21 +328,21 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, done_copy_out = 1; new_page = virt_to_page(jh_in->b_frozen_data); new_offset = offset_in_page(jh_in->b_frozen_data); + triggers = jh_in->b_frozen_triggers; } else { new_page = jh2bh(jh_in)->b_page; new_offset = offset_in_page(jh2bh(jh_in)->b_data); + triggers = jh_in->b_triggers; } mapped_data = kmap_atomic(new_page, KM_USER0); /* - * Fire data frozen trigger if data already wasn't frozen. Do this - * before checking for escaping, as the trigger may modify the magic - * offset. If a copy-out happens afterwards, it will have the correct - * data in the buffer. + * Fire any commit trigger. Do this before checking for escaping, + * as the trigger may modify the magic offset. If a copy-out + * happens afterwards, it will have the correct data in the buffer. */ - if (!done_copy_out) - jbd2_buffer_frozen_trigger(jh_in, mapped_data + new_offset, - jh_in->b_triggers); + jbd2_buffer_commit_trigger(jh_in, mapped_data + new_offset, + triggers); /* * Check for escaping diff --git a/trunk/fs/jbd2/transaction.c b/trunk/fs/jbd2/transaction.c index b8e0806681bb..e214d68620ac 100644 --- a/trunk/fs/jbd2/transaction.c +++ b/trunk/fs/jbd2/transaction.c @@ -725,9 +725,6 @@ do_get_write_access(handle_t *handle, struct journal_head *jh, page = jh2bh(jh)->b_page; offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK; source = kmap_atomic(page, KM_USER0); - /* Fire data frozen trigger just before we copy the data */ - jbd2_buffer_frozen_trigger(jh, source + offset, - jh->b_triggers); memcpy(jh->b_frozen_data, source+offset, jh2bh(jh)->b_size); kunmap_atomic(source, KM_USER0); @@ -966,15 +963,15 @@ void jbd2_journal_set_triggers(struct buffer_head *bh, jh->b_triggers = type; } -void jbd2_buffer_frozen_trigger(struct journal_head *jh, void *mapped_data, +void jbd2_buffer_commit_trigger(struct journal_head *jh, void *mapped_data, struct jbd2_buffer_trigger_type *triggers) { struct buffer_head *bh = jh2bh(jh); - if (!triggers || !triggers->t_frozen) + if (!triggers || !triggers->t_commit) return; - triggers->t_frozen(triggers, bh, mapped_data, bh->b_size); + triggers->t_commit(triggers, bh, mapped_data, bh->b_size); } void jbd2_buffer_abort_trigger(struct journal_head *jh, diff --git a/trunk/fs/jffs2/xattr.c b/trunk/fs/jffs2/xattr.c index d258e261bdc7..a2d58c96f1b4 100644 --- a/trunk/fs/jffs2/xattr.c +++ b/trunk/fs/jffs2/xattr.c @@ -626,7 +626,7 @@ void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *i static int check_xattr_ref_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { - /* success of check_xattr_ref_inode() means that inode (ic) dose not have + /* success of check_xattr_ref_inode() means taht inode (ic) dose not have * duplicate name/value pairs. If duplicate name/value pair would be found, * one will be removed. */ diff --git a/trunk/fs/mbcache.c b/trunk/fs/mbcache.c index e28f21b95344..ec88ff3d04a9 100644 --- a/trunk/fs/mbcache.c +++ b/trunk/fs/mbcache.c @@ -115,7 +115,7 @@ mb_cache_indexes(struct mb_cache *cache) * What the mbcache registers as to get shrunk dynamically. */ -static int mb_cache_shrink_fn(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask); +static int mb_cache_shrink_fn(int nr_to_scan, gfp_t gfp_mask); static struct shrinker mb_cache_shrinker = { .shrink = mb_cache_shrink_fn, @@ -191,14 +191,13 @@ __mb_cache_entry_release_unlock(struct mb_cache_entry *ce) * This function is called by the kernel memory management when memory * gets low. * - * @shrink: (ignored) * @nr_to_scan: Number of objects to scan * @gfp_mask: (ignored) * * Returns the number of objects which are present in the cache. */ static int -mb_cache_shrink_fn(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) +mb_cache_shrink_fn(int nr_to_scan, gfp_t gfp_mask) { LIST_HEAD(free_list); struct list_head *l, *ltmp; diff --git a/trunk/fs/nfs/dir.c b/trunk/fs/nfs/dir.c index e60416d3f818..782b431ef91c 100644 --- a/trunk/fs/nfs/dir.c +++ b/trunk/fs/nfs/dir.c @@ -1710,7 +1710,7 @@ static void nfs_access_free_list(struct list_head *head) } } -int nfs_access_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) +int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask) { LIST_HEAD(head); struct nfs_inode *nfsi; diff --git a/trunk/fs/nfs/internal.h b/trunk/fs/nfs/internal.h index e70f44b9b3f4..d8bd619e386c 100644 --- a/trunk/fs/nfs/internal.h +++ b/trunk/fs/nfs/internal.h @@ -205,8 +205,7 @@ extern struct rpc_procinfo nfs4_procedures[]; void nfs_close_context(struct nfs_open_context *ctx, int is_sync); /* dir.c */ -extern int nfs_access_cache_shrinker(struct shrinker *shrink, - int nr_to_scan, gfp_t gfp_mask); +extern int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask); /* inode.c */ extern struct workqueue_struct *nfsiod_workqueue; diff --git a/trunk/fs/ocfs2/aops.c b/trunk/fs/ocfs2/aops.c index 356e976772bf..3623ca20cc18 100644 --- a/trunk/fs/ocfs2/aops.c +++ b/trunk/fs/ocfs2/aops.c @@ -196,13 +196,14 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock, dump_stack(); goto bail; } - } - past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode)); - mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino, - (unsigned long long)past_eof); - if (create && (iblock >= past_eof)) - set_buffer_new(bh_result); + past_eof = ocfs2_blocks_for_bytes(inode->i_sb, i_size_read(inode)); + mlog(0, "Inode %lu, past_eof = %llu\n", inode->i_ino, + (unsigned long long)past_eof); + + if (create && (iblock >= past_eof)) + set_buffer_new(bh_result); + } bail: if (err < 0) @@ -458,6 +459,36 @@ int walk_page_buffers( handle_t *handle, return ret; } +handle_t *ocfs2_start_walk_page_trans(struct inode *inode, + struct page *page, + unsigned from, + unsigned to) +{ + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); + handle_t *handle; + int ret = 0; + + handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); + if (IS_ERR(handle)) { + ret = -ENOMEM; + mlog_errno(ret); + goto out; + } + + if (ocfs2_should_order_data(inode)) { + ret = ocfs2_jbd2_file_inode(handle, inode); + if (ret < 0) + mlog_errno(ret); + } +out: + if (ret) { + if (!IS_ERR(handle)) + ocfs2_commit_trans(osb, handle); + handle = ERR_PTR(ret); + } + return handle; +} + static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block) { sector_t status; @@ -1100,37 +1131,23 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno, */ static int ocfs2_grab_pages_for_write(struct address_space *mapping, struct ocfs2_write_ctxt *wc, - u32 cpos, loff_t user_pos, - unsigned user_len, int new, + u32 cpos, loff_t user_pos, int new, struct page *mmap_page) { int ret = 0, i; - unsigned long start, target_index, end_index, index; + unsigned long start, target_index, index; struct inode *inode = mapping->host; - loff_t last_byte; target_index = user_pos >> PAGE_CACHE_SHIFT; /* * Figure out how many pages we'll be manipulating here. For * non allocating write, we just change the one - * page. Otherwise, we'll need a whole clusters worth. If we're - * writing past i_size, we only need enough pages to cover the - * last page of the write. + * page. Otherwise, we'll need a whole clusters worth. */ if (new) { wc->w_num_pages = ocfs2_pages_per_cluster(inode->i_sb); start = ocfs2_align_clusters_to_page_index(inode->i_sb, cpos); - /* - * We need the index *past* the last page we could possibly - * touch. This is the page past the end of the write or - * i_size, whichever is greater. - */ - last_byte = max(user_pos + user_len, i_size_read(inode)); - BUG_ON(last_byte < 1); - end_index = ((last_byte - 1) >> PAGE_CACHE_SHIFT) + 1; - if ((start + wc->w_num_pages) > end_index) - wc->w_num_pages = end_index - start; } else { wc->w_num_pages = 1; start = target_index; @@ -1603,20 +1620,21 @@ static int ocfs2_try_to_write_inline_data(struct address_space *mapping, * write path can treat it as an non-allocating write, which has no * special case code for sparse/nonsparse files. */ -static int ocfs2_expand_nonsparse_inode(struct inode *inode, - struct buffer_head *di_bh, - loff_t pos, unsigned len, +static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos, + unsigned len, struct ocfs2_write_ctxt *wc) { int ret; + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); loff_t newsize = pos + len; - BUG_ON(ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))); + if (ocfs2_sparse_alloc(osb)) + return 0; if (newsize <= i_size_read(inode)) return 0; - ret = ocfs2_extend_no_holes(inode, di_bh, newsize, pos); + ret = ocfs2_extend_no_holes(inode, newsize, pos); if (ret) mlog_errno(ret); @@ -1626,18 +1644,6 @@ static int ocfs2_expand_nonsparse_inode(struct inode *inode, return ret; } -static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh, - loff_t pos) -{ - int ret = 0; - - BUG_ON(!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))); - if (pos > i_size_read(inode)) - ret = ocfs2_zero_extend(inode, di_bh, pos); - - return ret; -} - int ocfs2_write_begin_nolock(struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, @@ -1673,11 +1679,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, } } - if (ocfs2_sparse_alloc(osb)) - ret = ocfs2_zero_tail(inode, di_bh, pos); - else - ret = ocfs2_expand_nonsparse_inode(inode, di_bh, pos, len, - wc); + ret = ocfs2_expand_nonsparse_inode(inode, pos, len, wc); if (ret) { mlog_errno(ret); goto out; @@ -1787,7 +1789,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, * that we can zero and flush if we error after adding the * extent. */ - ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos, len, + ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos, cluster_of_pages, mmap_page); if (ret) { mlog_errno(ret); diff --git a/trunk/fs/ocfs2/dlm/dlmdomain.c b/trunk/fs/ocfs2/dlm/dlmdomain.c index 153abb5abef0..6b5a492e1749 100644 --- a/trunk/fs/ocfs2/dlm/dlmdomain.c +++ b/trunk/fs/ocfs2/dlm/dlmdomain.c @@ -1671,7 +1671,7 @@ struct dlm_ctxt * dlm_register_domain(const char *domain, struct dlm_ctxt *dlm = NULL; struct dlm_ctxt *new_ctxt = NULL; - if (strlen(domain) >= O2NM_MAX_NAME_LEN) { + if (strlen(domain) > O2NM_MAX_NAME_LEN) { ret = -ENAMETOOLONG; mlog(ML_ERROR, "domain name length too long\n"); goto leave; @@ -1709,7 +1709,6 @@ struct dlm_ctxt * dlm_register_domain(const char *domain, } if (dlm_protocol_compare(&dlm->fs_locking_proto, fs_proto)) { - spin_unlock(&dlm_domain_lock); mlog(ML_ERROR, "Requested locking protocol version is not " "compatible with already registered domain " diff --git a/trunk/fs/ocfs2/dlm/dlmmaster.c b/trunk/fs/ocfs2/dlm/dlmmaster.c index 94b97fc6a88e..4a7506a4e314 100644 --- a/trunk/fs/ocfs2/dlm/dlmmaster.c +++ b/trunk/fs/ocfs2/dlm/dlmmaster.c @@ -2808,8 +2808,14 @@ static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm, mlog(0, "trying again...\n"); goto again; } + /* now that we are sure the MIGRATING state is there, drop + * the unneded state which blocked threads trying to DIRTY */ + spin_lock(&res->spinlock); + BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); + BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); + res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; + spin_unlock(&res->spinlock); - ret = 0; /* did the target go down or die? */ spin_lock(&dlm->spinlock); if (!test_bit(target, dlm->domain_map)) { @@ -2819,22 +2825,10 @@ static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm, } spin_unlock(&dlm->spinlock); - /* - * if target is down, we need to clear DLM_LOCK_RES_BLOCK_DIRTY for - * another try; otherwise, we are sure the MIGRATING state is there, - * drop the unneded state which blocked threads trying to DIRTY - */ - spin_lock(&res->spinlock); - BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); - res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; - if (!ret) - BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); - spin_unlock(&res->spinlock); - /* * at this point: * - * o the DLM_LOCK_RES_MIGRATING flag is set if target not down + * o the DLM_LOCK_RES_MIGRATING flag is set * o there are no pending asts on this lockres * o all processes trying to reserve an ast on this * lockres must wait for the MIGRATING flag to clear diff --git a/trunk/fs/ocfs2/dlm/dlmrecovery.c b/trunk/fs/ocfs2/dlm/dlmrecovery.c index 9dfaac73b36d..f8b75ce4be70 100644 --- a/trunk/fs/ocfs2/dlm/dlmrecovery.c +++ b/trunk/fs/ocfs2/dlm/dlmrecovery.c @@ -463,7 +463,7 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm) if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) { int bit; - bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0); + bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES+1, 0); if (bit >= O2NM_MAX_NODES || bit < 0) dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM); else diff --git a/trunk/fs/ocfs2/file.c b/trunk/fs/ocfs2/file.c index 2b10b36d1577..6a13ea64c447 100644 --- a/trunk/fs/ocfs2/file.c +++ b/trunk/fs/ocfs2/file.c @@ -724,55 +724,28 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start, return status; } -/* - * While a write will already be ordering the data, a truncate will not. - * Thus, we need to explicitly order the zeroed pages. - */ -static handle_t *ocfs2_zero_start_ordered_transaction(struct inode *inode) -{ - struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); - handle_t *handle = NULL; - int ret = 0; - - if (!ocfs2_should_order_data(inode)) - goto out; - - handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS); - if (IS_ERR(handle)) { - ret = -ENOMEM; - mlog_errno(ret); - goto out; - } - - ret = ocfs2_jbd2_file_inode(handle, inode); - if (ret < 0) - mlog_errno(ret); - -out: - if (ret) { - if (!IS_ERR(handle)) - ocfs2_commit_trans(osb, handle); - handle = ERR_PTR(ret); - } - return handle; -} - /* Some parts of this taken from generic_cont_expand, which turned out * to be too fragile to do exactly what we need without us having to * worry about recursive locking in ->write_begin() and ->write_end(). */ -static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, - u64 abs_to) +static int ocfs2_write_zero_page(struct inode *inode, + u64 size) { struct address_space *mapping = inode->i_mapping; struct page *page; - unsigned long index = abs_from >> PAGE_CACHE_SHIFT; + unsigned long index; + unsigned int offset; handle_t *handle = NULL; - int ret = 0; - unsigned zero_from, zero_to, block_start, block_end; + int ret; - BUG_ON(abs_from >= abs_to); - BUG_ON(abs_to > (((u64)index + 1) << PAGE_CACHE_SHIFT)); - BUG_ON(abs_from & (inode->i_blkbits - 1)); + offset = (size & (PAGE_CACHE_SIZE-1)); /* Within page */ + /* ugh. in prepare/commit_write, if from==to==start of block, we + ** skip the prepare. make sure we never send an offset for the start + ** of a block + */ + if ((offset & (inode->i_sb->s_blocksize - 1)) == 0) { + offset++; + } + index = size >> PAGE_CACHE_SHIFT; page = grab_cache_page(mapping, index); if (!page) { @@ -781,56 +754,31 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, goto out; } - /* Get the offsets within the page that we want to zero */ - zero_from = abs_from & (PAGE_CACHE_SIZE - 1); - zero_to = abs_to & (PAGE_CACHE_SIZE - 1); - if (!zero_to) - zero_to = PAGE_CACHE_SIZE; - - mlog(0, - "abs_from = %llu, abs_to = %llu, index = %lu, zero_from = %u, zero_to = %u\n", - (unsigned long long)abs_from, (unsigned long long)abs_to, - index, zero_from, zero_to); - - /* We know that zero_from is block aligned */ - for (block_start = zero_from; block_start < zero_to; - block_start = block_end) { - block_end = block_start + (1 << inode->i_blkbits); + ret = ocfs2_prepare_write_nolock(inode, page, offset, offset); + if (ret < 0) { + mlog_errno(ret); + goto out_unlock; + } - /* - * block_start is block-aligned. Bump it by one to - * force ocfs2_{prepare,commit}_write() to zero the - * whole block. - */ - ret = ocfs2_prepare_write_nolock(inode, page, - block_start + 1, - block_start + 1); - if (ret < 0) { - mlog_errno(ret); + if (ocfs2_should_order_data(inode)) { + handle = ocfs2_start_walk_page_trans(inode, page, offset, + offset); + if (IS_ERR(handle)) { + ret = PTR_ERR(handle); + handle = NULL; goto out_unlock; } - - if (!handle) { - handle = ocfs2_zero_start_ordered_transaction(inode); - if (IS_ERR(handle)) { - ret = PTR_ERR(handle); - handle = NULL; - break; - } - } - - /* must not update i_size! */ - ret = block_commit_write(page, block_start + 1, - block_start + 1); - if (ret < 0) - mlog_errno(ret); - else - ret = 0; } + /* must not update i_size! */ + ret = block_commit_write(page, offset, offset); + if (ret < 0) + mlog_errno(ret); + else + ret = 0; + if (handle) ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); - out_unlock: unlock_page(page); page_cache_release(page); @@ -838,114 +786,22 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, return ret; } -/* - * Find the next range to zero. We do this in terms of bytes because - * that's what ocfs2_zero_extend() wants, and it is dealing with the - * pagecache. We may return multiple extents. - * - * zero_start and zero_end are ocfs2_zero_extend()s current idea of what - * needs to be zeroed. range_start and range_end return the next zeroing - * range. A subsequent call should pass the previous range_end as its - * zero_start. If range_end is 0, there's nothing to do. - * - * Unwritten extents are skipped over. Refcounted extents are CoWd. - */ -static int ocfs2_zero_extend_get_range(struct inode *inode, - struct buffer_head *di_bh, - u64 zero_start, u64 zero_end, - u64 *range_start, u64 *range_end) +static int ocfs2_zero_extend(struct inode *inode, + u64 zero_to_size) { - int rc = 0, needs_cow = 0; - u32 p_cpos, zero_clusters = 0; - u32 zero_cpos = - zero_start >> OCFS2_SB(inode->i_sb)->s_clustersize_bits; - u32 last_cpos = ocfs2_clusters_for_bytes(inode->i_sb, zero_end); - unsigned int num_clusters = 0; - unsigned int ext_flags = 0; - - while (zero_cpos < last_cpos) { - rc = ocfs2_get_clusters(inode, zero_cpos, &p_cpos, - &num_clusters, &ext_flags); - if (rc) { - mlog_errno(rc); - goto out; - } - - if (p_cpos && !(ext_flags & OCFS2_EXT_UNWRITTEN)) { - zero_clusters = num_clusters; - if (ext_flags & OCFS2_EXT_REFCOUNTED) - needs_cow = 1; - break; - } - - zero_cpos += num_clusters; - } - if (!zero_clusters) { - *range_end = 0; - goto out; - } - - while ((zero_cpos + zero_clusters) < last_cpos) { - rc = ocfs2_get_clusters(inode, zero_cpos + zero_clusters, - &p_cpos, &num_clusters, - &ext_flags); - if (rc) { - mlog_errno(rc); - goto out; - } + int ret = 0; + u64 start_off; + struct super_block *sb = inode->i_sb; - if (!p_cpos || (ext_flags & OCFS2_EXT_UNWRITTEN)) - break; - if (ext_flags & OCFS2_EXT_REFCOUNTED) - needs_cow = 1; - zero_clusters += num_clusters; - } - if ((zero_cpos + zero_clusters) > last_cpos) - zero_clusters = last_cpos - zero_cpos; - - if (needs_cow) { - rc = ocfs2_refcount_cow(inode, di_bh, zero_cpos, zero_clusters, - UINT_MAX); - if (rc) { - mlog_errno(rc); + start_off = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode)); + while (start_off < zero_to_size) { + ret = ocfs2_write_zero_page(inode, start_off); + if (ret < 0) { + mlog_errno(ret); goto out; } - } - - *range_start = ocfs2_clusters_to_bytes(inode->i_sb, zero_cpos); - *range_end = ocfs2_clusters_to_bytes(inode->i_sb, - zero_cpos + zero_clusters); - -out: - return rc; -} -/* - * Zero one range returned from ocfs2_zero_extend_get_range(). The caller - * has made sure that the entire range needs zeroing. - */ -static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start, - u64 range_end) -{ - int rc = 0; - u64 next_pos; - u64 zero_pos = range_start; - - mlog(0, "range_start = %llu, range_end = %llu\n", - (unsigned long long)range_start, - (unsigned long long)range_end); - BUG_ON(range_start >= range_end); - - while (zero_pos < range_end) { - next_pos = (zero_pos & PAGE_CACHE_MASK) + PAGE_CACHE_SIZE; - if (next_pos > range_end) - next_pos = range_end; - rc = ocfs2_write_zero_page(inode, zero_pos, next_pos); - if (rc < 0) { - mlog_errno(rc); - break; - } - zero_pos = next_pos; + start_off += sb->s_blocksize; /* * Very large extends have the potential to lock up @@ -954,63 +810,16 @@ static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start, cond_resched(); } - return rc; -} - -int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, - loff_t zero_to_size) -{ - int ret = 0; - u64 zero_start, range_start = 0, range_end = 0; - struct super_block *sb = inode->i_sb; - - zero_start = ocfs2_align_bytes_to_blocks(sb, i_size_read(inode)); - mlog(0, "zero_start %llu for i_size %llu\n", - (unsigned long long)zero_start, - (unsigned long long)i_size_read(inode)); - while (zero_start < zero_to_size) { - ret = ocfs2_zero_extend_get_range(inode, di_bh, zero_start, - zero_to_size, - &range_start, - &range_end); - if (ret) { - mlog_errno(ret); - break; - } - if (!range_end) - break; - /* Trim the ends */ - if (range_start < zero_start) - range_start = zero_start; - if (range_end > zero_to_size) - range_end = zero_to_size; - - ret = ocfs2_zero_extend_range(inode, range_start, - range_end); - if (ret) { - mlog_errno(ret); - break; - } - zero_start = range_end; - } - +out: return ret; } -int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh, - u64 new_i_size, u64 zero_to) +int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, u64 zero_to) { int ret; u32 clusters_to_add; struct ocfs2_inode_info *oi = OCFS2_I(inode); - /* - * Only quota files call this without a bh, and they can't be - * refcounted. - */ - BUG_ON(!di_bh && (oi->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL)); - BUG_ON(!di_bh && !(oi->ip_flags & OCFS2_INODE_SYSTEM_FILE)); - clusters_to_add = ocfs2_clusters_for_bytes(inode->i_sb, new_i_size); if (clusters_to_add < oi->ip_clusters) clusters_to_add = 0; @@ -1031,7 +840,7 @@ int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh, * still need to zero the area between the old i_size and the * new i_size. */ - ret = ocfs2_zero_extend(inode, di_bh, zero_to); + ret = ocfs2_zero_extend(inode, zero_to); if (ret < 0) mlog_errno(ret); @@ -1053,15 +862,27 @@ static int ocfs2_extend_file(struct inode *inode, goto out; if (i_size_read(inode) == new_i_size) - goto out; + goto out; BUG_ON(new_i_size < i_size_read(inode)); + /* + * Fall through for converting inline data, even if the fs + * supports sparse files. + * + * The check for inline data here is legal - nobody can add + * the feature since we have i_mutex. We must check it again + * after acquiring ip_alloc_sem though, as paths like mmap + * might have raced us to converting the inode to extents. + */ + if (!(oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) + && ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) + goto out_update_size; + /* * The alloc sem blocks people in read/write from reading our * allocation until we're done changing it. We depend on * i_mutex to block other extend/truncate calls while we're - * here. We even have to hold it for sparse files because there - * might be some tail zeroing. + * here. */ down_write(&oi->ip_alloc_sem); @@ -1078,16 +899,14 @@ static int ocfs2_extend_file(struct inode *inode, ret = ocfs2_convert_inline_data_to_extents(inode, di_bh); if (ret) { up_write(&oi->ip_alloc_sem); + mlog_errno(ret); goto out; } } - if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) - ret = ocfs2_zero_extend(inode, di_bh, new_i_size); - else - ret = ocfs2_extend_no_holes(inode, di_bh, new_i_size, - new_i_size); + if (!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) + ret = ocfs2_extend_no_holes(inode, new_i_size, new_i_size); up_write(&oi->ip_alloc_sem); diff --git a/trunk/fs/ocfs2/file.h b/trunk/fs/ocfs2/file.h index 97bf761c9e7c..d66cf4f7c70e 100644 --- a/trunk/fs/ocfs2/file.h +++ b/trunk/fs/ocfs2/file.h @@ -54,10 +54,8 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb, int ocfs2_simple_size_update(struct inode *inode, struct buffer_head *di_bh, u64 new_i_size); -int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh, - u64 new_i_size, u64 zero_to); -int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, - loff_t zero_to); +int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, + u64 zero_to); int ocfs2_setattr(struct dentry *dentry, struct iattr *attr); int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); diff --git a/trunk/fs/ocfs2/journal.c b/trunk/fs/ocfs2/journal.c index 625de9d7088c..47878cf16418 100644 --- a/trunk/fs/ocfs2/journal.c +++ b/trunk/fs/ocfs2/journal.c @@ -472,7 +472,7 @@ static inline struct ocfs2_triggers *to_ocfs2_trigger(struct jbd2_buffer_trigger return container_of(triggers, struct ocfs2_triggers, ot_triggers); } -static void ocfs2_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, +static void ocfs2_commit_trigger(struct jbd2_buffer_trigger_type *triggers, struct buffer_head *bh, void *data, size_t size) { @@ -491,7 +491,7 @@ static void ocfs2_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, * Quota blocks have their own trigger because the struct ocfs2_block_check * offset depends on the blocksize. */ -static void ocfs2_dq_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, +static void ocfs2_dq_commit_trigger(struct jbd2_buffer_trigger_type *triggers, struct buffer_head *bh, void *data, size_t size) { @@ -511,7 +511,7 @@ static void ocfs2_dq_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, * Directory blocks also have their own trigger because the * struct ocfs2_block_check offset depends on the blocksize. */ -static void ocfs2_db_frozen_trigger(struct jbd2_buffer_trigger_type *triggers, +static void ocfs2_db_commit_trigger(struct jbd2_buffer_trigger_type *triggers, struct buffer_head *bh, void *data, size_t size) { @@ -544,7 +544,7 @@ static void ocfs2_abort_trigger(struct jbd2_buffer_trigger_type *triggers, static struct ocfs2_triggers di_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_dinode, i_check), @@ -552,7 +552,7 @@ static struct ocfs2_triggers di_triggers = { static struct ocfs2_triggers eb_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_extent_block, h_check), @@ -560,7 +560,7 @@ static struct ocfs2_triggers eb_triggers = { static struct ocfs2_triggers rb_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_refcount_block, rf_check), @@ -568,7 +568,7 @@ static struct ocfs2_triggers rb_triggers = { static struct ocfs2_triggers gd_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_group_desc, bg_check), @@ -576,14 +576,14 @@ static struct ocfs2_triggers gd_triggers = { static struct ocfs2_triggers db_triggers = { .ot_triggers = { - .t_frozen = ocfs2_db_frozen_trigger, + .t_commit = ocfs2_db_commit_trigger, .t_abort = ocfs2_abort_trigger, }, }; static struct ocfs2_triggers xb_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_xattr_block, xb_check), @@ -591,14 +591,14 @@ static struct ocfs2_triggers xb_triggers = { static struct ocfs2_triggers dq_triggers = { .ot_triggers = { - .t_frozen = ocfs2_dq_frozen_trigger, + .t_commit = ocfs2_dq_commit_trigger, .t_abort = ocfs2_abort_trigger, }, }; static struct ocfs2_triggers dr_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_dx_root_block, dr_check), @@ -606,7 +606,7 @@ static struct ocfs2_triggers dr_triggers = { static struct ocfs2_triggers dl_triggers = { .ot_triggers = { - .t_frozen = ocfs2_frozen_trigger, + .t_commit = ocfs2_commit_trigger, .t_abort = ocfs2_abort_trigger, }, .ot_offset = offsetof(struct ocfs2_dx_leaf, dl_check), @@ -1936,7 +1936,7 @@ void ocfs2_orphan_scan_work(struct work_struct *work) mutex_lock(&os->os_lock); ocfs2_queue_orphan_scan(osb); if (atomic_read(&os->os_state) == ORPHAN_SCAN_ACTIVE) - queue_delayed_work(ocfs2_wq, &os->os_orphan_scan_work, + schedule_delayed_work(&os->os_orphan_scan_work, ocfs2_orphan_scan_timeout()); mutex_unlock(&os->os_lock); } @@ -1976,8 +1976,8 @@ void ocfs2_orphan_scan_start(struct ocfs2_super *osb) atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE); else { atomic_set(&os->os_state, ORPHAN_SCAN_ACTIVE); - queue_delayed_work(ocfs2_wq, &os->os_orphan_scan_work, - ocfs2_orphan_scan_timeout()); + schedule_delayed_work(&os->os_orphan_scan_work, + ocfs2_orphan_scan_timeout()); } } diff --git a/trunk/fs/ocfs2/localalloc.c b/trunk/fs/ocfs2/localalloc.c index ec6adbf8f551..3d7419682dc0 100644 --- a/trunk/fs/ocfs2/localalloc.c +++ b/trunk/fs/ocfs2/localalloc.c @@ -118,7 +118,6 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb) { unsigned int la_mb; unsigned int gd_mb; - unsigned int la_max_mb; unsigned int megs_per_slot; struct super_block *sb = osb->sb; @@ -183,12 +182,6 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb) if (megs_per_slot < la_mb) la_mb = megs_per_slot; - /* We can't store more bits than we can in a block. */ - la_max_mb = ocfs2_clusters_to_megabytes(osb->sb, - ocfs2_local_alloc_size(sb) * 8); - if (la_mb > la_max_mb) - la_mb = la_max_mb; - return la_mb; } diff --git a/trunk/fs/ocfs2/quota_global.c b/trunk/fs/ocfs2/quota_global.c index 4607923eb24c..2bb35fe00511 100644 --- a/trunk/fs/ocfs2/quota_global.c +++ b/trunk/fs/ocfs2/quota_global.c @@ -775,7 +775,7 @@ static int ocfs2_acquire_dquot(struct dquot *dquot) * locking allocators ranks above a transaction start */ WARN_ON(journal_current_handle()); - status = ocfs2_extend_no_holes(gqinode, NULL, + status = ocfs2_extend_no_holes(gqinode, gqinode->i_size + (need_alloc << sb->s_blocksize_bits), gqinode->i_size); if (status < 0) diff --git a/trunk/fs/ocfs2/quota_local.c b/trunk/fs/ocfs2/quota_local.c index dc78764ccc4c..8bd70d4d184d 100644 --- a/trunk/fs/ocfs2/quota_local.c +++ b/trunk/fs/ocfs2/quota_local.c @@ -971,7 +971,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( u64 p_blkno; /* We are protected by dqio_sem so no locking needed */ - status = ocfs2_extend_no_holes(lqinode, NULL, + status = ocfs2_extend_no_holes(lqinode, lqinode->i_size + 2 * sb->s_blocksize, lqinode->i_size); if (status < 0) { @@ -1114,7 +1114,7 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file( return ocfs2_local_quota_add_chunk(sb, type, offset); /* We are protected by dqio_sem so no locking needed */ - status = ocfs2_extend_no_holes(lqinode, NULL, + status = ocfs2_extend_no_holes(lqinode, lqinode->i_size + sb->s_blocksize, lqinode->i_size); if (status < 0) { diff --git a/trunk/fs/ocfs2/refcounttree.c b/trunk/fs/ocfs2/refcounttree.c index 3ac5aa733e9c..4793f36f6518 100644 --- a/trunk/fs/ocfs2/refcounttree.c +++ b/trunk/fs/ocfs2/refcounttree.c @@ -2931,12 +2931,6 @@ static int ocfs2_duplicate_clusters_by_page(handle_t *handle, offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits; end = offset + (new_len << OCFS2_SB(sb)->s_clustersize_bits); - /* - * We only duplicate pages until we reach the page contains i_size - 1. - * So trim 'end' to i_size. - */ - if (end > i_size_read(context->inode)) - end = i_size_read(context->inode); while (offset < end) { page_index = offset >> PAGE_CACHE_SHIFT; @@ -4172,12 +4166,6 @@ static int __ocfs2_reflink(struct dentry *old_dentry, struct inode *inode = old_dentry->d_inode; struct buffer_head *new_bh = NULL; - if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE) { - ret = -EINVAL; - mlog_errno(ret); - goto out; - } - ret = filemap_fdatawrite(inode->i_mapping); if (ret) { mlog_errno(ret); diff --git a/trunk/fs/ocfs2/suballoc.c b/trunk/fs/ocfs2/suballoc.c index a8e6a95a353f..f4c2a9eb8c4d 100644 --- a/trunk/fs/ocfs2/suballoc.c +++ b/trunk/fs/ocfs2/suballoc.c @@ -741,7 +741,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, le16_to_cpu(bg->bg_free_bits_count)); le32_add_cpu(&cl->cl_recs[alloc_rec].c_total, le16_to_cpu(bg->bg_bits)); - cl->cl_recs[alloc_rec].c_blkno = bg->bg_blkno; + cl->cl_recs[alloc_rec].c_blkno = cpu_to_le64(bg->bg_blkno); if (le16_to_cpu(cl->cl_next_free_rec) < le16_to_cpu(cl->cl_count)) le16_add_cpu(&cl->cl_next_free_rec, 1); diff --git a/trunk/fs/ocfs2/xattr.c b/trunk/fs/ocfs2/xattr.c index d03469f61801..e97b34842cfe 100644 --- a/trunk/fs/ocfs2/xattr.c +++ b/trunk/fs/ocfs2/xattr.c @@ -709,7 +709,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, struct ocfs2_xattr_value_buf *vb, struct ocfs2_xattr_set_ctxt *ctxt) { - int status = 0, credits; + int status = 0; handle_t *handle = ctxt->handle; enum ocfs2_alloc_restarted why; u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters); @@ -719,54 +719,38 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, ocfs2_init_xattr_value_extent_tree(&et, INODE_CACHE(inode), vb); - while (clusters_to_add) { - status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh, - OCFS2_JOURNAL_ACCESS_WRITE); - if (status < 0) { - mlog_errno(status); - break; - } + status = vb->vb_access(handle, INODE_CACHE(inode), vb->vb_bh, + OCFS2_JOURNAL_ACCESS_WRITE); + if (status < 0) { + mlog_errno(status); + goto leave; + } - prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters); - status = ocfs2_add_clusters_in_btree(handle, - &et, - &logical_start, - clusters_to_add, - 0, - ctxt->data_ac, - ctxt->meta_ac, - &why); - if ((status < 0) && (status != -EAGAIN)) { - if (status != -ENOSPC) - mlog_errno(status); - break; - } + prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters); + status = ocfs2_add_clusters_in_btree(handle, + &et, + &logical_start, + clusters_to_add, + 0, + ctxt->data_ac, + ctxt->meta_ac, + &why); + if (status < 0) { + mlog_errno(status); + goto leave; + } - ocfs2_journal_dirty(handle, vb->vb_bh); + ocfs2_journal_dirty(handle, vb->vb_bh); - clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - - prev_clusters; + clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; - if (why != RESTART_NONE && clusters_to_add) { - /* - * We can only fail in case the alloc file doesn't give - * up enough clusters. - */ - BUG_ON(why == RESTART_META); - - mlog(0, "restarting xattr value extension for %u" - " clusters,.\n", clusters_to_add); - credits = ocfs2_calc_extend_credits(inode->i_sb, - &vb->vb_xv->xr_list, - clusters_to_add); - status = ocfs2_extend_trans(handle, credits); - if (status < 0) { - status = -ENOMEM; - mlog_errno(status); - break; - } - } - } + /* + * We should have already allocated enough space before the transaction, + * so no need to restart. + */ + BUG_ON(why != RESTART_NONE || clusters_to_add); + +leave: return status; } @@ -6804,15 +6788,16 @@ static int ocfs2_lock_reflink_xattr_rec_allocators( return ret; } -static int ocfs2_reflink_xattr_bucket(handle_t *handle, +static int ocfs2_reflink_xattr_buckets(handle_t *handle, u64 blkno, u64 new_blkno, u32 clusters, - u32 *cpos, int num_buckets, struct ocfs2_alloc_context *meta_ac, struct ocfs2_alloc_context *data_ac, struct ocfs2_reflink_xattr_tree_args *args) { int i, j, ret = 0; struct super_block *sb = args->reflink->old_inode->i_sb; + u32 bpc = ocfs2_xattr_buckets_per_cluster(OCFS2_SB(sb)); + u32 num_buckets = clusters * bpc; int bpb = args->old_bucket->bu_blocks; struct ocfs2_xattr_value_buf vb = { .vb_access = ocfs2_journal_access, @@ -6831,6 +6816,14 @@ static int ocfs2_reflink_xattr_bucket(handle_t *handle, break; } + /* + * The real bucket num in this series of blocks is stored + * in the 1st bucket. + */ + if (i == 0) + num_buckets = le16_to_cpu( + bucket_xh(args->old_bucket)->xh_num_buckets); + ret = ocfs2_xattr_bucket_journal_access(handle, args->new_bucket, OCFS2_JOURNAL_ACCESS_CREATE); @@ -6844,18 +6837,6 @@ static int ocfs2_reflink_xattr_bucket(handle_t *handle, bucket_block(args->old_bucket, j), sb->s_blocksize); - /* - * Record the start cpos so that we can use it to initialize - * our xattr tree we also set the xh_num_bucket for the new - * bucket. - */ - if (i == 0) { - *cpos = le32_to_cpu(bucket_xh(args->new_bucket)-> - xh_entries[0].xe_name_hash); - bucket_xh(args->new_bucket)->xh_num_buckets = - cpu_to_le16(num_buckets); - } - ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket); ret = ocfs2_reflink_xattr_header(handle, args->reflink, @@ -6885,7 +6866,6 @@ static int ocfs2_reflink_xattr_bucket(handle_t *handle, } ocfs2_xattr_bucket_journal_dirty(handle, args->new_bucket); - ocfs2_xattr_bucket_relse(args->old_bucket); ocfs2_xattr_bucket_relse(args->new_bucket); } @@ -6894,75 +6874,6 @@ static int ocfs2_reflink_xattr_bucket(handle_t *handle, ocfs2_xattr_bucket_relse(args->new_bucket); return ret; } - -static int ocfs2_reflink_xattr_buckets(handle_t *handle, - struct inode *inode, - struct ocfs2_reflink_xattr_tree_args *args, - struct ocfs2_extent_tree *et, - struct ocfs2_alloc_context *meta_ac, - struct ocfs2_alloc_context *data_ac, - u64 blkno, u32 cpos, u32 len) -{ - int ret, first_inserted = 0; - u32 p_cluster, num_clusters, reflink_cpos = 0; - u64 new_blkno; - unsigned int num_buckets, reflink_buckets; - unsigned int bpc = - ocfs2_xattr_buckets_per_cluster(OCFS2_SB(inode->i_sb)); - - ret = ocfs2_read_xattr_bucket(args->old_bucket, blkno); - if (ret) { - mlog_errno(ret); - goto out; - } - num_buckets = le16_to_cpu(bucket_xh(args->old_bucket)->xh_num_buckets); - ocfs2_xattr_bucket_relse(args->old_bucket); - - while (len && num_buckets) { - ret = ocfs2_claim_clusters(handle, data_ac, - 1, &p_cluster, &num_clusters); - if (ret) { - mlog_errno(ret); - goto out; - } - - new_blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); - reflink_buckets = min(num_buckets, bpc * num_clusters); - - ret = ocfs2_reflink_xattr_bucket(handle, blkno, - new_blkno, num_clusters, - &reflink_cpos, reflink_buckets, - meta_ac, data_ac, args); - if (ret) { - mlog_errno(ret); - goto out; - } - - /* - * For the 1st allocated cluster, we make it use the same cpos - * so that the xattr tree looks the same as the original one - * in the most case. - */ - if (!first_inserted) { - reflink_cpos = cpos; - first_inserted = 1; - } - ret = ocfs2_insert_extent(handle, et, reflink_cpos, new_blkno, - num_clusters, 0, meta_ac); - if (ret) - mlog_errno(ret); - - mlog(0, "insert new xattr extent rec start %llu len %u to %u\n", - (unsigned long long)new_blkno, num_clusters, reflink_cpos); - - len -= num_clusters; - blkno += ocfs2_clusters_to_blocks(inode->i_sb, num_clusters); - num_buckets -= reflink_buckets; - } -out: - return ret; -} - /* * Create the same xattr extent record in the new inode's xattr tree. */ @@ -6974,6 +6885,8 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, void *para) { int ret, credits = 0; + u32 p_cluster, num_clusters; + u64 new_blkno; handle_t *handle; struct ocfs2_reflink_xattr_tree_args *args = (struct ocfs2_reflink_xattr_tree_args *)para; @@ -6982,9 +6895,6 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, struct ocfs2_alloc_context *data_ac = NULL; struct ocfs2_extent_tree et; - mlog(0, "reflink xattr buckets %llu len %u\n", - (unsigned long long)blkno, len); - ocfs2_init_xattr_tree_extent_tree(&et, INODE_CACHE(args->reflink->new_inode), args->new_blk_bh); @@ -7004,12 +6914,32 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, goto out; } - ret = ocfs2_reflink_xattr_buckets(handle, inode, args, &et, - meta_ac, data_ac, - blkno, cpos, len); + ret = ocfs2_claim_clusters(handle, data_ac, + len, &p_cluster, &num_clusters); + if (ret) { + mlog_errno(ret); + goto out_commit; + } + + new_blkno = ocfs2_clusters_to_blocks(osb->sb, p_cluster); + + mlog(0, "reflink xattr buckets %llu to %llu, len %u\n", + (unsigned long long)blkno, (unsigned long long)new_blkno, len); + ret = ocfs2_reflink_xattr_buckets(handle, blkno, new_blkno, len, + meta_ac, data_ac, args); + if (ret) { + mlog_errno(ret); + goto out_commit; + } + + mlog(0, "insert new xattr extent rec start %llu len %u to %u\n", + (unsigned long long)new_blkno, len, cpos); + ret = ocfs2_insert_extent(handle, &et, cpos, new_blkno, + len, 0, meta_ac); if (ret) mlog_errno(ret); +out_commit: ocfs2_commit_trans(osb, handle); out: diff --git a/trunk/fs/partitions/ibm.c b/trunk/fs/partitions/ibm.c index fc8497643fd0..3e73de5967ff 100644 --- a/trunk/fs/partitions/ibm.c +++ b/trunk/fs/partitions/ibm.c @@ -74,7 +74,6 @@ int ibm_partition(struct parsed_partitions *state) } *label; unsigned char *data; Sector sect; - sector_t labelsect; res = 0; blocksize = bdev_logical_block_size(bdev); @@ -98,20 +97,11 @@ int ibm_partition(struct parsed_partitions *state) ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) goto out_freeall; - /* - * Special case for FBA disks: label sector does not depend on - * blocksize. - */ - if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) || - (info->cu_type == 0x3880 && info->dev_type == 0x3370)) - labelsect = info->label_block; - else - labelsect = info->label_block * (blocksize >> 9); - /* * Get volume label, extract name and type. */ - data = read_part_sector(state, labelsect, §); + data = read_part_sector(state, info->label_block*(blocksize/512), + §); if (data == NULL) goto out_readerr; diff --git a/trunk/fs/quota/dquot.c b/trunk/fs/quota/dquot.c index 437d2ca2de97..12c233da1b6b 100644 --- a/trunk/fs/quota/dquot.c +++ b/trunk/fs/quota/dquot.c @@ -676,7 +676,7 @@ static void prune_dqcache(int count) * This is called from kswapd when we think we need some * more memory */ -static int shrink_dqcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask) +static int shrink_dqcache_memory(int nr, gfp_t gfp_mask) { if (nr) { spin_lock(&dq_list_lock); diff --git a/trunk/fs/ubifs/shrinker.c b/trunk/fs/ubifs/shrinker.c index 0b201114a5ad..02feb59cefca 100644 --- a/trunk/fs/ubifs/shrinker.c +++ b/trunk/fs/ubifs/shrinker.c @@ -277,7 +277,7 @@ static int kick_a_thread(void) return 0; } -int ubifs_shrinker(struct shrinker *shrink, int nr, gfp_t gfp_mask) +int ubifs_shrinker(int nr, gfp_t gfp_mask) { int freed, contention = 0; long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt); diff --git a/trunk/fs/ubifs/ubifs.h b/trunk/fs/ubifs/ubifs.h index 04310878f449..2eef553d50c8 100644 --- a/trunk/fs/ubifs/ubifs.h +++ b/trunk/fs/ubifs/ubifs.h @@ -1575,7 +1575,7 @@ int ubifs_tnc_start_commit(struct ubifs_info *c, struct ubifs_zbranch *zroot); int ubifs_tnc_end_commit(struct ubifs_info *c); /* shrinker.c */ -int ubifs_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask); +int ubifs_shrinker(int nr_to_scan, gfp_t gfp_mask); /* commit.c */ int ubifs_bg_thread(void *info); diff --git a/trunk/fs/xfs/linux-2.6/xfs_buf.c b/trunk/fs/xfs/linux-2.6/xfs_buf.c index 2ee3f7a60163..649ade8ef598 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_buf.c +++ b/trunk/fs/xfs/linux-2.6/xfs_buf.c @@ -45,7 +45,7 @@ static kmem_zone_t *xfs_buf_zone; STATIC int xfsbufd(void *); -STATIC int xfsbufd_wakeup(struct shrinker *, int, gfp_t); +STATIC int xfsbufd_wakeup(int, gfp_t); STATIC void xfs_buf_delwri_queue(xfs_buf_t *, int); static struct shrinker xfs_buf_shake = { .shrink = xfsbufd_wakeup, @@ -340,7 +340,7 @@ _xfs_buf_lookup_pages( __func__, gfp_mask); XFS_STATS_INC(xb_page_retries); - xfsbufd_wakeup(NULL, 0, gfp_mask); + xfsbufd_wakeup(0, gfp_mask); congestion_wait(BLK_RW_ASYNC, HZ/50); goto retry; } @@ -1762,7 +1762,6 @@ xfs_buf_runall_queues( STATIC int xfsbufd_wakeup( - struct shrinker *shrink, int priority, gfp_t mask) { diff --git a/trunk/fs/xfs/linux-2.6/xfs_super.c b/trunk/fs/xfs/linux-2.6/xfs_super.c index 80938c736c27..f2d1718c9165 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_super.c +++ b/trunk/fs/xfs/linux-2.6/xfs_super.c @@ -1883,6 +1883,7 @@ init_xfs_fs(void) goto out_cleanup_procfs; vfs_initquota(); + xfs_inode_shrinker_init(); error = register_filesystem(&xfs_fs_type); if (error) @@ -1910,6 +1911,7 @@ exit_xfs_fs(void) { vfs_exitquota(); unregister_filesystem(&xfs_fs_type); + xfs_inode_shrinker_destroy(); xfs_sysctl_unregister(); xfs_cleanup_procfs(); xfs_buf_terminate(); diff --git a/trunk/fs/xfs/linux-2.6/xfs_sync.c b/trunk/fs/xfs/linux-2.6/xfs_sync.c index a51a07c3a70c..ef7f0218bccb 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_sync.c +++ b/trunk/fs/xfs/linux-2.6/xfs_sync.c @@ -144,41 +144,6 @@ xfs_inode_ag_walk( return last_error; } -/* - * Select the next per-ag structure to iterate during the walk. The reclaim - * walk is optimised only to walk AGs with reclaimable inodes in them. - */ -static struct xfs_perag * -xfs_inode_ag_iter_next_pag( - struct xfs_mount *mp, - xfs_agnumber_t *first, - int tag) -{ - struct xfs_perag *pag = NULL; - - if (tag == XFS_ICI_RECLAIM_TAG) { - int found; - int ref; - - spin_lock(&mp->m_perag_lock); - found = radix_tree_gang_lookup_tag(&mp->m_perag_tree, - (void **)&pag, *first, 1, tag); - if (found <= 0) { - spin_unlock(&mp->m_perag_lock); - return NULL; - } - *first = pag->pag_agno + 1; - /* open coded pag reference increment */ - ref = atomic_inc_return(&pag->pag_ref); - spin_unlock(&mp->m_perag_lock); - trace_xfs_perag_get_reclaim(mp, pag->pag_agno, ref, _RET_IP_); - } else { - pag = xfs_perag_get(mp, *first); - (*first)++; - } - return pag; -} - int xfs_inode_ag_iterator( struct xfs_mount *mp, @@ -189,15 +154,16 @@ xfs_inode_ag_iterator( int exclusive, int *nr_to_scan) { - struct xfs_perag *pag; int error = 0; int last_error = 0; xfs_agnumber_t ag; int nr; nr = nr_to_scan ? *nr_to_scan : INT_MAX; - ag = 0; - while ((pag = xfs_inode_ag_iter_next_pag(mp, &ag, tag))) { + for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) { + struct xfs_perag *pag; + + pag = xfs_perag_get(mp, ag); error = xfs_inode_ag_walk(mp, pag, execute, flags, tag, exclusive, &nr); xfs_perag_put(pag); @@ -674,17 +640,6 @@ __xfs_inode_set_reclaim_tag( radix_tree_tag_set(&pag->pag_ici_root, XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), XFS_ICI_RECLAIM_TAG); - - if (!pag->pag_ici_reclaimable) { - /* propagate the reclaim tag up into the perag radix tree */ - spin_lock(&ip->i_mount->m_perag_lock); - radix_tree_tag_set(&ip->i_mount->m_perag_tree, - XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), - XFS_ICI_RECLAIM_TAG); - spin_unlock(&ip->i_mount->m_perag_lock); - trace_xfs_perag_set_reclaim(ip->i_mount, pag->pag_agno, - -1, _RET_IP_); - } pag->pag_ici_reclaimable++; } @@ -719,16 +674,6 @@ __xfs_inode_clear_reclaim_tag( radix_tree_tag_clear(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG); pag->pag_ici_reclaimable--; - if (!pag->pag_ici_reclaimable) { - /* clear the reclaim tag from the perag radix tree */ - spin_lock(&ip->i_mount->m_perag_lock); - radix_tree_tag_clear(&ip->i_mount->m_perag_tree, - XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), - XFS_ICI_RECLAIM_TAG); - spin_unlock(&ip->i_mount->m_perag_lock); - trace_xfs_perag_clear_reclaim(ip->i_mount, pag->pag_agno, - -1, _RET_IP_); - } } /* @@ -883,52 +828,83 @@ xfs_reclaim_inodes( /* * Shrinker infrastructure. + * + * This is all far more complex than it needs to be. It adds a global list of + * mounts because the shrinkers can only call a global context. We need to make + * the shrinkers pass a context to avoid the need for global state. */ +static LIST_HEAD(xfs_mount_list); +static struct rw_semaphore xfs_mount_list_lock; + static int xfs_reclaim_inode_shrink( - struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) { struct xfs_mount *mp; struct xfs_perag *pag; xfs_agnumber_t ag; - int reclaimable; + int reclaimable = 0; - mp = container_of(shrink, struct xfs_mount, m_inode_shrink); if (nr_to_scan) { if (!(gfp_mask & __GFP_FS)) return -1; - xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0, + down_read(&xfs_mount_list_lock); + list_for_each_entry(mp, &xfs_mount_list, m_mplist) { + xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0, XFS_ICI_RECLAIM_TAG, 1, &nr_to_scan); - /* if we don't exhaust the scan, don't bother coming back */ - if (nr_to_scan > 0) - return -1; - } + if (nr_to_scan <= 0) + break; + } + up_read(&xfs_mount_list_lock); + } - reclaimable = 0; - ag = 0; - while ((pag = xfs_inode_ag_iter_next_pag(mp, &ag, - XFS_ICI_RECLAIM_TAG))) { - reclaimable += pag->pag_ici_reclaimable; - xfs_perag_put(pag); + down_read(&xfs_mount_list_lock); + list_for_each_entry(mp, &xfs_mount_list, m_mplist) { + for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) { + pag = xfs_perag_get(mp, ag); + reclaimable += pag->pag_ici_reclaimable; + xfs_perag_put(pag); + } } + up_read(&xfs_mount_list_lock); return reclaimable; } +static struct shrinker xfs_inode_shrinker = { + .shrink = xfs_reclaim_inode_shrink, + .seeks = DEFAULT_SEEKS, +}; + +void __init +xfs_inode_shrinker_init(void) +{ + init_rwsem(&xfs_mount_list_lock); + register_shrinker(&xfs_inode_shrinker); +} + +void +xfs_inode_shrinker_destroy(void) +{ + ASSERT(list_empty(&xfs_mount_list)); + unregister_shrinker(&xfs_inode_shrinker); +} + void xfs_inode_shrinker_register( struct xfs_mount *mp) { - mp->m_inode_shrink.shrink = xfs_reclaim_inode_shrink; - mp->m_inode_shrink.seeks = DEFAULT_SEEKS; - register_shrinker(&mp->m_inode_shrink); + down_write(&xfs_mount_list_lock); + list_add_tail(&mp->m_mplist, &xfs_mount_list); + up_write(&xfs_mount_list_lock); } void xfs_inode_shrinker_unregister( struct xfs_mount *mp) { - unregister_shrinker(&mp->m_inode_shrink); + down_write(&xfs_mount_list_lock); + list_del(&mp->m_mplist); + up_write(&xfs_mount_list_lock); } diff --git a/trunk/fs/xfs/linux-2.6/xfs_sync.h b/trunk/fs/xfs/linux-2.6/xfs_sync.h index e28139aaa4aa..cdcbaaca9880 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_sync.h +++ b/trunk/fs/xfs/linux-2.6/xfs_sync.h @@ -55,6 +55,8 @@ int xfs_inode_ag_iterator(struct xfs_mount *mp, int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags), int flags, int tag, int write_lock, int *nr_to_scan); +void xfs_inode_shrinker_init(void); +void xfs_inode_shrinker_destroy(void); void xfs_inode_shrinker_register(struct xfs_mount *mp); void xfs_inode_shrinker_unregister(struct xfs_mount *mp); diff --git a/trunk/fs/xfs/linux-2.6/xfs_trace.h b/trunk/fs/xfs/linux-2.6/xfs_trace.h index 302820690904..73d5aa117384 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_trace.h +++ b/trunk/fs/xfs/linux-2.6/xfs_trace.h @@ -124,10 +124,7 @@ DEFINE_EVENT(xfs_perag_class, name, \ unsigned long caller_ip), \ TP_ARGS(mp, agno, refcount, caller_ip)) DEFINE_PERAG_REF_EVENT(xfs_perag_get); -DEFINE_PERAG_REF_EVENT(xfs_perag_get_reclaim); DEFINE_PERAG_REF_EVENT(xfs_perag_put); -DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim); -DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim); TRACE_EVENT(xfs_attr_list_node_descend, TP_PROTO(struct xfs_attr_list_context *ctx, diff --git a/trunk/fs/xfs/quota/xfs_qm.c b/trunk/fs/xfs/quota/xfs_qm.c index 67c018392d62..8c117ff2e3ab 100644 --- a/trunk/fs/xfs/quota/xfs_qm.c +++ b/trunk/fs/xfs/quota/xfs_qm.c @@ -69,7 +69,7 @@ STATIC void xfs_qm_list_destroy(xfs_dqlist_t *); STATIC int xfs_qm_init_quotainos(xfs_mount_t *); STATIC int xfs_qm_init_quotainfo(xfs_mount_t *); -STATIC int xfs_qm_shake(struct shrinker *, int, gfp_t); +STATIC int xfs_qm_shake(int, gfp_t); static struct shrinker xfs_qm_shaker = { .shrink = xfs_qm_shake, @@ -2117,10 +2117,7 @@ xfs_qm_shake_freelist( */ /* ARGSUSED */ STATIC int -xfs_qm_shake( - struct shrinker *shrink, - int nr_to_scan, - gfp_t gfp_mask) +xfs_qm_shake(int nr_to_scan, gfp_t gfp_mask) { int ndqused, nfree, n; diff --git a/trunk/fs/xfs/xfs_mount.h b/trunk/fs/xfs/xfs_mount.h index 5761087ee8ea..1d2c7eed4eda 100644 --- a/trunk/fs/xfs/xfs_mount.h +++ b/trunk/fs/xfs/xfs_mount.h @@ -259,7 +259,7 @@ typedef struct xfs_mount { wait_queue_head_t m_wait_single_sync_task; __int64_t m_update_flags; /* sb flags we need to update on the next remount,rw */ - struct shrinker m_inode_shrink; /* inode reclaim shrinker */ + struct list_head m_mplist; /* inode shrinker mount list */ } xfs_mount_t; /* diff --git a/trunk/include/linux/fb.h b/trunk/include/linux/fb.h index e7445df44d6c..8e5a9dfb76bf 100644 --- a/trunk/include/linux/fb.h +++ b/trunk/include/linux/fb.h @@ -873,8 +873,6 @@ struct fb_info { static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct) + max_num * sizeof(struct aperture), GFP_KERNEL); - if (!a) - return NULL; a->count = max_num; return a; } diff --git a/trunk/include/linux/fdtable.h b/trunk/include/linux/fdtable.h index d147461bc271..013dc529e95f 100644 --- a/trunk/include/linux/fdtable.h +++ b/trunk/include/linux/fdtable.h @@ -61,8 +61,7 @@ struct files_struct { (rcu_dereference_check((fdtfd), \ rcu_read_lock_held() || \ lockdep_is_held(&(files)->file_lock) || \ - atomic_read(&(files)->count) == 1 || \ - rcu_my_thread_group_empty())) + atomic_read(&(files)->count) == 1)) #define files_fdtable(files) \ (rcu_dereference_check_fdtable((files), (files)->fdt)) diff --git a/trunk/include/linux/i8042.h b/trunk/include/linux/i8042.h index a986ff588944..9bf6870ee5f4 100644 --- a/trunk/include/linux/i8042.h +++ b/trunk/include/linux/i8042.h @@ -46,31 +46,31 @@ int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, #else -static inline void i8042_lock_chip(void) +void i8042_lock_chip(void) { } -static inline void i8042_unlock_chip(void) +void i8042_unlock_chip(void) { } -static inline int i8042_command(unsigned char *param, int command) +int i8042_command(unsigned char *param, int command) { return -ENODEV; } -static inline bool i8042_check_port_owner(const struct serio *serio) +bool i8042_check_port_owner(const struct serio *serio) { return false; } -static inline int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, +int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, struct serio *serio)) { return -ENODEV; } -static inline int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, +int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, struct serio *serio)) { return -ENODEV; diff --git a/trunk/include/linux/jbd2.h b/trunk/include/linux/jbd2.h index adf832dec3f3..a4d2e9f7088a 100644 --- a/trunk/include/linux/jbd2.h +++ b/trunk/include/linux/jbd2.h @@ -1026,12 +1026,11 @@ void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); struct jbd2_buffer_trigger_type { /* - * Fired a the moment data to write to the journal are known to be - * stable - so either at the moment b_frozen_data is created or just - * before a buffer is written to the journal. mapped_data is a mapped - * buffer that is the frozen data for commit. + * Fired just before a buffer is written to the journal. + * mapped_data is a mapped buffer that is the frozen data for + * commit. */ - void (*t_frozen)(struct jbd2_buffer_trigger_type *type, + void (*t_commit)(struct jbd2_buffer_trigger_type *type, struct buffer_head *bh, void *mapped_data, size_t size); @@ -1043,7 +1042,7 @@ struct jbd2_buffer_trigger_type { struct buffer_head *bh); }; -extern void jbd2_buffer_frozen_trigger(struct journal_head *jh, +extern void jbd2_buffer_commit_trigger(struct journal_head *jh, void *mapped_data, struct jbd2_buffer_trigger_type *triggers); extern void jbd2_buffer_abort_trigger(struct journal_head *jh, diff --git a/trunk/include/linux/mm.h b/trunk/include/linux/mm.h index a2b48041b910..b969efb03787 100644 --- a/trunk/include/linux/mm.h +++ b/trunk/include/linux/mm.h @@ -999,7 +999,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) * querying the cache size, so a fastpath for that case is appropriate. */ struct shrinker { - int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); + int (*shrink)(int nr_to_scan, gfp_t gfp_mask); int seeks; /* seeks to recreate an obj */ /* These are for internal use */ diff --git a/trunk/include/linux/pci.h b/trunk/include/linux/pci.h index f26fda76b87f..7cb00845f150 100644 --- a/trunk/include/linux/pci.h +++ b/trunk/include/linux/pci.h @@ -288,7 +288,6 @@ struct pci_dev { */ unsigned int irq; struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */ - resource_size_t fw_addr[DEVICE_COUNT_RESOURCE]; /* FW-assigned addr */ /* These fields are used by common fixups */ unsigned int transparent:1; /* Transparent PCI bridge */ diff --git a/trunk/include/linux/syscalls.h b/trunk/include/linux/syscalls.h index 13ebb5413a79..7f614ce274a9 100644 --- a/trunk/include/linux/syscalls.h +++ b/trunk/include/linux/syscalls.h @@ -124,8 +124,7 @@ extern struct trace_event_functions enter_syscall_print_funcs; extern struct trace_event_functions exit_syscall_print_funcs; #define SYSCALL_TRACE_ENTER_EVENT(sname) \ - static struct syscall_metadata \ - __attribute__((__aligned__(4))) __syscall_meta_##sname; \ + static struct syscall_metadata __syscall_meta_##sname; \ static struct ftrace_event_call \ __attribute__((__aligned__(4))) event_enter_##sname; \ static struct ftrace_event_call __used \ @@ -139,8 +138,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; } #define SYSCALL_TRACE_EXIT_EVENT(sname) \ - static struct syscall_metadata \ - __attribute__((__aligned__(4))) __syscall_meta_##sname; \ + static struct syscall_metadata __syscall_meta_##sname; \ static struct ftrace_event_call \ __attribute__((__aligned__(4))) event_exit_##sname; \ static struct ftrace_event_call __used \ diff --git a/trunk/include/linux/vgaarb.h b/trunk/include/linux/vgaarb.h index 814f294d4cd0..c9a975976995 100644 --- a/trunk/include/linux/vgaarb.h +++ b/trunk/include/linux/vgaarb.h @@ -29,7 +29,6 @@ */ #ifndef LINUX_VGA_H -#define LINUX_VGA_H #include diff --git a/trunk/include/math-emu/op-common.h b/trunk/include/math-emu/op-common.h index 9696a5e2c437..fd882261225e 100644 --- a/trunk/include/math-emu/op-common.h +++ b/trunk/include/math-emu/op-common.h @@ -799,7 +799,7 @@ do { \ X##_e -= (_FP_W_TYPE_SIZE - rsize); \ X##_e = rsize - X##_e - 1; \ \ - if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs <= X##_e) \ + if (_FP_FRACBITS_##fs < rsize && _FP_WFRACBITS_##fs < X##_e) \ __FP_FRAC_SRS_1(ur_, (X##_e - _FP_WFRACBITS_##fs + 1), rsize);\ _FP_FRAC_DISASSEMBLE_##wc(X, ur_, rsize); \ if ((_FP_WFRACBITS_##fs - X##_e - 1) > 0) \ diff --git a/trunk/include/net/sock.h b/trunk/include/net/sock.h index 0a691ea7654a..731150d52799 100644 --- a/trunk/include/net/sock.h +++ b/trunk/include/net/sock.h @@ -1224,7 +1224,12 @@ static inline void sk_tx_queue_clear(struct sock *sk) static inline int sk_tx_queue_get(const struct sock *sk) { - return sk ? sk->sk_tx_queue_mapping : -1; + return sk->sk_tx_queue_mapping; +} + +static inline bool sk_tx_queue_recorded(const struct sock *sk) +{ + return (sk && sk->sk_tx_queue_mapping >= 0); } static inline void sk_set_socket(struct sock *sk, struct socket *sock) diff --git a/trunk/ipc/sem.c b/trunk/ipc/sem.c index 40a8f462a822..506c8491a8d1 100644 --- a/trunk/ipc/sem.c +++ b/trunk/ipc/sem.c @@ -1256,33 +1256,6 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid) return un; } - -/** - * get_queue_result - Retrieve the result code from sem_queue - * @q: Pointer to queue structure - * - * Retrieve the return code from the pending queue. If IN_WAKEUP is found in - * q->status, then we must loop until the value is replaced with the final - * value: This may happen if a task is woken up by an unrelated event (e.g. - * signal) and in parallel the task is woken up by another task because it got - * the requested semaphores. - * - * The function can be called with or without holding the semaphore spinlock. - */ -static int get_queue_result(struct sem_queue *q) -{ - int error; - - error = q->status; - while (unlikely(error == IN_WAKEUP)) { - cpu_relax(); - error = q->status; - } - - return error; -} - - SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, unsigned, nsops, const struct timespec __user *, timeout) { @@ -1436,18 +1409,15 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, else schedule(); - error = get_queue_result(&queue); + error = queue.status; + while(unlikely(error == IN_WAKEUP)) { + cpu_relax(); + error = queue.status; + } if (error != -EINTR) { /* fast path: update_queue already obtained all requested - * resources. - * Perform a smp_mb(): User space could assume that semop() - * is a memory barrier: Without the mb(), the cpu could - * speculatively read in user space stale data that was - * overwritten by the previous owner of the semaphore. - */ - smp_mb(); - + * resources */ goto out_free; } @@ -1457,12 +1427,10 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, goto out_free; } - error = get_queue_result(&queue); - /* * If queue.status != -EINTR we are woken up by another process */ - + error = queue.status; if (error != -EINTR) { goto out_unlock_free; } diff --git a/trunk/kernel/early_res.c b/trunk/kernel/early_res.c index 7bfae887f211..31aa9332ef3f 100644 --- a/trunk/kernel/early_res.c +++ b/trunk/kernel/early_res.c @@ -7,8 +7,6 @@ #include #include #include -#include -#include /* * Early reserved memory areas. @@ -321,8 +319,6 @@ void __init free_early(u64 start, u64 end) struct early_res *r; int i; - kmemleak_free_part(__va(start), end - start); - i = find_overlapped_early(start, end); r = &early_res[i]; if (i >= max_early_res || r->end != end || r->start != start) @@ -337,8 +333,6 @@ void __init free_early_partial(u64 start, u64 end) struct early_res *r; int i; - kmemleak_free_part(__va(start), end - start); - if (start == end) return; diff --git a/trunk/mm/bootmem.c b/trunk/mm/bootmem.c index 142c84a54993..58c66cc5056a 100644 --- a/trunk/mm/bootmem.c +++ b/trunk/mm/bootmem.c @@ -833,24 +833,15 @@ static void * __init ___alloc_bootmem_node(bootmem_data_t *bdata, void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - void *ptr; - if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); #ifdef CONFIG_NO_BOOTMEM - ptr = __alloc_memory_core_early(pgdat->node_id, size, align, - goal, -1ULL); - if (ptr) - return ptr; - - ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, + return __alloc_memory_core_early(pgdat->node_id, size, align, goal, -1ULL); #else - ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0); + return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0); #endif - - return ptr; } void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, @@ -986,21 +977,14 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - void *ptr; - if (WARN_ON_ONCE(slab_is_available())) return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); #ifdef CONFIG_NO_BOOTMEM - ptr = __alloc_memory_core_early(pgdat->node_id, size, align, - goal, ARCH_LOW_ADDRESS_LIMIT); - if (ptr) - return ptr; - ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, + return __alloc_memory_core_early(pgdat->node_id, size, align, goal, ARCH_LOW_ADDRESS_LIMIT); #else - ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, + return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, ARCH_LOW_ADDRESS_LIMIT); #endif - return ptr; } diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 9bd339eb04c6..431214b941ac 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -3634,9 +3634,6 @@ void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, int i; void *ptr; - if (limit > get_max_mapped()) - limit = get_max_mapped(); - /* need to go over early_node_map to find out good range for node */ for_each_active_range_index_in_nid(i, nid) { u64 addr; @@ -3662,11 +3659,6 @@ void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, ptr = phys_to_virt(addr); memset(ptr, 0, size); reserve_early_without_check(addr, addr + size, "BOOTMEM"); - /* - * The min_count is set to 0 so that bootmem allocated blocks - * are never reported as leaks. - */ - kmemleak_alloc(ptr, size, 0, 0); return ptr; } diff --git a/trunk/mm/page_cgroup.c b/trunk/mm/page_cgroup.c index 5bffada7cde1..6c0081441a32 100644 --- a/trunk/mm/page_cgroup.c +++ b/trunk/mm/page_cgroup.c @@ -9,7 +9,6 @@ #include #include #include -#include static void __meminit __init_page_cgroup(struct page_cgroup *pc, unsigned long pfn) @@ -127,12 +126,6 @@ static int __init_refok init_section_page_cgroup(unsigned long pfn) if (!base) base = vmalloc(table_size); } - /* - * The value stored in section->page_cgroup is (base - pfn) - * and it does not point to the memory block allocated above, - * causing kmemleak false positives. - */ - kmemleak_not_leak(base); } else { /* * We don't have to allocate page_cgroup again, but diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index b94fe1b3da43..9c7e57cc63a3 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -213,9 +213,8 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, list_for_each_entry(shrinker, &shrinker_list, list) { unsigned long long delta; unsigned long total_scan; - unsigned long max_pass; + unsigned long max_pass = (*shrinker->shrink)(0, gfp_mask); - max_pass = (*shrinker->shrink)(shrinker, 0, gfp_mask); delta = (4 * scanned) / shrinker->seeks; delta *= max_pass; do_div(delta, lru_pages + 1); @@ -243,9 +242,8 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, int shrink_ret; int nr_before; - nr_before = (*shrinker->shrink)(shrinker, 0, gfp_mask); - shrink_ret = (*shrinker->shrink)(shrinker, this_scan, - gfp_mask); + nr_before = (*shrinker->shrink)(0, gfp_mask); + shrink_ret = (*shrinker->shrink)(this_scan, gfp_mask); if (shrink_ret == -1) break; if (shrink_ret < nr_before) @@ -298,7 +296,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi) static void handle_write_error(struct address_space *mapping, struct page *page, int error) { - lock_page_nosync(page); + lock_page(page); if (page_mapping(page) == mapping) mapping_set_error(mapping, error); unlock_page(page); diff --git a/trunk/net/bluetooth/hci_conn.c b/trunk/net/bluetooth/hci_conn.c index 800b6b9fbbae..b10e3cdb08f8 100644 --- a/trunk/net/bluetooth/hci_conn.c +++ b/trunk/net/bluetooth/hci_conn.c @@ -358,11 +358,6 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 acl->sec_level = sec_level; acl->auth_type = auth_type; hci_acl_connect(acl); - } else { - if (acl->sec_level < sec_level) - acl->sec_level = sec_level; - if (acl->auth_type < auth_type) - acl->auth_type = auth_type; } if (type == ACL_LINK) diff --git a/trunk/net/bluetooth/hci_event.c b/trunk/net/bluetooth/hci_event.c index 786b5de0bac4..6c57fc71c7e2 100644 --- a/trunk/net/bluetooth/hci_event.c +++ b/trunk/net/bluetooth/hci_event.c @@ -1049,8 +1049,6 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s if (conn) { if (!ev->status) conn->link_mode |= HCI_LM_AUTH; - else - conn->sec_level = BT_SECURITY_LOW; clear_bit(HCI_CONN_AUTH_PEND, &conn->pend); diff --git a/trunk/net/bluetooth/l2cap.c b/trunk/net/bluetooth/l2cap.c index cf3c4073a8a6..1b682a5aa061 100644 --- a/trunk/net/bluetooth/l2cap.c +++ b/trunk/net/bluetooth/l2cap.c @@ -401,11 +401,6 @@ static inline void l2cap_send_rr_or_rnr(struct l2cap_pinfo *pi, u16 control) l2cap_send_sframe(pi, control); } -static inline int __l2cap_no_conn_pending(struct sock *sk) -{ - return !(l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND); -} - static void l2cap_do_start(struct sock *sk) { struct l2cap_conn *conn = l2cap_pi(sk)->conn; @@ -414,13 +409,12 @@ static void l2cap_do_start(struct sock *sk) if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE)) return; - if (l2cap_check_security(sk) && __l2cap_no_conn_pending(sk)) { + if (l2cap_check_security(sk)) { struct l2cap_conn_req req; req.scid = cpu_to_le16(l2cap_pi(sk)->scid); req.psm = l2cap_pi(sk)->psm; l2cap_pi(sk)->ident = l2cap_get_ident(conn); - l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; l2cap_send_cmd(conn, l2cap_pi(sk)->ident, L2CAP_CONN_REQ, sizeof(req), &req); @@ -470,14 +464,12 @@ static void l2cap_conn_start(struct l2cap_conn *conn) } if (sk->sk_state == BT_CONNECT) { - if (l2cap_check_security(sk) && - __l2cap_no_conn_pending(sk)) { + if (l2cap_check_security(sk)) { struct l2cap_conn_req req; req.scid = cpu_to_le16(l2cap_pi(sk)->scid); req.psm = l2cap_pi(sk)->psm; l2cap_pi(sk)->ident = l2cap_get_ident(conn); - l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; l2cap_send_cmd(conn, l2cap_pi(sk)->ident, L2CAP_CONN_REQ, sizeof(req), &req); @@ -2920,6 +2912,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd l2cap_pi(sk)->ident = 0; l2cap_pi(sk)->dcid = dcid; l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT; + l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND; l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ, @@ -4411,7 +4404,6 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) req.psm = l2cap_pi(sk)->psm; l2cap_pi(sk)->ident = l2cap_get_ident(conn); - l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND; l2cap_send_cmd(conn, l2cap_pi(sk)->ident, L2CAP_CONN_REQ, sizeof(req), &req); diff --git a/trunk/net/bridge/br_device.c b/trunk/net/bridge/br_device.c index 753fc4221f3c..eedf2c94820e 100644 --- a/trunk/net/bridge/br_device.c +++ b/trunk/net/bridge/br_device.c @@ -217,6 +217,14 @@ static bool br_devices_support_netpoll(struct net_bridge *br) return count != 0 && ret; } +static void br_poll_controller(struct net_device *br_dev) +{ + struct netpoll *np = br_dev->npinfo->netpoll; + + if (np->real_dev != br_dev) + netpoll_poll_dev(np->real_dev); +} + void br_netpoll_cleanup(struct net_device *dev) { struct net_bridge *br = netdev_priv(dev); @@ -287,6 +295,7 @@ static const struct net_device_ops br_netdev_ops = { .ndo_do_ioctl = br_dev_ioctl, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_netpoll_cleanup = br_netpoll_cleanup, + .ndo_poll_controller = br_poll_controller, #endif }; diff --git a/trunk/net/bridge/br_forward.c b/trunk/net/bridge/br_forward.c index 595da45f9088..a4e72a89e4ff 100644 --- a/trunk/net/bridge/br_forward.c +++ b/trunk/net/bridge/br_forward.c @@ -50,7 +50,14 @@ int br_dev_queue_push_xmit(struct sk_buff *skb) kfree_skb(skb); else { skb_push(skb, ETH_HLEN); - dev_queue_xmit(skb); + +#ifdef CONFIG_NET_POLL_CONTROLLER + if (unlikely(skb->dev->priv_flags & IFF_IN_NETPOLL)) { + netpoll_send_skb(skb->dev->npinfo->netpoll, skb); + skb->dev->priv_flags &= ~IFF_IN_NETPOLL; + } else +#endif + dev_queue_xmit(skb); } } @@ -66,9 +73,23 @@ int br_forward_finish(struct sk_buff *skb) static void __br_deliver(const struct net_bridge_port *to, struct sk_buff *skb) { +#ifdef CONFIG_NET_POLL_CONTROLLER + struct net_bridge *br = to->br; + if (unlikely(br->dev->priv_flags & IFF_IN_NETPOLL)) { + struct netpoll *np; + to->dev->npinfo = skb->dev->npinfo; + np = skb->dev->npinfo->netpoll; + np->real_dev = np->dev = to->dev; + to->dev->priv_flags |= IFF_IN_NETPOLL; + } +#endif skb->dev = to->dev; NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev, br_forward_finish); +#ifdef CONFIG_NET_POLL_CONTROLLER + if (skb->dev->npinfo) + skb->dev->npinfo->netpoll->dev = br->dev; +#endif } static void __br_forward(const struct net_bridge_port *to, struct sk_buff *skb) diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 0ea10f849be8..723a34710ad4 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -1911,16 +1911,8 @@ static int dev_gso_segment(struct sk_buff *skb) */ static inline void skb_orphan_try(struct sk_buff *skb) { - struct sock *sk = skb->sk; - - if (sk && !skb_tx(skb)->flags) { - /* skb_tx_hash() wont be able to get sk. - * We copy sk_hash into skb->rxhash - */ - if (!skb->rxhash) - skb->rxhash = sk->sk_hash; + if (!skb_tx(skb)->flags) skb_orphan(skb); - } } int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, @@ -2006,7 +1998,8 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb) if (skb->sk && skb->sk->sk_hash) hash = skb->sk->sk_hash; else - hash = (__force u16) skb->protocol ^ skb->rxhash; + hash = (__force u16) skb->protocol; + hash = jhash_1word(hash, hashrnd); return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32); @@ -2029,11 +2022,12 @@ static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index) static struct netdev_queue *dev_pick_tx(struct net_device *dev, struct sk_buff *skb) { - int queue_index; + u16 queue_index; struct sock *sk = skb->sk; - queue_index = sk_tx_queue_get(sk); - if (queue_index < 0) { + if (sk_tx_queue_recorded(sk)) { + queue_index = sk_tx_queue_get(sk); + } else { const struct net_device_ops *ops = dev->netdev_ops; if (ops->ndo_select_queue) { diff --git a/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index a4e0a7482c2b..6ba1c0eece03 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/net/core/neighbour.c @@ -949,10 +949,7 @@ static void neigh_update_hhs(struct neighbour *neigh) { struct hh_cache *hh; void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *) - = NULL; - - if (neigh->dev->header_ops) - update = neigh->dev->header_ops->cache_update; + = neigh->dev->header_ops->cache_update; if (update) { for (hh = neigh->hh; hh; hh = hh->hh_next) { diff --git a/trunk/net/dsa/Kconfig b/trunk/net/dsa/Kconfig index 11201784d29a..c51b55400dc5 100644 --- a/trunk/net/dsa/Kconfig +++ b/trunk/net/dsa/Kconfig @@ -1,7 +1,7 @@ menuconfig NET_DSA bool "Distributed Switch Architecture support" default n - depends on EXPERIMENTAL && NET_ETHERNET && !S390 + depends on EXPERIMENTAL && !S390 select PHYLIB ---help--- This allows you to use hardware switch chips that use diff --git a/trunk/net/ipv4/ipmr.c b/trunk/net/ipv4/ipmr.c index 7f6273506eea..757f25eb9b4b 100644 --- a/trunk/net/ipv4/ipmr.c +++ b/trunk/net/ipv4/ipmr.c @@ -442,10 +442,8 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev) int err; err = ipmr_fib_lookup(net, &fl, &mrt); - if (err < 0) { - kfree_skb(skb); + if (err < 0) return err; - } read_lock(&mrt_lock); dev->stats.tx_bytes += skb->len; @@ -1730,10 +1728,8 @@ int ip_mr_input(struct sk_buff *skb) goto dont_forward; err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt); - if (err < 0) { - kfree_skb(skb); + if (err < 0) return err; - } if (!local) { if (IPCB(skb)->opt.router_alert) { diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 65afeaec15b7..6596b4feeddc 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -608,7 +608,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, ssize_t spliced; int ret; - sock_rps_record_flow(sk); /* * We can't seek on a socket input */ diff --git a/trunk/net/ipv4/tcp_output.c b/trunk/net/ipv4/tcp_output.c index 7ed9dc1042d1..b4ed957f201a 100644 --- a/trunk/net/ipv4/tcp_output.c +++ b/trunk/net/ipv4/tcp_output.c @@ -2208,9 +2208,6 @@ void tcp_xmit_retransmit_queue(struct sock *sk) int mib_idx; int fwd_rexmitting = 0; - if (!tp->packets_out) - return; - if (!tp->lost_out) tp->retransmit_high = tp->snd_una; diff --git a/trunk/net/ipv6/mip6.c b/trunk/net/ipv6/mip6.c index d6e9599d0705..2794b6002836 100644 --- a/trunk/net/ipv6/mip6.c +++ b/trunk/net/ipv6/mip6.c @@ -347,12 +347,11 @@ static const struct xfrm_type mip6_destopt_type = static int mip6_rthdr_input(struct xfrm_state *x, struct sk_buff *skb) { - struct ipv6hdr *iph = ipv6_hdr(skb); struct rt2_hdr *rt2 = (struct rt2_hdr *)skb->data; int err = rt2->rt_hdr.nexthdr; spin_lock(&x->lock); - if (!ipv6_addr_equal(&iph->daddr, (struct in6_addr *)x->coaddr) && + if (!ipv6_addr_equal(&rt2->addr, (struct in6_addr *)x->coaddr) && !ipv6_addr_any((struct in6_addr *)x->coaddr)) err = -ENOENT; spin_unlock(&x->lock); diff --git a/trunk/net/phonet/pep.c b/trunk/net/phonet/pep.c index b2a3ae6cad78..94d72e85a475 100644 --- a/trunk/net/phonet/pep.c +++ b/trunk/net/phonet/pep.c @@ -698,7 +698,6 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp) newsk = NULL; goto out; } - kfree_skb(oskb); sock_hold(sk); pep_sk(newsk)->listener = sk; diff --git a/trunk/net/sched/act_nat.c b/trunk/net/sched/act_nat.c index 724553e8ed7b..570949417f38 100644 --- a/trunk/net/sched/act_nat.c +++ b/trunk/net/sched/act_nat.c @@ -205,7 +205,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, { struct icmphdr *icmph; - if (!pskb_may_pull(skb, ihl + sizeof(*icmph))) + if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) goto drop; icmph = (void *)(skb_network_header(skb) + ihl); @@ -215,9 +215,6 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, (icmph->type != ICMP_PARAMETERPROB)) break; - if (!pskb_may_pull(skb, ihl + sizeof(*icmph) + sizeof(*iph))) - goto drop; - iph = (void *)(icmph + 1); if (egress) addr = iph->daddr; diff --git a/trunk/net/sunrpc/auth.c b/trunk/net/sunrpc/auth.c index 8dc47f1d0001..73affb8624fa 100644 --- a/trunk/net/sunrpc/auth.c +++ b/trunk/net/sunrpc/auth.c @@ -267,7 +267,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan) * Run memory cache shrinker. */ static int -rpcauth_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) +rpcauth_cache_shrinker(int nr_to_scan, gfp_t gfp_mask) { LIST_HEAD(free); int res; diff --git a/trunk/net/xfrm/xfrm_policy.c b/trunk/net/xfrm/xfrm_policy.c index a7ec5a8a2380..af1c173be4ad 100644 --- a/trunk/net/xfrm/xfrm_policy.c +++ b/trunk/net/xfrm/xfrm_policy.c @@ -1594,8 +1594,8 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, /* Try to instantiate a bundle */ err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); - if (err <= 0) { - if (err != 0 && err != -EAGAIN) + if (err < 0) { + if (err != -EAGAIN) XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR); return ERR_PTR(err); } @@ -1678,13 +1678,6 @@ xfrm_bundle_lookup(struct net *net, struct flowi *fl, u16 family, u8 dir, goto make_dummy_bundle; dst_hold(&xdst->u.dst); return oldflo; - } else if (new_xdst == NULL) { - num_xfrms = 0; - if (oldflo == NULL) - goto make_dummy_bundle; - xdst->num_xfrms = 0; - dst_hold(&xdst->u.dst); - return oldflo; } /* Kill the previous bundle */ @@ -1767,10 +1760,6 @@ int __xfrm_lookup(struct net *net, struct dst_entry **dst_p, struct flowi *fl, xfrm_pols_put(pols, num_pols); err = PTR_ERR(xdst); goto dropdst; - } else if (xdst == NULL) { - num_xfrms = 0; - drop_pols = num_pols; - goto no_transform; } spin_lock_bh(&xfrm_policy_sk_bundle_lock); diff --git a/trunk/sound/soc/codecs/Kconfig b/trunk/sound/soc/codecs/Kconfig index 5da30eb6ad00..31ac5538fe7e 100644 --- a/trunk/sound/soc/codecs/Kconfig +++ b/trunk/sound/soc/codecs/Kconfig @@ -83,8 +83,8 @@ config SND_SOC_ALL_CODECS config SND_SOC_WM_HUBS tristate - default y if SND_SOC_WM8993=y || SND_SOC_WM8994=y - default m if SND_SOC_WM8993=m || SND_SOC_WM8994=m + default y if SND_SOC_WM8993=y + default m if SND_SOC_WM8993=m config SND_SOC_AC97_CODEC tristate diff --git a/trunk/sound/soc/codecs/wm8727.c b/trunk/sound/soc/codecs/wm8727.c index 9d1df2628136..1072621e93fd 100644 --- a/trunk/sound/soc/codecs/wm8727.c +++ b/trunk/sound/soc/codecs/wm8727.c @@ -127,8 +127,6 @@ static __devinit int wm8727_platform_probe(struct platform_device *pdev) goto err_codec; } - return 0; - err_codec: snd_soc_unregister_codec(codec); err: diff --git a/trunk/sound/soc/codecs/wm8776.c b/trunk/sound/soc/codecs/wm8776.c index 4e212ed62ea6..7e4a627b4c7e 100644 --- a/trunk/sound/soc/codecs/wm8776.c +++ b/trunk/sound/soc/codecs/wm8776.c @@ -94,6 +94,7 @@ SOC_DAPM_SINGLE("Bypass Switch", WM8776_OUTMUX, 2, 1, 0), static const struct snd_soc_dapm_widget wm8776_dapm_widgets[] = { SND_SOC_DAPM_INPUT("AUX"), +SND_SOC_DAPM_INPUT("AUX"), SND_SOC_DAPM_INPUT("AIN1"), SND_SOC_DAPM_INPUT("AIN2"), diff --git a/trunk/sound/soc/codecs/wm8988.c b/trunk/sound/soc/codecs/wm8988.c index 19ad590ca0b3..0417dae32e6f 100644 --- a/trunk/sound/soc/codecs/wm8988.c +++ b/trunk/sound/soc/codecs/wm8988.c @@ -885,6 +885,7 @@ static int wm8988_register(struct wm8988_priv *wm8988, ret = snd_soc_register_dai(&wm8988_dai); if (ret != 0) { dev_err(codec->dev, "Failed to register DAI: %d\n", ret); + snd_soc_unregister_codec(codec); goto err_codec; } diff --git a/trunk/sound/soc/sh/fsi.c b/trunk/sound/soc/sh/fsi.c index ec4acac49ebd..3396a0db06ba 100644 --- a/trunk/sound/soc/sh/fsi.c +++ b/trunk/sound/soc/sh/fsi.c @@ -683,15 +683,20 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream, /* clock inversion (CKG2) */ data = 0; - if (SH_FSI_LRM_INV & flags) - data |= 1 << 12; - if (SH_FSI_BRM_INV & flags) - data |= 1 << 8; - if (SH_FSI_LRS_INV & flags) - data |= 1 << 4; - if (SH_FSI_BRS_INV & flags) - data |= 1 << 0; - + switch (SH_FSI_INVERSION_MASK & flags) { + case SH_FSI_LRM_INV: + data = 1 << 12; + break; + case SH_FSI_BRM_INV: + data = 1 << 8; + break; + case SH_FSI_LRS_INV: + data = 1 << 4; + break; + case SH_FSI_BRS_INV: + data = 1 << 0; + break; + } fsi_reg_write(fsi, CKG2, data); /* do fmt, di fmt */ @@ -721,15 +726,15 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream, break; case SH_FSI_FMT_TDM: msg = "TDM"; + data = CR_FMT(CR_TDM) | (fsi->chan - 1); fsi->chan = is_play ? SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags); - data = CR_FMT(CR_TDM) | (fsi->chan - 1); break; case SH_FSI_FMT_TDM_DELAY: msg = "TDM Delay"; + data = CR_FMT(CR_TDM_D) | (fsi->chan - 1); fsi->chan = is_play ? SH_FSI_GET_CH_O(flags) : SH_FSI_GET_CH_I(flags); - data = CR_FMT(CR_TDM_D) | (fsi->chan - 1); break; default: dev_err(dai->dev, "unknown format.\n"); diff --git a/trunk/tools/perf/arch/sparc/Makefile b/trunk/tools/perf/arch/sparc/Makefile deleted file mode 100644 index 15130b50dfe3..000000000000 --- a/trunk/tools/perf/arch/sparc/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -ifndef NO_DWARF -PERF_HAVE_DWARF_REGS := 1 -LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o -endif diff --git a/trunk/tools/perf/arch/sparc/util/dwarf-regs.c b/trunk/tools/perf/arch/sparc/util/dwarf-regs.c deleted file mode 100644 index 0ab88483720c..000000000000 --- a/trunk/tools/perf/arch/sparc/util/dwarf-regs.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Mapping of DWARF debug register numbers into register names. - * - * Copyright (C) 2010 David S. Miller - * - * 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; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include - -#define SPARC_MAX_REGS 96 - -const char *sparc_regs_table[SPARC_MAX_REGS] = { - "%g0", "%g1", "%g2", "%g3", "%g4", "%g5", "%g6", "%g7", - "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%sp", "%o7", - "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", - "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%fp", "%i7", - "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7", - "%f8", "%f9", "%f10", "%f11", "%f12", "%f13", "%f14", "%f15", - "%f16", "%f17", "%f18", "%f19", "%f20", "%f21", "%f22", "%f23", - "%f24", "%f25", "%f26", "%f27", "%f28", "%f29", "%f30", "%f31", - "%f32", "%f33", "%f34", "%f35", "%f36", "%f37", "%f38", "%f39", - "%f40", "%f41", "%f42", "%f43", "%f44", "%f45", "%f46", "%f47", - "%f48", "%f49", "%f50", "%f51", "%f52", "%f53", "%f54", "%f55", - "%f56", "%f57", "%f58", "%f59", "%f60", "%f61", "%f62", "%f63", -}; - -/** - * get_arch_regstr() - lookup register name from it's DWARF register number - * @n: the DWARF register number - * - * get_arch_regstr() returns the name of the register in struct - * regdwarfnum_table from it's DWARF register number. If the register is not - * found in the table, this returns NULL; - */ -const char *get_arch_regstr(unsigned int n) -{ - return (n <= SPARC_MAX_REGS) ? sparc_regs_table[n] : NULL; -} diff --git a/trunk/tools/perf/builtin-report.c b/trunk/tools/perf/builtin-report.c index fd7407c7205c..359205782964 100644 --- a/trunk/tools/perf/builtin-report.c +++ b/trunk/tools/perf/builtin-report.c @@ -107,7 +107,7 @@ static int perf_session__add_hist_entry(struct perf_session *self, goto out_free_syms; err = 0; if (symbol_conf.use_callchain) { - err = append_chain(he->callchain, data->callchain, syms, data->period); + err = append_chain(he->callchain, data->callchain, syms); if (err) goto out_free_syms; } diff --git a/trunk/tools/perf/util/PERF-VERSION-GEN b/trunk/tools/perf/util/PERF-VERSION-GEN index 97d76562a1a0..49ece7921914 100755 --- a/trunk/tools/perf/util/PERF-VERSION-GEN +++ b/trunk/tools/perf/util/PERF-VERSION-GEN @@ -5,13 +5,17 @@ if [ $# -eq 1 ] ; then fi GVF=${OUTPUT}PERF-VERSION-FILE +DEF_VER=v0.0.2.PERF LF=' ' -# First check if there is a .git to get the version from git describe -# otherwise try to get the version from the kernel makefile -if test -d ../../.git -o -f ../../.git && +# First see if there is a version file (included in release tarballs), +# then try git-describe, then default. +if test -f version +then + VN=$(cat version) || VN="$DEF_VER" +elif test -d .git -o -f .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && case "$VN" in *$LF*) (exit 1) ;; @@ -23,12 +27,7 @@ if test -d ../../.git -o -f ../../.git && then VN=$(echo "$VN" | sed -e 's/-/./g'); else - eval `grep '^VERSION\s*=' ../../Makefile|tr -d ' '` - eval `grep '^PATCHLEVEL\s*=' ../../Makefile|tr -d ' '` - eval `grep '^SUBLEVEL\s*=' ../../Makefile|tr -d ' '` - eval `grep '^EXTRAVERSION\s*=' ../../Makefile|tr -d ' '` - - VN="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}" + VN="$DEF_VER" fi VN=$(expr "$VN" : v*'\(.*\)') diff --git a/trunk/tools/perf/util/callchain.c b/trunk/tools/perf/util/callchain.c index 52c777e451ed..62b69ad4aa73 100644 --- a/trunk/tools/perf/util/callchain.c +++ b/trunk/tools/perf/util/callchain.c @@ -230,7 +230,7 @@ fill_node(struct callchain_node *node, struct resolved_chain *chain, int start) static void add_child(struct callchain_node *parent, struct resolved_chain *chain, - int start, u64 period) + int start) { struct callchain_node *new; @@ -238,7 +238,7 @@ add_child(struct callchain_node *parent, struct resolved_chain *chain, fill_node(new, chain, start); new->children_hit = 0; - new->hit = period; + new->hit = 1; } /* @@ -248,8 +248,7 @@ add_child(struct callchain_node *parent, struct resolved_chain *chain, */ static void split_add_child(struct callchain_node *parent, struct resolved_chain *chain, - struct callchain_list *to_split, int idx_parents, int idx_local, - u64 period) + struct callchain_list *to_split, int idx_parents, int idx_local) { struct callchain_node *new; struct list_head *old_tail; @@ -276,41 +275,41 @@ split_add_child(struct callchain_node *parent, struct resolved_chain *chain, /* create a new child for the new branch if any */ if (idx_total < chain->nr) { parent->hit = 0; - add_child(parent, chain, idx_total, period); - parent->children_hit += period; + add_child(parent, chain, idx_total); + parent->children_hit++; } else { - parent->hit = period; + parent->hit = 1; } } static int __append_chain(struct callchain_node *root, struct resolved_chain *chain, - unsigned int start, u64 period); + unsigned int start); static void __append_chain_children(struct callchain_node *root, struct resolved_chain *chain, - unsigned int start, u64 period) + unsigned int start) { struct callchain_node *rnode; /* lookup in childrens */ chain_for_each_child(rnode, root) { - unsigned int ret = __append_chain(rnode, chain, start, period); + unsigned int ret = __append_chain(rnode, chain, start); if (!ret) goto inc_children_hit; } /* nothing in children, add to the current node */ - add_child(root, chain, start, period); + add_child(root, chain, start); inc_children_hit: - root->children_hit += period; + root->children_hit++; } static int __append_chain(struct callchain_node *root, struct resolved_chain *chain, - unsigned int start, u64 period) + unsigned int start) { struct callchain_list *cnode; unsigned int i = start; @@ -346,18 +345,18 @@ __append_chain(struct callchain_node *root, struct resolved_chain *chain, /* we match only a part of the node. Split it and add the new chain */ if (i - start < root->val_nr) { - split_add_child(root, chain, cnode, start, i - start, period); + split_add_child(root, chain, cnode, start, i - start); return 0; } /* we match 100% of the path, increment the hit */ if (i - start == root->val_nr && i == chain->nr) { - root->hit += period; + root->hit++; return 0; } /* We match the node and still have a part remaining */ - __append_chain_children(root, chain, i, period); + __append_chain_children(root, chain, i); return 0; } @@ -381,7 +380,7 @@ static void filter_context(struct ip_callchain *old, struct resolved_chain *new, int append_chain(struct callchain_node *root, struct ip_callchain *chain, - struct map_symbol *syms, u64 period) + struct map_symbol *syms) { struct resolved_chain *filtered; @@ -398,7 +397,7 @@ int append_chain(struct callchain_node *root, struct ip_callchain *chain, if (!filtered->nr) goto end; - __append_chain_children(root, filtered, 0, period); + __append_chain_children(root, filtered, 0); end: free(filtered); diff --git a/trunk/tools/perf/util/callchain.h b/trunk/tools/perf/util/callchain.h index f2e9ee164bd8..1ca73e4a2723 100644 --- a/trunk/tools/perf/util/callchain.h +++ b/trunk/tools/perf/util/callchain.h @@ -49,9 +49,6 @@ static inline void callchain_init(struct callchain_node *node) INIT_LIST_HEAD(&node->brothers); INIT_LIST_HEAD(&node->children); INIT_LIST_HEAD(&node->val); - - node->parent = NULL; - node->hit = 0; } static inline u64 cumul_hits(struct callchain_node *node) @@ -61,7 +58,7 @@ static inline u64 cumul_hits(struct callchain_node *node) int register_callchain_param(struct callchain_param *param); int append_chain(struct callchain_node *root, struct ip_callchain *chain, - struct map_symbol *syms, u64 period); + struct map_symbol *syms); bool ip_callchain__valid(struct ip_callchain *chain, event_t *event); #endif /* __PERF_CALLCHAIN_H */