From 1f4a39fefedc4f0705879aa4456d82974370d27c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 30 Aug 2011 14:37:37 +0800 Subject: [PATCH] --- yaml --- r: 263668 b: refs/heads/master c: 7a703aded97e01d7f4a6b8440a431117399666ba h: refs/heads/master v: v3 --- [refs] | 2 +- .../feature-removal-schedule.txt | 8 - trunk/Documentation/hwmon/max16065 | 7 - trunk/Makefile | 2 +- trunk/arch/powerpc/boot/dts/p1023rds.dts | 2 +- .../powerpc/configs/85xx/p1023rds_defconfig | 1 - .../powerpc/configs/corenet32_smp_defconfig | 1 - .../powerpc/configs/corenet64_smp_defconfig | 5 +- trunk/arch/powerpc/configs/mpc85xx_defconfig | 1 - .../powerpc/configs/mpc85xx_smp_defconfig | 1 - trunk/arch/x86/include/asm/pvclock.h | 2 +- trunk/arch/x86/kernel/cpu/perf_event.c | 3 - trunk/arch/x86/xen/setup.c | 19 --- trunk/arch/x86/xen/smp.c | 10 -- trunk/arch/x86/xen/xen-asm_32.S | 8 +- trunk/drivers/gpu/drm/radeon/evergreen.c | 27 ---- trunk/drivers/gpu/drm/radeon/ni.c | 3 - trunk/drivers/gpu/drm/radeon/radeon_clocks.c | 3 - trunk/drivers/hwmon/max16065.c | 2 +- trunk/drivers/hwmon/pmbus/ucd9000.c | 6 +- trunk/drivers/hwmon/pmbus/ucd9200.c | 6 +- trunk/drivers/i2c/busses/i2c-pxa-pci.c | 5 +- trunk/drivers/iommu/amd_iommu.c | 18 +-- trunk/drivers/md/linear.h | 2 +- trunk/drivers/md/md.c | 16 +- trunk/drivers/md/raid5.c | 2 +- trunk/drivers/mtd/ubi/debug.h | 2 +- trunk/drivers/rtc/rtc-ep93xx.c | 16 +- trunk/drivers/rtc/rtc-lib.c | 2 - trunk/drivers/rtc/rtc-twl.c | 60 +++++--- trunk/fs/9p/v9fs_vfs.h | 6 +- trunk/fs/9p/vfs_file.c | 36 +---- trunk/fs/9p/vfs_inode.c | 139 +++++++----------- trunk/fs/9p/vfs_inode_dotl.c | 86 ++--------- trunk/fs/9p/vfs_super.c | 2 +- trunk/fs/ext4/ext4.h | 1 - trunk/fs/ext4/inode.c | 3 + trunk/fs/ext4/page-io.c | 18 +-- trunk/fs/ubifs/debug.h | 6 +- trunk/fs/xfs/xfs_iops.c | 14 +- trunk/fs/xfs/xfs_super.c | 36 +++-- trunk/include/linux/perf_event.h | 24 ++- trunk/include/linux/regulator/consumer.h | 2 +- trunk/include/net/9p/9p.h | 29 ---- trunk/include/net/cfg80211.h | 2 - trunk/kernel/events/core.c | 67 ++------- trunk/kernel/sched.c | 43 ++---- trunk/kernel/time/alarmtimer.c | 18 +-- trunk/net/9p/trans_virtio.c | 17 +-- 49 files changed, 238 insertions(+), 553 deletions(-) diff --git a/[refs] b/[refs] index 54c73260481a..58588fc74f5f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4fbcc42dc4d069aa941873ce28f3e98f51cb4fd3 +refs/heads/master: 7a703aded97e01d7f4a6b8440a431117399666ba diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 4dc465477665..c4a6e148732a 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -592,11 +592,3 @@ Why: In 3.0, we can now autodetect internal 3G device and already have interface that was used by acer-wmi driver. It will replaced by information log when acer-wmi initial. Who: Lee, Chun-Yi - ----------------------------- -What: The XFS nodelaylog mount option -When: 3.3 -Why: The delaylog mode that has been the default since 2.6.39 has proven - stable, and the old code is in the way of additional improvements in - the log code. -Who: Christoph Hellwig diff --git a/trunk/Documentation/hwmon/max16065 b/trunk/Documentation/hwmon/max16065 index c11f64a1f2ad..44b4f61e04f9 100644 --- a/trunk/Documentation/hwmon/max16065 +++ b/trunk/Documentation/hwmon/max16065 @@ -62,13 +62,6 @@ can be safely used to identify the chip. You will have to instantiate the devices explicitly. Please see Documentation/i2c/instantiating-devices for details. -WARNING: Do not access chip registers using the i2cdump command, and do not use -any of the i2ctools commands on a command register (0xa5 to 0xac). The chips -supported by this driver interpret any access to a command register (including -read commands) as request to execute the command in question. This may result in -power loss, board resets, and/or Flash corruption. Worst case, your board may -turn into a brick. - Sysfs entries ------------- diff --git a/trunk/Makefile b/trunk/Makefile index 03d97aa8c73e..c3e90c530a65 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 1 SUBLEVEL = 0 -EXTRAVERSION = -rc5 +EXTRAVERSION = -rc4 NAME = "Divemaster Edition" # *DOCUMENTATION* diff --git a/trunk/arch/powerpc/boot/dts/p1023rds.dts b/trunk/arch/powerpc/boot/dts/p1023rds.dts index d9b776740a67..bfa96aa8f2ca 100644 --- a/trunk/arch/powerpc/boot/dts/p1023rds.dts +++ b/trunk/arch/powerpc/boot/dts/p1023rds.dts @@ -387,7 +387,7 @@ #size-cells = <1>; compatible = "cfi-flash"; reg = <0x0 0x0 0x02000000>; - bank-width = <2>; + bank-width = <1>; device-width = <1>; partition@0 { label = "ramdisk"; diff --git a/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig b/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig index 3ff5a81c709f..980ff8f61fd4 100644 --- a/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig +++ b/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig @@ -171,4 +171,3 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y diff --git a/trunk/arch/powerpc/configs/corenet32_smp_defconfig b/trunk/arch/powerpc/configs/corenet32_smp_defconfig index 4311d02a3bfd..10562a5c65b9 100644 --- a/trunk/arch/powerpc/configs/corenet32_smp_defconfig +++ b/trunk/arch/powerpc/configs/corenet32_smp_defconfig @@ -185,4 +185,3 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y diff --git a/trunk/arch/powerpc/configs/corenet64_smp_defconfig b/trunk/arch/powerpc/configs/corenet64_smp_defconfig index c92c204a204b..d32283555b53 100644 --- a/trunk/arch/powerpc/configs/corenet64_smp_defconfig +++ b/trunk/arch/powerpc/configs/corenet64_smp_defconfig @@ -100,8 +100,5 @@ CONFIG_DEBUG_INFO=y CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_VIRQ_DEBUG=y CONFIG_CRYPTO_PCBC=m -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y +CONFIG_CRYPTO_DEV_TALITOS=y diff --git a/trunk/arch/powerpc/configs/mpc85xx_defconfig b/trunk/arch/powerpc/configs/mpc85xx_defconfig index a3467bfb7671..fcd85d2c72dc 100644 --- a/trunk/arch/powerpc/configs/mpc85xx_defconfig +++ b/trunk/arch/powerpc/configs/mpc85xx_defconfig @@ -139,7 +139,6 @@ CONFIG_SND=y CONFIG_SND_INTEL8X0=y # CONFIG_SND_PPC is not set # CONFIG_SND_USB is not set -CONFIG_SND_SOC=y CONFIG_HID_A4TECH=y CONFIG_HID_APPLE=y CONFIG_HID_BELKIN=y diff --git a/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig b/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig index 9693f6ed3da0..908c941fc24c 100644 --- a/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig +++ b/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig @@ -140,7 +140,6 @@ CONFIG_SND=y CONFIG_SND_INTEL8X0=y # CONFIG_SND_PPC is not set # CONFIG_SND_USB is not set -CONFIG_SND_SOC=y CONFIG_HID_A4TECH=y CONFIG_HID_APPLE=y CONFIG_HID_BELKIN=y diff --git a/trunk/arch/x86/include/asm/pvclock.h b/trunk/arch/x86/include/asm/pvclock.h index c59cc97fe6c1..a518c0a45044 100644 --- a/trunk/arch/x86/include/asm/pvclock.h +++ b/trunk/arch/x86/include/asm/pvclock.h @@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); #elif defined(__x86_64__) __asm__ ( - "mulq %[mul_frac] ; shrd $32, %[hi], %[lo]" + "mul %[mul_frac] ; shrd $32, %[hi], %[lo]" : [lo]"=a"(product), [hi]"=d"(tmp) : "0"(delta), diff --git a/trunk/arch/x86/kernel/cpu/perf_event.c b/trunk/arch/x86/kernel/cpu/perf_event.c index cfa62ec090ec..4ee3abf20ed6 100644 --- a/trunk/arch/x86/kernel/cpu/perf_event.c +++ b/trunk/arch/x86/kernel/cpu/perf_event.c @@ -1900,9 +1900,6 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) perf_callchain_store(entry, regs->ip); - if (!current->mm) - return; - if (perf_callchain_user32(regs, entry)) return; diff --git a/trunk/arch/x86/xen/setup.c b/trunk/arch/x86/xen/setup.c index c3b8d440873c..df118a825f39 100644 --- a/trunk/arch/x86/xen/setup.c +++ b/trunk/arch/x86/xen/setup.c @@ -184,19 +184,6 @@ static unsigned long __init xen_set_identity(const struct e820entry *list, PFN_UP(start_pci), PFN_DOWN(last)); return identity; } - -static unsigned long __init xen_get_max_pages(void) -{ - unsigned long max_pages = MAX_DOMAIN_PAGES; - domid_t domid = DOMID_SELF; - int ret; - - ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); - if (ret > 0) - max_pages = ret; - return min(max_pages, MAX_DOMAIN_PAGES); -} - /** * machine_specific_memory_setup - Hook for machine specific memory setup. **/ @@ -305,12 +292,6 @@ char * __init xen_memory_setup(void) sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); - extra_limit = xen_get_max_pages(); - if (extra_limit >= max_pfn) - extra_pages = extra_limit - max_pfn; - else - extra_pages = 0; - extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); /* diff --git a/trunk/arch/x86/xen/smp.c b/trunk/arch/x86/xen/smp.c index d4fc6d454f8d..e79dbb95482b 100644 --- a/trunk/arch/x86/xen/smp.c +++ b/trunk/arch/x86/xen/smp.c @@ -32,7 +32,6 @@ #include #include -#include #include "xen-ops.h" #include "mmu.h" @@ -208,15 +207,6 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) unsigned cpu; unsigned int i; - if (skip_ioapic_setup) { - char *m = (max_cpus == 0) ? - "The nosmp parameter is incompatible with Xen; " \ - "use Xen dom0_max_vcpus=1 parameter" : - "The noapic parameter is incompatible with Xen"; - - xen_raw_printk(m); - panic(m); - } xen_init_lock_cpu(0); smp_store_cpu_info(0); diff --git a/trunk/arch/x86/xen/xen-asm_32.S b/trunk/arch/x86/xen/xen-asm_32.S index b040b0e518ca..22a2093b5862 100644 --- a/trunk/arch/x86/xen/xen-asm_32.S +++ b/trunk/arch/x86/xen/xen-asm_32.S @@ -113,13 +113,11 @@ xen_iret_start_crit: /* * If there's something pending, mask events again so we can - * jump back into xen_hypervisor_callback. Otherwise do not - * touch XEN_vcpu_info_mask. + * jump back into xen_hypervisor_callback */ - jne 1f - movb $1, XEN_vcpu_info_mask(%eax) + sete XEN_vcpu_info_mask(%eax) -1: popl %eax + popl %eax /* * From this point on the registers are restored and the stack diff --git a/trunk/drivers/gpu/drm/radeon/evergreen.c b/trunk/drivers/gpu/drm/radeon/evergreen.c index dc0a5b56c81a..d8d71a399f52 100644 --- a/trunk/drivers/gpu/drm/radeon/evergreen.c +++ b/trunk/drivers/gpu/drm/radeon/evergreen.c @@ -41,31 +41,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev); void evergreen_fini(struct radeon_device *rdev); static void evergreen_pcie_gen2_enable(struct radeon_device *rdev); -void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) -{ - u16 ctl, v; - int cap, err; - - cap = pci_pcie_cap(rdev->pdev); - if (!cap) - return; - - err = pci_read_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, &ctl); - if (err) - return; - - v = (ctl & PCI_EXP_DEVCTL_READRQ) >> 12; - - /* if bios or OS sets MAX_READ_REQUEST_SIZE to an invalid value, fix it - * to avoid hangs or perfomance issues - */ - if ((v == 0) || (v == 6) || (v == 7)) { - ctl &= ~PCI_EXP_DEVCTL_READRQ; - ctl |= (2 << 12); - pci_write_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, ctl); - } -} - void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc) { /* enable the pflip int */ @@ -1888,8 +1863,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev) WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff)); - evergreen_fix_pci_max_read_req_size(rdev); - cc_gc_shader_pipe_config = RREG32(CC_GC_SHADER_PIPE_CONFIG) & ~2; cc_gc_shader_pipe_config |= diff --git a/trunk/drivers/gpu/drm/radeon/ni.c b/trunk/drivers/gpu/drm/radeon/ni.c index cbf57d75d925..a2e00fa9c618 100644 --- a/trunk/drivers/gpu/drm/radeon/ni.c +++ b/trunk/drivers/gpu/drm/radeon/ni.c @@ -39,7 +39,6 @@ extern int evergreen_mc_wait_for_idle(struct radeon_device *rdev); extern void evergreen_mc_program(struct radeon_device *rdev); extern void evergreen_irq_suspend(struct radeon_device *rdev); extern int evergreen_mc_init(struct radeon_device *rdev); -extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); #define EVERGREEN_PFP_UCODE_SIZE 1120 #define EVERGREEN_PM4_UCODE_SIZE 1376 @@ -670,8 +669,6 @@ static void cayman_gpu_init(struct radeon_device *rdev) WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff)); - evergreen_fix_pci_max_read_req_size(rdev); - mc_shared_chmap = RREG32(MC_SHARED_CHMAP); mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG); diff --git a/trunk/drivers/gpu/drm/radeon/radeon_clocks.c b/trunk/drivers/gpu/drm/radeon/radeon_clocks.c index b6e18c8db9f5..dcd0863e31ae 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_clocks.c @@ -219,9 +219,6 @@ void radeon_get_clock_info(struct drm_device *dev) } else { DRM_INFO("Using generic clock info\n"); - /* may need to be per card */ - rdev->clock.max_pixel_clock = 35000; - if (rdev->flags & RADEON_IS_IGP) { p1pll->reference_freq = 1432; p2pll->reference_freq = 1432; diff --git a/trunk/drivers/hwmon/max16065.c b/trunk/drivers/hwmon/max16065.c index dd2d7b9620c2..d94a24fdf4ba 100644 --- a/trunk/drivers/hwmon/max16065.c +++ b/trunk/drivers/hwmon/max16065.c @@ -124,7 +124,7 @@ static inline int MV_TO_LIMIT(int mv, int range) static inline int ADC_TO_CURR(int adc, int gain) { - return adc * 1400000 / (gain * 255); + return adc * 1400000 / gain * 255; } /* diff --git a/trunk/drivers/hwmon/pmbus/ucd9000.c b/trunk/drivers/hwmon/pmbus/ucd9000.c index d0ddb60155c9..ace1c7319734 100644 --- a/trunk/drivers/hwmon/pmbus/ucd9000.c +++ b/trunk/drivers/hwmon/pmbus/ucd9000.c @@ -141,11 +141,13 @@ static int ucd9000_probe(struct i2c_client *client, block_buffer[ret] = '\0'; dev_info(&client->dev, "Device ID %s\n", block_buffer); - for (mid = ucd9000_id; mid->name[0]; mid++) { + mid = NULL; + for (i = 0; i < ARRAY_SIZE(ucd9000_id); i++) { + mid = &ucd9000_id[i]; if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; } - if (!mid->name[0]) { + if (!mid || !strlen(mid->name)) { dev_err(&client->dev, "Unsupported device\n"); return -ENODEV; } diff --git a/trunk/drivers/hwmon/pmbus/ucd9200.c b/trunk/drivers/hwmon/pmbus/ucd9200.c index c65e9da707cc..ffcc1cf3609d 100644 --- a/trunk/drivers/hwmon/pmbus/ucd9200.c +++ b/trunk/drivers/hwmon/pmbus/ucd9200.c @@ -68,11 +68,13 @@ static int ucd9200_probe(struct i2c_client *client, block_buffer[ret] = '\0'; dev_info(&client->dev, "Device ID %s\n", block_buffer); - for (mid = ucd9200_id; mid->name[0]; mid++) { + mid = NULL; + for (i = 0; i < ARRAY_SIZE(ucd9200_id); i++) { + mid = &ucd9200_id[i]; if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; } - if (!mid->name[0]) { + if (!mid || !strlen(mid->name)) { dev_err(&client->dev, "Unsupported device\n"); return -ENODEV; } diff --git a/trunk/drivers/i2c/busses/i2c-pxa-pci.c b/trunk/drivers/i2c/busses/i2c-pxa-pci.c index 6659d269b841..b73da6cd6f91 100644 --- a/trunk/drivers/i2c/busses/i2c-pxa-pci.c +++ b/trunk/drivers/i2c/busses/i2c-pxa-pci.c @@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev, return -EINVAL; } sds = kzalloc(sizeof(*sds), GFP_KERNEL); - if (!sds) + if (!sds) { + ret = -ENOMEM; goto err_mem; + } for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) { sds->pdev[i] = add_i2c_device(dev, i); if (IS_ERR(sds->pdev[i])) { + ret = PTR_ERR(sds->pdev[i]); while (--i >= 0) platform_device_unregister(sds->pdev[i]); goto err_dev_add; diff --git a/trunk/drivers/iommu/amd_iommu.c b/trunk/drivers/iommu/amd_iommu.c index 0e4227f457af..a14f8dc23462 100644 --- a/trunk/drivers/iommu/amd_iommu.c +++ b/trunk/drivers/iommu/amd_iommu.c @@ -605,9 +605,7 @@ static void build_inv_all(struct iommu_cmd *cmd) * Writes the command to the IOMMUs command buffer and informs the * hardware about the new command. */ -static int iommu_queue_command_sync(struct amd_iommu *iommu, - struct iommu_cmd *cmd, - bool sync) +static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) { u32 left, tail, head, next_tail; unsigned long flags; @@ -641,18 +639,13 @@ static int iommu_queue_command_sync(struct amd_iommu *iommu, copy_cmd_to_buffer(iommu, cmd, tail); /* We need to sync now to make sure all commands are processed */ - iommu->need_sync = sync; + iommu->need_sync = true; spin_unlock_irqrestore(&iommu->lock, flags); return 0; } -static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) -{ - return iommu_queue_command_sync(iommu, cmd, true); -} - /* * This function queues a completion wait command into the command * buffer of an IOMMU @@ -668,7 +661,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu) build_completion_wait(&cmd, (u64)&sem); - ret = iommu_queue_command_sync(iommu, &cmd, false); + ret = iommu_queue_command(iommu, &cmd); if (ret) return ret; @@ -847,9 +840,14 @@ static void domain_flush_complete(struct protection_domain *domain) static void domain_flush_devices(struct protection_domain *domain) { struct iommu_dev_data *dev_data; + unsigned long flags; + + spin_lock_irqsave(&domain->lock, flags); list_for_each_entry(dev_data, &domain->dev_list, list) device_flush_dte(dev_data); + + spin_unlock_irqrestore(&domain->lock, flags); } /**************************************************************************** diff --git a/trunk/drivers/md/linear.h b/trunk/drivers/md/linear.h index 2f2da05b2ce9..0ce29b61605a 100644 --- a/trunk/drivers/md/linear.h +++ b/trunk/drivers/md/linear.h @@ -10,9 +10,9 @@ typedef struct dev_info dev_info_t; struct linear_private_data { - struct rcu_head rcu; sector_t array_sectors; dev_info_t disks[0]; + struct rcu_head rcu; }; diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index 3742ce8b0acf..8e221a20f5d9 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -848,7 +848,7 @@ void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, bio->bi_end_io = super_written; atomic_inc(&mddev->pending_writes); - submit_bio(WRITE_FLUSH_FUA, bio); + submit_bio(REQ_WRITE | REQ_SYNC | REQ_FLUSH | REQ_FUA, bio); } void md_super_wait(mddev_t *mddev) @@ -1738,11 +1738,6 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) sb->level = cpu_to_le32(mddev->level); sb->layout = cpu_to_le32(mddev->layout); - if (test_bit(WriteMostly, &rdev->flags)) - sb->devflags |= WriteMostly1; - else - sb->devflags &= ~WriteMostly1; - if (mddev->bitmap && mddev->bitmap_info.file == NULL) { sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset); sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); @@ -2566,10 +2561,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) int err = -EINVAL; if (cmd_match(buf, "faulty") && rdev->mddev->pers) { md_error(rdev->mddev, rdev); - if (test_bit(Faulty, &rdev->flags)) - err = 0; - else - err = -EBUSY; + err = 0; } else if (cmd_match(buf, "remove")) { if (rdev->raid_disk >= 0) err = -EBUSY; @@ -2592,7 +2584,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) err = 0; } else if (cmd_match(buf, "-blocked")) { if (!test_bit(Faulty, &rdev->flags) && - rdev->badblocks.unacked_exist) { + test_bit(BlockedBadBlocks, &rdev->flags)) { /* metadata handler doesn't understand badblocks, * so we need to fail the device */ @@ -5991,8 +5983,6 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev) return -ENODEV; md_error(mddev, rdev); - if (!test_bit(Faulty, &rdev->flags)) - return -EBUSY; return 0; } diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 43709fa6b6df..dbae459fb02d 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -3336,7 +3336,7 @@ static void handle_stripe(struct stripe_head *sh) finish: /* wait for this device to become unblocked */ - if (conf->mddev->external && unlikely(s.blocked_rdev)) + if (unlikely(s.blocked_rdev)) md_wait_for_blocked_rdev(s.blocked_rdev, conf->mddev); if (s.handle_bad_blocks) diff --git a/trunk/drivers/mtd/ubi/debug.h b/trunk/drivers/mtd/ubi/debug.h index 64fbb0021825..65b5b76cc379 100644 --- a/trunk/drivers/mtd/ubi/debug.h +++ b/trunk/drivers/mtd/ubi/debug.h @@ -181,7 +181,7 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi) #define ubi_dbg_msg(fmt, ...) do { \ if (0) \ - printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ + pr_debug(fmt "\n", ##__VA_ARGS__); \ } while (0) #define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) diff --git a/trunk/drivers/rtc/rtc-ep93xx.c b/trunk/drivers/rtc/rtc-ep93xx.c index 14a42a1edc66..335551d333b2 100644 --- a/trunk/drivers/rtc/rtc-ep93xx.c +++ b/trunk/drivers/rtc/rtc-ep93xx.c @@ -36,7 +36,6 @@ */ struct ep93xx_rtc { void __iomem *mmio_base; - struct rtc_device *rtc; }; static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, @@ -131,6 +130,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) { struct ep93xx_rtc *ep93xx_rtc; struct resource *res; + struct rtc_device *rtc; int err; ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL); @@ -151,12 +151,12 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) return -ENXIO; pdev->dev.platform_data = ep93xx_rtc; - platform_set_drvdata(pdev, ep93xx_rtc); + platform_set_drvdata(pdev, rtc); - ep93xx_rtc->rtc = rtc_device_register(pdev->name, + rtc = rtc_device_register(pdev->name, &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); - if (IS_ERR(ep93xx_rtc->rtc)) { - err = PTR_ERR(ep93xx_rtc->rtc); + if (IS_ERR(rtc)) { + err = PTR_ERR(rtc); goto exit; } @@ -167,7 +167,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) return 0; fail: - rtc_device_unregister(ep93xx_rtc->rtc); + rtc_device_unregister(rtc); exit: platform_set_drvdata(pdev, NULL); pdev->dev.platform_data = NULL; @@ -176,11 +176,11 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) static int __exit ep93xx_rtc_remove(struct platform_device *pdev) { - struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); + struct rtc_device *rtc = platform_get_drvdata(pdev); sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); platform_set_drvdata(pdev, NULL); - rtc_device_unregister(ep93xx_rtc->rtc); + rtc_device_unregister(rtc); pdev->dev.platform_data = NULL; return 0; diff --git a/trunk/drivers/rtc/rtc-lib.c b/trunk/drivers/rtc/rtc-lib.c index c4cf05731118..075f1708deae 100644 --- a/trunk/drivers/rtc/rtc-lib.c +++ b/trunk/drivers/rtc/rtc-lib.c @@ -85,8 +85,6 @@ void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) time -= tm->tm_hour * 3600; tm->tm_min = time / 60; tm->tm_sec = time - tm->tm_min * 60; - - tm->tm_isdst = 0; } EXPORT_SYMBOL(rtc_time_to_tm); diff --git a/trunk/drivers/rtc/rtc-twl.c b/trunk/drivers/rtc/rtc-twl.c index 20687d55e7a7..9a81f778d6b2 100644 --- a/trunk/drivers/rtc/rtc-twl.c +++ b/trunk/drivers/rtc/rtc-twl.c @@ -362,6 +362,14 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc) int res; u8 rd_reg; +#ifdef CONFIG_LOCKDEP + /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which + * we don't want and can't tolerate. Although it might be + * friendlier not to borrow this thread context... + */ + local_irq_enable(); +#endif + res = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); if (res) goto out; @@ -420,12 +428,24 @@ static struct rtc_class_ops twl_rtc_ops = { static int __devinit twl_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; - int ret = -EINVAL; + int ret = 0; int irq = platform_get_irq(pdev, 0); u8 rd_reg; if (irq <= 0) - goto out1; + return -EINVAL; + + rtc = rtc_device_register(pdev->name, + &pdev->dev, &twl_rtc_ops, THIS_MODULE); + if (IS_ERR(rtc)) { + ret = PTR_ERR(rtc); + dev_err(&pdev->dev, "can't register RTC device, err %ld\n", + PTR_ERR(rtc)); + goto out0; + + } + + platform_set_drvdata(pdev, rtc); ret = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); if (ret < 0) @@ -442,6 +462,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) if (ret < 0) goto out1; + ret = request_irq(irq, twl_rtc_interrupt, + IRQF_TRIGGER_RISING, + dev_name(&rtc->dev), rtc); + if (ret < 0) { + dev_err(&pdev->dev, "IRQ is not free.\n"); + goto out1; + } + if (twl_class_is_6030()) { twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK, REG_INT_MSK_LINE_A); @@ -452,44 +480,28 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) /* Check RTC module status, Enable if it is off */ ret = twl_rtc_read_u8(&rd_reg, REG_RTC_CTRL_REG); if (ret < 0) - goto out1; + goto out2; if (!(rd_reg & BIT_RTC_CTRL_REG_STOP_RTC_M)) { dev_info(&pdev->dev, "Enabling TWL-RTC.\n"); rd_reg = BIT_RTC_CTRL_REG_STOP_RTC_M; ret = twl_rtc_write_u8(rd_reg, REG_RTC_CTRL_REG); if (ret < 0) - goto out1; + goto out2; } /* init cached IRQ enable bits */ ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG); if (ret < 0) - goto out1; - - rtc = rtc_device_register(pdev->name, - &pdev->dev, &twl_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc)) { - ret = PTR_ERR(rtc); - dev_err(&pdev->dev, "can't register RTC device, err %ld\n", - PTR_ERR(rtc)); - goto out1; - } - - ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, - IRQF_TRIGGER_RISING, - dev_name(&rtc->dev), rtc); - if (ret < 0) { - dev_err(&pdev->dev, "IRQ is not free.\n"); goto out2; - } - platform_set_drvdata(pdev, rtc); - return 0; + return ret; out2: - rtc_device_unregister(rtc); + free_irq(irq, rtc); out1: + rtc_device_unregister(rtc); +out0: return ret; } diff --git a/trunk/fs/9p/v9fs_vfs.h b/trunk/fs/9p/v9fs_vfs.h index 410ffd6ceb5f..46ce357ca1ab 100644 --- a/trunk/fs/9p/v9fs_vfs.h +++ b/trunk/fs/9p/v9fs_vfs.h @@ -54,9 +54,9 @@ extern struct kmem_cache *v9fs_inode_cache; struct inode *v9fs_alloc_inode(struct super_block *sb); void v9fs_destroy_inode(struct inode *inode); -struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t); +struct inode *v9fs_get_inode(struct super_block *sb, int mode); int v9fs_init_inode(struct v9fs_session_info *v9ses, - struct inode *inode, int mode, dev_t); + struct inode *inode, int mode); void v9fs_evict_inode(struct inode *inode); ino_t v9fs_qid2ino(struct p9_qid *qid); void v9fs_stat2inode(struct p9_wstat *, struct inode *, struct super_block *); @@ -83,6 +83,4 @@ static inline void v9fs_invalidate_inode_attr(struct inode *inode) v9inode->cache_validity |= V9FS_INO_INVALID_ATTR; return; } - -int v9fs_open_to_dotl_flags(int flags); #endif diff --git a/trunk/fs/9p/vfs_file.c b/trunk/fs/9p/vfs_file.c index 62857a810a79..3c173fcc2c5a 100644 --- a/trunk/fs/9p/vfs_file.c +++ b/trunk/fs/9p/vfs_file.c @@ -65,7 +65,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) v9inode = V9FS_I(inode); v9ses = v9fs_inode2v9ses(inode); if (v9fs_proto_dotl(v9ses)) - omode = v9fs_open_to_dotl_flags(file->f_flags); + omode = file->f_flags; else omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses)); @@ -169,18 +169,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) /* convert posix lock to p9 tlock args */ memset(&flock, 0, sizeof(flock)); - /* map the lock type */ - switch (fl->fl_type) { - case F_RDLCK: - flock.type = P9_LOCK_TYPE_RDLCK; - break; - case F_WRLCK: - flock.type = P9_LOCK_TYPE_WRLCK; - break; - case F_UNLCK: - flock.type = P9_LOCK_TYPE_UNLCK; - break; - } + flock.type = fl->fl_type; flock.start = fl->fl_start; if (fl->fl_end == OFFSET_MAX) flock.length = 0; @@ -256,7 +245,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) /* convert posix lock to p9 tgetlock args */ memset(&glock, 0, sizeof(glock)); - glock.type = P9_LOCK_TYPE_UNLCK; + glock.type = fl->fl_type; glock.start = fl->fl_start; if (fl->fl_end == OFFSET_MAX) glock.length = 0; @@ -268,26 +257,17 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) res = p9_client_getlock_dotl(fid, &glock); if (res < 0) return res; - /* map 9p lock type to os lock type */ - switch (glock.type) { - case P9_LOCK_TYPE_RDLCK: - fl->fl_type = F_RDLCK; - break; - case P9_LOCK_TYPE_WRLCK: - fl->fl_type = F_WRLCK; - break; - case P9_LOCK_TYPE_UNLCK: - fl->fl_type = F_UNLCK; - break; - } - if (glock.type != P9_LOCK_TYPE_UNLCK) { + if (glock.type != F_UNLCK) { + fl->fl_type = glock.type; fl->fl_start = glock.start; if (glock.length == 0) fl->fl_end = OFFSET_MAX; else fl->fl_end = glock.start + glock.length - 1; fl->fl_pid = glock.proc_id; - } + } else + fl->fl_type = F_UNLCK; + return res; } diff --git a/trunk/fs/9p/vfs_inode.c b/trunk/fs/9p/vfs_inode.c index e3c03db3c788..8bb5507e822f 100644 --- a/trunk/fs/9p/vfs_inode.c +++ b/trunk/fs/9p/vfs_inode.c @@ -95,18 +95,15 @@ static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) /** * p9mode2unixmode- convert plan9 mode bits to unix mode bits * @v9ses: v9fs session information - * @stat: p9_wstat from which mode need to be derived - * @rdev: major number, minor number in case of device files. + * @mode: mode to convert * */ -static int p9mode2unixmode(struct v9fs_session_info *v9ses, - struct p9_wstat *stat, dev_t *rdev) + +static int p9mode2unixmode(struct v9fs_session_info *v9ses, int mode) { int res; - int mode = stat->mode; - res = mode & S_IALLUGO; - *rdev = 0; + res = mode & 0777; if ((mode & P9_DMDIR) == P9_DMDIR) res |= S_IFDIR; @@ -119,26 +116,9 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, && (v9ses->nodev == 0)) res |= S_IFIFO; else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses)) - && (v9ses->nodev == 0)) { - char type = 0, ext[32]; - int major = -1, minor = -1; - - strncpy(ext, stat->extension, sizeof(ext)); - sscanf(ext, "%c %u %u", &type, &major, &minor); - switch (type) { - case 'c': - res |= S_IFCHR; - break; - case 'b': - res |= S_IFBLK; - break; - default: - P9_DPRINTK(P9_DEBUG_ERROR, - "Unknown special type %c %s\n", type, - stat->extension); - }; - *rdev = MKDEV(major, minor); - } else + && (v9ses->nodev == 0)) + res |= S_IFBLK; + else res |= S_IFREG; if (v9fs_proto_dotu(v9ses)) { @@ -151,6 +131,7 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, if ((mode & P9_DMSETVTX) == P9_DMSETVTX) res |= S_ISVTX; } + return res; } @@ -261,13 +242,13 @@ void v9fs_destroy_inode(struct inode *inode) } int v9fs_init_inode(struct v9fs_session_info *v9ses, - struct inode *inode, int mode, dev_t rdev) + struct inode *inode, int mode) { int err = 0; inode_init_owner(inode, NULL, mode); inode->i_blocks = 0; - inode->i_rdev = rdev; + inode->i_rdev = 0; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_mapping->a_ops = &v9fs_addr_operations; @@ -354,7 +335,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, * */ -struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev) +struct inode *v9fs_get_inode(struct super_block *sb, int mode) { int err; struct inode *inode; @@ -367,7 +348,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev) P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return ERR_PTR(-ENOMEM); } - err = v9fs_init_inode(v9ses, inode, mode, rdev); + err = v9fs_init_inode(v9ses, inode, mode); if (err) { iput(inode); return ERR_PTR(err); @@ -454,12 +435,11 @@ void v9fs_evict_inode(struct inode *inode) static int v9fs_test_inode(struct inode *inode, void *data) { int umode; - dev_t rdev; struct v9fs_inode *v9inode = V9FS_I(inode); struct p9_wstat *st = (struct p9_wstat *)data; struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); - umode = p9mode2unixmode(v9ses, st, &rdev); + umode = p9mode2unixmode(v9ses, st->mode); /* don't match inode of different type */ if ((inode->i_mode & S_IFMT) != (umode & S_IFMT)) return 0; @@ -493,7 +473,6 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, struct p9_wstat *st, int new) { - dev_t rdev; int retval, umode; unsigned long i_ino; struct inode *inode; @@ -517,8 +496,8 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, * later. */ inode->i_ino = i_ino; - umode = p9mode2unixmode(v9ses, st, &rdev); - retval = v9fs_init_inode(v9ses, inode, umode, rdev); + umode = p9mode2unixmode(v9ses, st->mode); + retval = v9fs_init_inode(v9ses, inode, umode); if (retval) goto error; @@ -552,19 +531,6 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid, return inode; } -/** - * v9fs_at_to_dotl_flags- convert Linux specific AT flags to - * plan 9 AT flag. - * @flags: flags to convert - */ -static int v9fs_at_to_dotl_flags(int flags) -{ - int rflags = 0; - if (flags & AT_REMOVEDIR) - rflags |= P9_DOTL_AT_REMOVEDIR; - return rflags; -} - /** * v9fs_remove - helper function to remove files and directories * @dir: directory inode that is being deleted @@ -592,8 +558,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags) return retval; } if (v9fs_proto_dotl(v9ses)) - retval = p9_client_unlinkat(dfid, dentry->d_name.name, - v9fs_at_to_dotl_flags(flags)); + retval = p9_client_unlinkat(dfid, dentry->d_name.name, flags); if (retval == -EOPNOTSUPP) { /* Try the one based on path */ v9fid = v9fs_fid_clone(dentry); @@ -680,11 +645,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); + return ofid; + error: if (ofid) p9_client_clunk(ofid); @@ -825,7 +792,6 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nameidata) { - struct dentry *res; struct super_block *sb; struct v9fs_session_info *v9ses; struct p9_fid *dfid, *fid; @@ -857,35 +823,22 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, return ERR_PTR(result); } - /* - * Make sure we don't use a wrong inode due to parallel - * unlink. For cached mode create calls request for new - * inode. But with cache disabled, lookup should do this. - */ - if (v9ses->cache) - inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb); - else - inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); + + inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb); if (IS_ERR(inode)) { result = PTR_ERR(inode); inode = NULL; goto error; } + result = v9fs_fid_add(dentry, fid); if (result < 0) goto error_iput; + inst_out: - /* - * If we had a rename on the server and a parallel lookup - * for the new name, then make sure we instantiate with - * the new name. ie look up for a/b, while on server somebody - * moved b under k and client parallely did a lookup for - * k/b. - */ - res = d_materialise_unique(dentry, inode); - if (!IS_ERR(res)) - return res; - result = PTR_ERR(res); + d_add(dentry, inode); + return NULL; + error_iput: iput(inode); error: @@ -1049,7 +1002,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, return PTR_ERR(st); v9fs_stat2inode(st, dentry->d_inode, dentry->d_inode->i_sb); - generic_fillattr(dentry->d_inode, stat); + generic_fillattr(dentry->d_inode, stat); p9stat_free(st); kfree(st); @@ -1133,7 +1086,6 @@ void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, struct super_block *sb) { - mode_t mode; char ext[32]; char tag_name[14]; unsigned int i_nlink; @@ -1169,9 +1121,31 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, inode->i_nlink = i_nlink; } } - mode = stat->mode & S_IALLUGO; - mode |= inode->i_mode & ~S_IALLUGO; - inode->i_mode = mode; + inode->i_mode = p9mode2unixmode(v9ses, stat->mode); + if ((S_ISBLK(inode->i_mode)) || (S_ISCHR(inode->i_mode))) { + char type = 0; + int major = -1; + int minor = -1; + + strncpy(ext, stat->extension, sizeof(ext)); + sscanf(ext, "%c %u %u", &type, &major, &minor); + switch (type) { + case 'c': + inode->i_mode &= ~S_IFBLK; + inode->i_mode |= S_IFCHR; + break; + case 'b': + break; + default: + P9_DPRINTK(P9_DEBUG_ERROR, + "Unknown special type %c %s\n", type, + stat->extension); + }; + inode->i_rdev = MKDEV(major, minor); + init_special_inode(inode, inode->i_mode, inode->i_rdev); + } else + inode->i_rdev = 0; + i_size_write(inode, stat->length); /* not real number of blocks, but 512 byte ones ... */ @@ -1437,8 +1411,6 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) { - int umode; - dev_t rdev; loff_t i_size; struct p9_wstat *st; struct v9fs_session_info *v9ses; @@ -1447,12 +1419,6 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) st = p9_client_stat(fid); if (IS_ERR(st)) return PTR_ERR(st); - /* - * Don't update inode if the file type is different - */ - umode = p9mode2unixmode(v9ses, st, &rdev); - if ((inode->i_mode & S_IFMT) != (umode & S_IFMT)) - goto out; spin_lock(&inode->i_lock); /* @@ -1464,7 +1430,6 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) if (v9ses->cache) inode->i_size = i_size; spin_unlock(&inode->i_lock); -out: p9stat_free(st); kfree(st); return 0; diff --git a/trunk/fs/9p/vfs_inode_dotl.c b/trunk/fs/9p/vfs_inode_dotl.c index aded79fcd5cf..b6c8ed205192 100644 --- a/trunk/fs/9p/vfs_inode_dotl.c +++ b/trunk/fs/9p/vfs_inode_dotl.c @@ -153,8 +153,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb, * later. */ inode->i_ino = i_ino; - retval = v9fs_init_inode(v9ses, inode, - st->st_mode, new_decode_dev(st->st_rdev)); + retval = v9fs_init_inode(v9ses, inode, st->st_mode); if (retval) goto error; @@ -191,58 +190,6 @@ v9fs_inode_from_fid_dotl(struct v9fs_session_info *v9ses, struct p9_fid *fid, return inode; } -struct dotl_openflag_map { - int open_flag; - int dotl_flag; -}; - -static int v9fs_mapped_dotl_flags(int flags) -{ - int i; - int rflags = 0; - struct dotl_openflag_map dotl_oflag_map[] = { - { O_CREAT, P9_DOTL_CREATE }, - { O_EXCL, P9_DOTL_EXCL }, - { O_NOCTTY, P9_DOTL_NOCTTY }, - { O_TRUNC, P9_DOTL_TRUNC }, - { O_APPEND, P9_DOTL_APPEND }, - { O_NONBLOCK, P9_DOTL_NONBLOCK }, - { O_DSYNC, P9_DOTL_DSYNC }, - { FASYNC, P9_DOTL_FASYNC }, - { O_DIRECT, P9_DOTL_DIRECT }, - { O_LARGEFILE, P9_DOTL_LARGEFILE }, - { O_DIRECTORY, P9_DOTL_DIRECTORY }, - { O_NOFOLLOW, P9_DOTL_NOFOLLOW }, - { O_NOATIME, P9_DOTL_NOATIME }, - { O_CLOEXEC, P9_DOTL_CLOEXEC }, - { O_SYNC, P9_DOTL_SYNC}, - }; - for (i = 0; i < ARRAY_SIZE(dotl_oflag_map); i++) { - if (flags & dotl_oflag_map[i].open_flag) - rflags |= dotl_oflag_map[i].dotl_flag; - } - return rflags; -} - -/** - * v9fs_open_to_dotl_flags- convert Linux specific open flags to - * plan 9 open flag. - * @flags: flags to convert - */ -int v9fs_open_to_dotl_flags(int flags) -{ - int rflags = 0; - - /* - * We have same bits for P9_DOTL_READONLY, P9_DOTL_WRONLY - * and P9_DOTL_NOACCESS - */ - rflags |= flags & O_ACCMODE; - rflags |= v9fs_mapped_dotl_flags(flags); - - return rflags; -} - /** * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol. * @dir: directory inode that is being created @@ -311,8 +258,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, "Failed to get acl values in creat %d\n", err); goto error; } - err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags), - mode, gid, &qid); + err = p9_client_create_dotl(ofid, name, flags, mode, gid, &qid); if (err < 0) { P9_DPRINTK(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n", @@ -335,10 +281,10 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); /* Now set the ACL based on the default value */ v9fs_set_create_acl(dentry, &dacl, &pacl); @@ -457,10 +403,10 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* @@ -468,7 +414,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, * inode with stat. We need to get an inode * so that we can set the acl with dentry */ - inode = v9fs_get_inode(dir->i_sb, mode, 0); + inode = v9fs_get_inode(dir->i_sb, mode); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -594,7 +540,6 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) void v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode) { - mode_t mode; struct v9fs_inode *v9inode = V9FS_I(inode); if ((stat->st_result_mask & P9_STATS_BASIC) == P9_STATS_BASIC) { @@ -607,10 +552,11 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode) inode->i_uid = stat->st_uid; inode->i_gid = stat->st_gid; inode->i_nlink = stat->st_nlink; + inode->i_mode = stat->st_mode; + inode->i_rdev = new_decode_dev(stat->st_rdev); - mode = stat->st_mode & S_IALLUGO; - mode |= inode->i_mode & ~S_IALLUGO; - inode->i_mode = mode; + if ((S_ISBLK(inode->i_mode)) || (S_ISCHR(inode->i_mode))) + init_special_inode(inode, inode->i_mode, inode->i_rdev); i_size_write(inode, stat->st_size); inode->i_blocks = stat->st_blocks; @@ -711,14 +657,14 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* Not in cached mode. No need to populate inode with stat */ - inode = v9fs_get_inode(dir->i_sb, S_IFLNK, 0); + inode = v9fs_get_inode(dir->i_sb, S_IFLNK); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -864,17 +810,17 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* * Not in cached mode. No need to populate inode with stat. * socket syscall returns a fd, so we need instantiate */ - inode = v9fs_get_inode(dir->i_sb, mode, rdev); + inode = v9fs_get_inode(dir->i_sb, mode); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -940,11 +886,6 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode) st = p9_client_getattr_dotl(fid, P9_STATS_ALL); if (IS_ERR(st)) return PTR_ERR(st); - /* - * Don't update inode if the file type is different - */ - if ((inode->i_mode & S_IFMT) != (st->st_mode & S_IFMT)) - goto out; spin_lock(&inode->i_lock); /* @@ -956,7 +897,6 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode) if (v9ses->cache) inode->i_size = i_size; spin_unlock(&inode->i_lock); -out: kfree(st); return 0; } diff --git a/trunk/fs/9p/vfs_super.c b/trunk/fs/9p/vfs_super.c index c70251d47ed1..feef6cdc1fd2 100644 --- a/trunk/fs/9p/vfs_super.c +++ b/trunk/fs/9p/vfs_super.c @@ -149,7 +149,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, else sb->s_d_op = &v9fs_dentry_operations; - inode = v9fs_get_inode(sb, S_IFDIR | mode, 0); + inode = v9fs_get_inode(sb, S_IFDIR | mode); if (IS_ERR(inode)) { retval = PTR_ERR(inode); goto release_sb; diff --git a/trunk/fs/ext4/ext4.h b/trunk/fs/ext4/ext4.h index b7d7bd0f066e..e717dfd2f2b4 100644 --- a/trunk/fs/ext4/ext4.h +++ b/trunk/fs/ext4/ext4.h @@ -175,7 +175,6 @@ struct mpage_da_data { */ #define EXT4_IO_END_UNWRITTEN 0x0001 #define EXT4_IO_END_ERROR 0x0002 -#define EXT4_IO_END_QUEUED 0x0004 struct ext4_io_page { struct page *p_page; diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 18d2558b7624..c4da98a959ae 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -121,6 +121,9 @@ void ext4_evict_inode(struct inode *inode) trace_ext4_evict_inode(inode); + mutex_lock(&inode->i_mutex); + ext4_flush_completed_IO(inode); + mutex_unlock(&inode->i_mutex); ext4_ioend_wait(inode); if (inode->i_nlink) { diff --git a/trunk/fs/ext4/page-io.c b/trunk/fs/ext4/page-io.c index 92f38ee13f8a..78839af7ce29 100644 --- a/trunk/fs/ext4/page-io.c +++ b/trunk/fs/ext4/page-io.c @@ -142,23 +142,7 @@ static void ext4_end_io_work(struct work_struct *work) unsigned long flags; int ret; - if (!mutex_trylock(&inode->i_mutex)) { - /* - * Requeue the work instead of waiting so that the work - * items queued after this can be processed. - */ - queue_work(EXT4_SB(inode->i_sb)->dio_unwritten_wq, &io->work); - /* - * To prevent the ext4-dio-unwritten thread from keeping - * requeueing end_io requests and occupying cpu for too long, - * yield the cpu if it sees an end_io request that has already - * been requeued. - */ - if (io->flag & EXT4_IO_END_QUEUED) - yield(); - io->flag |= EXT4_IO_END_QUEUED; - return; - } + mutex_lock(&inode->i_mutex); ret = ext4_end_io_nolock(io); if (ret < 0) { mutex_unlock(&inode->i_mutex); diff --git a/trunk/fs/ubifs/debug.h b/trunk/fs/ubifs/debug.h index feb361e252ac..45174b534377 100644 --- a/trunk/fs/ubifs/debug.h +++ b/trunk/fs/ubifs/debug.h @@ -335,9 +335,9 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c); #define DBGKEY(key) ((char *)(key)) #define DBGKEY1(key) ((char *)(key)) -#define ubifs_dbg_msg(fmt, ...) do { \ - if (0) \ - printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ +#define ubifs_dbg_msg(fmt, ...) do { \ + if (0) \ + pr_debug(fmt "\n", ##__VA_ARGS__); \ } while (0) #define dbg_dump_stack() diff --git a/trunk/fs/xfs/xfs_iops.c b/trunk/fs/xfs/xfs_iops.c index 673704fab748..b9c172b3fbbe 100644 --- a/trunk/fs/xfs/xfs_iops.c +++ b/trunk/fs/xfs/xfs_iops.c @@ -70,8 +70,9 @@ xfs_synchronize_times( } /* - * If the linux inode is valid, mark it dirty, else mark the dirty state - * in the XFS inode to make sure we pick it up when reclaiming the inode. + * If the linux inode is valid, mark it dirty. + * Used when committing a dirty inode into a transaction so that + * the inode will get written back by the linux code */ void xfs_mark_inode_dirty_sync( @@ -81,10 +82,6 @@ xfs_mark_inode_dirty_sync( if (!(inode->i_state & (I_WILL_FREE|I_FREEING))) mark_inode_dirty_sync(inode); - else { - barrier(); - ip->i_update_core = 1; - } } void @@ -95,11 +92,6 @@ xfs_mark_inode_dirty( if (!(inode->i_state & (I_WILL_FREE|I_FREEING))) mark_inode_dirty(inode); - else { - barrier(); - ip->i_update_core = 1; - } - } /* diff --git a/trunk/fs/xfs/xfs_super.c b/trunk/fs/xfs/xfs_super.c index 2366c54cc4fa..9a72dda58bd0 100644 --- a/trunk/fs/xfs/xfs_super.c +++ b/trunk/fs/xfs/xfs_super.c @@ -356,8 +356,6 @@ xfs_parseargs( mp->m_flags |= XFS_MOUNT_DELAYLOG; } else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) { mp->m_flags &= ~XFS_MOUNT_DELAYLOG; - xfs_warn(mp, - "nodelaylog is deprecated and will be removed in Linux 3.3"); } else if (!strcmp(this_char, MNTOPT_DISCARD)) { mp->m_flags |= XFS_MOUNT_DISCARD; } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { @@ -879,17 +877,33 @@ xfs_log_inode( struct xfs_trans *tp; int error; + xfs_iunlock(ip, XFS_ILOCK_SHARED); tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0); + if (error) { xfs_trans_cancel(tp, 0); + /* we need to return with the lock hold shared */ + xfs_ilock(ip, XFS_ILOCK_SHARED); return error; } xfs_ilock(ip, XFS_ILOCK_EXCL); - xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); + + /* + * Note - it's possible that we might have pushed ourselves out of the + * way during trans_reserve which would flush the inode. But there's + * no guarantee that the inode buffer has actually gone out yet (it's + * delwri). Plus the buffer could be pinned anyway if it's part of + * an inode in another recent transaction. So we play it safe and + * fire off the transaction anyway. + */ + xfs_trans_ijoin(tp, ip); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - return xfs_trans_commit(tp, 0); + error = xfs_trans_commit(tp, 0); + xfs_ilock_demote(ip, XFS_ILOCK_EXCL); + + return error; } STATIC int @@ -904,9 +918,7 @@ xfs_fs_write_inode( trace_xfs_write_inode(ip); if (XFS_FORCED_SHUTDOWN(mp)) - return -XFS_ERROR(EIO); - if (!ip->i_update_core) - return 0; + return XFS_ERROR(EIO); if (wbc->sync_mode == WB_SYNC_ALL) { /* @@ -917,10 +929,12 @@ xfs_fs_write_inode( * of synchronous log foces dramatically. */ xfs_ioend_wait(ip); - error = xfs_log_inode(ip); - if (error) - goto out; - return 0; + xfs_ilock(ip, XFS_ILOCK_SHARED); + if (ip->i_update_core) { + error = xfs_log_inode(ip); + if (error) + goto out_unlock; + } } else { /* * We make this non-blocking if the inode is contended, return diff --git a/trunk/include/linux/perf_event.h b/trunk/include/linux/perf_event.h index c816075c01ce..245bafdafd5e 100644 --- a/trunk/include/linux/perf_event.h +++ b/trunk/include/linux/perf_event.h @@ -944,10 +944,8 @@ extern void perf_pmu_unregister(struct pmu *pmu); extern int perf_num_counters(void); extern const char *perf_pmu_name(void); -extern void __perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task); -extern void __perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next); +extern void __perf_event_task_sched_in(struct task_struct *task); +extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); extern int perf_event_init_task(struct task_struct *child); extern void perf_event_exit_task(struct task_struct *child); extern void perf_event_free_task(struct task_struct *task); @@ -1061,20 +1059,17 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) extern struct jump_label_key perf_sched_events; -static inline void perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_event_task_sched_in(struct task_struct *task) { if (static_branch(&perf_sched_events)) - __perf_event_task_sched_in(prev, task); + __perf_event_task_sched_in(task); } -static inline void perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next) +static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) { perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); - if (static_branch(&perf_sched_events)) - __perf_event_task_sched_out(prev, next); + __perf_event_task_sched_out(task, next); } extern void perf_event_mmap(struct vm_area_struct *vma); @@ -1144,11 +1139,10 @@ extern void perf_event_disable(struct perf_event *event); extern void perf_event_task_tick(void); #else static inline void -perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) { } +perf_event_task_sched_in(struct task_struct *task) { } static inline void -perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next) { } +perf_event_task_sched_out(struct task_struct *task, + struct task_struct *next) { } static inline int perf_event_init_task(struct task_struct *child) { return 0; } static inline void perf_event_exit_task(struct task_struct *child) { } static inline void perf_event_free_task(struct task_struct *task) { } diff --git a/trunk/include/linux/regulator/consumer.h b/trunk/include/linux/regulator/consumer.h index b47771aa5718..26f6ea4444e3 100644 --- a/trunk/include/linux/regulator/consumer.h +++ b/trunk/include/linux/regulator/consumer.h @@ -123,7 +123,7 @@ struct regulator_bulk_data { const char *supply; struct regulator *consumer; - /* private: Internal use */ + /* Internal use */ int ret; }; diff --git a/trunk/include/net/9p/9p.h b/trunk/include/net/9p/9p.h index a6326ef8ade6..342dcf13d039 100644 --- a/trunk/include/net/9p/9p.h +++ b/trunk/include/net/9p/9p.h @@ -288,35 +288,6 @@ enum p9_perm_t { P9_DMSETVTX = 0x00010000, }; -/* 9p2000.L open flags */ -#define P9_DOTL_RDONLY 00000000 -#define P9_DOTL_WRONLY 00000001 -#define P9_DOTL_RDWR 00000002 -#define P9_DOTL_NOACCESS 00000003 -#define P9_DOTL_CREATE 00000100 -#define P9_DOTL_EXCL 00000200 -#define P9_DOTL_NOCTTY 00000400 -#define P9_DOTL_TRUNC 00001000 -#define P9_DOTL_APPEND 00002000 -#define P9_DOTL_NONBLOCK 00004000 -#define P9_DOTL_DSYNC 00010000 -#define P9_DOTL_FASYNC 00020000 -#define P9_DOTL_DIRECT 00040000 -#define P9_DOTL_LARGEFILE 00100000 -#define P9_DOTL_DIRECTORY 00200000 -#define P9_DOTL_NOFOLLOW 00400000 -#define P9_DOTL_NOATIME 01000000 -#define P9_DOTL_CLOEXEC 02000000 -#define P9_DOTL_SYNC 04000000 - -/* 9p2000.L at flags */ -#define P9_DOTL_AT_REMOVEDIR 0x200 - -/* 9p2000.L lock type */ -#define P9_LOCK_TYPE_RDLCK 0 -#define P9_LOCK_TYPE_WRLCK 1 -#define P9_LOCK_TYPE_UNLCK 2 - /** * enum p9_qid_t - QID types * @P9_QTDIR: directory diff --git a/trunk/include/net/cfg80211.h b/trunk/include/net/cfg80211.h index 401d73bd151f..408ae4882d22 100644 --- a/trunk/include/net/cfg80211.h +++ b/trunk/include/net/cfg80211.h @@ -1744,8 +1744,6 @@ struct wiphy_wowlan_support { * by default for perm_addr. In this case, the mask should be set to * all-zeroes. In this case it is assumed that the device can handle * the same number of arbitrary MAC addresses. - * @registered: protects ->resume and ->suspend sysfs callbacks against - * unregister hardware * @debugfsdir: debugfs directory used for this wiphy, will be renamed * automatically on wiphy renames * @dev: (virtual) struct device for this wiphy diff --git a/trunk/kernel/events/core.c b/trunk/kernel/events/core.c index 0f857782d06f..b8785e26ee1c 100644 --- a/trunk/kernel/events/core.c +++ b/trunk/kernel/events/core.c @@ -399,54 +399,14 @@ void perf_cgroup_switch(struct task_struct *task, int mode) local_irq_restore(flags); } -static inline void perf_cgroup_sched_out(struct task_struct *task, - struct task_struct *next) +static inline void perf_cgroup_sched_out(struct task_struct *task) { - struct perf_cgroup *cgrp1; - struct perf_cgroup *cgrp2 = NULL; - - /* - * we come here when we know perf_cgroup_events > 0 - */ - cgrp1 = perf_cgroup_from_task(task); - - /* - * next is NULL when called from perf_event_enable_on_exec() - * that will systematically cause a cgroup_switch() - */ - if (next) - cgrp2 = perf_cgroup_from_task(next); - - /* - * only schedule out current cgroup events if we know - * that we are switching to a different cgroup. Otherwise, - * do no touch the cgroup events. - */ - if (cgrp1 != cgrp2) - perf_cgroup_switch(task, PERF_CGROUP_SWOUT); + perf_cgroup_switch(task, PERF_CGROUP_SWOUT); } -static inline void perf_cgroup_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_cgroup_sched_in(struct task_struct *task) { - struct perf_cgroup *cgrp1; - struct perf_cgroup *cgrp2 = NULL; - - /* - * we come here when we know perf_cgroup_events > 0 - */ - cgrp1 = perf_cgroup_from_task(task); - - /* prev can never be NULL */ - cgrp2 = perf_cgroup_from_task(prev); - - /* - * only need to schedule in cgroup events if we are changing - * cgroup during ctxsw. Cgroup events were not scheduled - * out of ctxsw out if that was not the case. - */ - if (cgrp1 != cgrp2) - perf_cgroup_switch(task, PERF_CGROUP_SWIN); + perf_cgroup_switch(task, PERF_CGROUP_SWIN); } static inline int perf_cgroup_connect(int fd, struct perf_event *event, @@ -558,13 +518,11 @@ static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx) { } -static inline void perf_cgroup_sched_out(struct task_struct *task, - struct task_struct *next) +static inline void perf_cgroup_sched_out(struct task_struct *task) { } -static inline void perf_cgroup_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_cgroup_sched_in(struct task_struct *task) { } @@ -2030,7 +1988,7 @@ void __perf_event_task_sched_out(struct task_struct *task, * cgroup event are system-wide mode only */ if (atomic_read(&__get_cpu_var(perf_cgroup_events))) - perf_cgroup_sched_out(task, next); + perf_cgroup_sched_out(task); } static void task_ctx_sched_out(struct perf_event_context *ctx) @@ -2195,8 +2153,7 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx, * accessing the event control register. If a NMI hits, then it will * keep the event running. */ -void __perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) +void __perf_event_task_sched_in(struct task_struct *task) { struct perf_event_context *ctx; int ctxn; @@ -2214,7 +2171,7 @@ void __perf_event_task_sched_in(struct task_struct *prev, * cgroup event are system-wide mode only */ if (atomic_read(&__get_cpu_var(perf_cgroup_events))) - perf_cgroup_sched_in(prev, task); + perf_cgroup_sched_in(task); } static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count) @@ -2470,7 +2427,7 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx) * ctxswin cgroup events which are already scheduled * in. */ - perf_cgroup_sched_out(current, NULL); + perf_cgroup_sched_out(current); raw_spin_lock(&ctx->lock); task_ctx_sched_out(ctx); @@ -3396,8 +3353,8 @@ static int perf_event_index(struct perf_event *event) } static void calc_timer_values(struct perf_event *event, - u64 *enabled, - u64 *running) + u64 *running, + u64 *enabled) { u64 now, ctx_time; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index ec5f472bc5b9..ccacdbdecf45 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -3065,7 +3065,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev) #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW local_irq_disable(); #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */ - perf_event_task_sched_in(prev, current); + perf_event_task_sched_in(current); #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW local_irq_enable(); #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */ @@ -4279,9 +4279,9 @@ pick_next_task(struct rq *rq) } /* - * __schedule() is the main scheduler function. + * schedule() is the main scheduler function. */ -static void __sched __schedule(void) +asmlinkage void __sched schedule(void) { struct task_struct *prev, *next; unsigned long *switch_count; @@ -4322,6 +4322,16 @@ static void __sched __schedule(void) if (to_wakeup) try_to_wake_up_local(to_wakeup); } + + /* + * If we are going to sleep and we have plugged IO + * queued, make sure to submit it to avoid deadlocks. + */ + if (blk_needs_flush_plug(prev)) { + raw_spin_unlock(&rq->lock); + blk_schedule_flush_plug(prev); + raw_spin_lock(&rq->lock); + } } switch_count = &prev->nvcsw; } @@ -4359,26 +4369,6 @@ static void __sched __schedule(void) if (need_resched()) goto need_resched; } - -static inline void sched_submit_work(struct task_struct *tsk) -{ - if (!tsk->state) - return; - /* - * If we are going to sleep and we have plugged IO queued, - * make sure to submit it to avoid deadlocks. - */ - if (blk_needs_flush_plug(tsk)) - blk_schedule_flush_plug(tsk); -} - -asmlinkage void schedule(void) -{ - struct task_struct *tsk = current; - - sched_submit_work(tsk); - __schedule(); -} EXPORT_SYMBOL(schedule); #ifdef CONFIG_MUTEX_SPIN_ON_OWNER @@ -4445,7 +4435,7 @@ asmlinkage void __sched notrace preempt_schedule(void) do { add_preempt_count_notrace(PREEMPT_ACTIVE); - __schedule(); + schedule(); sub_preempt_count_notrace(PREEMPT_ACTIVE); /* @@ -4473,7 +4463,7 @@ asmlinkage void __sched preempt_schedule_irq(void) do { add_preempt_count(PREEMPT_ACTIVE); local_irq_enable(); - __schedule(); + schedule(); local_irq_disable(); sub_preempt_count(PREEMPT_ACTIVE); @@ -5598,7 +5588,7 @@ static inline int should_resched(void) static void __cond_resched(void) { add_preempt_count(PREEMPT_ACTIVE); - __schedule(); + schedule(); sub_preempt_count(PREEMPT_ACTIVE); } @@ -7453,7 +7443,6 @@ static void __sdt_free(const struct cpumask *cpu_map) struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); if (sd && (sd->flags & SD_OVERLAP)) free_sched_groups(sd->groups, 0); - kfree(*per_cpu_ptr(sdd->sd, j)); kfree(*per_cpu_ptr(sdd->sg, j)); kfree(*per_cpu_ptr(sdd->sgp, j)); } diff --git a/trunk/kernel/time/alarmtimer.c b/trunk/kernel/time/alarmtimer.c index ea5e1a928d5b..59f369f98a04 100644 --- a/trunk/kernel/time/alarmtimer.c +++ b/trunk/kernel/time/alarmtimer.c @@ -441,8 +441,6 @@ static int alarm_timer_create(struct k_itimer *new_timer) static void alarm_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) { - memset(cur_setting, 0, sizeof(struct itimerspec)); - cur_setting->it_interval = ktime_to_timespec(timr->it.alarmtimer.period); cur_setting->it_value = @@ -481,17 +479,11 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, if (!rtcdev) return -ENOTSUPP; - /* - * XXX HACK! Currently we can DOS a system if the interval - * period on alarmtimers is too small. Cap the interval here - * to 100us and solve this properly in a future patch! -jstultz - */ - if ((new_setting->it_interval.tv_sec == 0) && - (new_setting->it_interval.tv_nsec < 100000)) - new_setting->it_interval.tv_nsec = 100000; - - if (old_setting) - alarm_timer_get(timr, old_setting); + /* Save old values */ + old_setting->it_interval = + ktime_to_timespec(timr->it.alarmtimer.period); + old_setting->it_value = + ktime_to_timespec(timr->it.alarmtimer.node.expires); /* If the timer was already set, cancel it */ alarm_cancel(&timr->it.alarmtimer); diff --git a/trunk/net/9p/trans_virtio.c b/trunk/net/9p/trans_virtio.c index e317583fcc73..175b5135bdcf 100644 --- a/trunk/net/9p/trans_virtio.c +++ b/trunk/net/9p/trans_virtio.c @@ -263,6 +263,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) { int in, out, inp, outp; struct virtio_chan *chan = client->trans; + char *rdata = (char *)req->rc+sizeof(struct p9_fcall); unsigned long flags; size_t pdata_off = 0; struct trans_rpage_info *rpinfo = NULL; @@ -345,8 +346,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) * Arrange in such a way that server places header in the * alloced memory and payload onto the user buffer. */ - inp = pack_sg_list(chan->sg, out, - VIRTQUEUE_NUM, req->rc->sdata, 11); + inp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, 11); /* * Running executables in the filesystem may result in * a read request with kernel buffer as opposed to user buffer. @@ -366,8 +366,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) } in += inp; } else { - in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, - req->rc->sdata, req->rc->capacity); + in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, + req->rc->capacity); } err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc); @@ -592,14 +592,7 @@ static struct p9_trans_module p9_virtio_trans = { .close = p9_virtio_close, .request = p9_virtio_request, .cancel = p9_virtio_cancel, - - /* - * We leave one entry for input and one entry for response - * headers. We also skip one more entry to accomodate, address - * that are not at page boundary, that can result in an extra - * page in zero copy. - */ - .maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3), + .maxsize = PAGE_SIZE*VIRTQUEUE_NUM, .pref = P9_TRANS_PREF_PAYLOAD_SEP, .def = 0, .owner = THIS_MODULE,