aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-11-06cpuidle: Move dev->last_residency update to driver enter routine; remove ↵Deepthi Dharwar12-99/+164
dev->last_state Cpuidle governor only suggests the state to enter using the governor->select() interface, but allows the low level driver to override the recommended state. The actual entered state may be different because of software or hardware demotion. Software demotion is done by the back-end cpuidle driver and can be accounted correctly. Current cpuidle code uses last_state field to capture the actual state entered and based on that updates the statistics for the state entered. Ideally the driver enter routine should update the counters, and it should return the state actually entered rather than the time spent there. The generic cpuidle code should simply handle where the counters live in the sysfs namespace, not updating the counters. Reference: https://lkml.org/lkml/2011/3/25/52 Signed-off-by: Deepthi Dharwar <[email protected]> Signed-off-by: Trinabh Gupta <[email protected]> Tested-by: Jean Pihet <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Acked-by: Kevin Hilman <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06ACPI: Fix CONFIG_ACPI_DOCK=n compiler warningBart Van Assche1-1/+1
Recently the ACPI ops structs were constified but the inline version of register_hotplug_dock_device() was overlooked (see also commit 9c8b04b, June 25 2011). Update the inline function register_hotplug_dock_device() that is enabled with CONFIG_ACPI_DOCK=n too. This patch fixes at least the following compiler warnings: drivers/ata/libata-acpi.c: In function .ata_acpi_associate.: drivers/ata/libata-acpi.c:266:11: warning: passing argument 2 of .register_hotplug_dock_device. discards qualifiers from pointer target type include/acpi/acpi_drivers.h:146:19: note: expected .struct acpi_dock_ops *. but argument is of type .const struct acpi_dock_ops *. drivers/ata/libata-acpi.c:275:11: warning: passing argument 2 of .register_hotplug_dock_device. discards qualifiers from pointer target type include/acpi/acpi_drivers.h:146:19: note: expected .struct acpi_dock_ops *. but argument is of type .const struct acpi_dock_ops *. Cc: [email protected] Signed-off-by: Len Brown <[email protected]>
2011-11-06ACPI: Export FADT pm_profile integer value to userspaceThomas Renninger2-1/+35
There are a lot userspace approaches to detect the usage of the platform (laptop, workstation, server, ...) and adjust kernel tunables accordingly (io/process scheduler, power management, ...). These approaches need constant maintaining and are ugly to implement (detect PCMCIA controller -> laptop, does not work on recent systems anymore, ...) On ACPI systems there is an easy and reliable way (if implemented in BIOS and most recent platforms have this value set). -> export it to userspace. Signed-off-by: Thomas Renninger <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06thermal: Prevent polling from happening during system suspendRafael J. Wysocki1-2/+2
The thermal driver should use a freezable workqueue to schedule polling to prevent thermal_zone_device_update() from being run during system suspend, when the devices it relies on may be inactive. Make it use the system freezable workqueue for this purpose. Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06ACPI: Drop ACPI_NO_HARDWARE_INITRafael J. Wysocki2-7/+2
ACPI_NO_HARDWARE_INIT is only used by acpi_early_init() and acpi_bus_init() when calling acpi_enable_subsystem(), but acpi_enable_subsystem() doesn't check that flag, so it can be dropped. Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast()Luck, Tony1-1/+1
Callers to __acpi_ioremap_fast() pass the bit_width that they found in the acpi_generic_address structure. Convert from bits to bytes when passing to __acpi_find_iomap() - as it wants to see bytes, not bits. cc: [email protected] Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06Merge branch 'for-linus' of ↵Linus Torvalds6-27/+113
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: ceph/super.c: quiet sparse noise ceph/mds_client.c: quiet sparse noise ceph: use new D_COMPLETE dentry flag ceph: clear parent D_COMPLETE flag when on dentry prune
2011-11-06Merge git://github.com/rustyrussell/linuxLinus Torvalds5-4/+19
* git://github.com/rustyrussell/linux: module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree module: Enable dynamic debugging regardless of taint
2011-11-06Merge branch 'rmobile-latest' of git://github.com/pmundt/linux-shLinus Torvalds15-198/+1063
* 'rmobile-latest' of git://github.com/pmundt/linux-sh: (21 commits) ARM: mach-shmobile: ag5evm needs CONFIG_I2C ARM: mach-shmobile: sh73a0 and AG5EVM PINT support ARM: mach-shmobile: Add support for PINT though INTC macros ARM: mach-shmobile: SDHI0 GPIO hotplug for AG5EVM ARM: mach-shmobile: Use common INTC IRQ code on sh73a0 ARM: mach-shmobile: Use common INTC IRQ code on sh7372 ARM: mach-shmobile: Use common INTC IRQ code on sh7377 ARM: mach-shmobile: Use common INTC IRQ code on sh7367 ARM: mach-shmobile: sh73a0 GPIO IRQ support ARM: sh7372 ap4evb NOR Flash USB boot fix ARM: mach-shmobile: sh7372 Mackerel NOR Flash USB boot fix sh: intc: Allow triggering on both edges for ARM SoCs ARM: mach-shmobile: Break out INTC IRQ code ARM: mach-shmobile: Kota2 SDHI0 and SDHI1 support ARM: mach-shmobile: Kota2 SCIFA4 and SCIFB support ARM: mach-shmobile: Kota2 MMCIF support ARM: mach-shmobile: Kota2 GPIO LEDs support ARM: mach-shmobile: Kota2 GPIO Keys support ARM: mach-shmobile: Kota2 KEYSC support ARM: mach-shmobile: Kota2 SCIFA2 and SMSC911X support ...
2011-11-06PNPACPI: Simplify disabled resource registrationWitold Szczeponik1-47/+15
The attached patch simplifies 29df8d8f8702f0f53c1375015f09f04bc8d023c1. As the "pnp_xxx" structs are not designed to cope with IORESOURCE_DISABLED, and hence no code can test for this value, setting this value is actually a "no op" and can be skipped altogether. It is sufficient to remove the checks for "empty" resources and continue processing. The patch is applied against 3.1. Signed-off-by: Witold Szczeponik <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06Merge branch 'next' of ↵Linus Torvalds189-979/+9410
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (106 commits) powerpc/p3060qds: Add support for P3060QDS board powerpc/83xx: Add shutdown request support to MCU handling on MPC8349 MITX powerpc/85xx: Make kexec to interate over online cpus powerpc/fsl_booke: Fix comment in head_fsl_booke.S powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devices powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO driver powerpc/85xx: Add 'fsl,pq3-gpio' compatiable for GPIO driver powerpc/86xx: Correct Gianfar support for GE boards powerpc/cpm: Clear muram before it is in use. drivers/virt: add ioctl for 32-bit compat on 64-bit to fsl-hv-manager powerpc/fsl_msi: add support for "msi-address-64" property powerpc/85xx: Setup secondary cores PIR with hard SMP id powerpc/fsl-booke: Fix settlbcam for 64-bit powerpc/85xx: Adding DCSR node to dtsi device trees powerpc/85xx: clean up FPGA device tree nodes for Freecsale QorIQ boards powerpc/85xx: fix PHYS_64BIT selection for P1022DS powerpc/fsl-booke: Fix setup_initial_memory_limit to not blindly map powerpc: respect mem= setting for early memory limit setup powerpc: Update corenet64_smp_defconfig powerpc: Update mpc85xx/corenet 32-bit defconfigs ... Fix up trivial conflicts in: - arch/powerpc/configs/40x/hcu4_defconfig removed stale file, edited elsewhere - arch/powerpc/include/asm/udbg.h, arch/powerpc/kernel/udbg.c: added opal and gelic drivers vs added ePAPR driver - drivers/tty/serial/8250.c moved UPIO_TSI to powerpc vs removed UPIO_DWAPB support
2011-11-06ACPI: Fix possible recursive locking in hwregs.cRakib Mullick1-5/+6
Calling pm-suspend might trigger a recursive lock in it's code path. In function acpi_hw_clear_acpi_status, acpi_os_acquire_lock holds the lock acpi_gbl_hardware_lock before calling acpi_hw_register_write(), then without releasing acpi_gbl_hardware_lock, this function calls acpi_ev_walk_gpe_list, which tries to hold acpi_gbl_gpe_lock. Both acpi_gbl_hardware_lock and acpi_gbl_gpe_lock are at same lock-class and which might cause lock recursion deadlock. Following patch fixes this scenario by just releasing acpi_gbl_hardware_lock before calling acpi_ev_walk_gpe_list. Changes since v0(https://lkml.org/lkml/2011/9/21/355): - Fix changelog, thanks to Lin Ming. Changes since v1 (https://lkml.org/lkml/2011/11/3/89): - Update changelog and rename goto label, courtesy Srivatsa S. Bhat. Signed-off-by: Rakib Mullick <[email protected]> Reviewed-by: Srivatsa S. Bhat <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06Merge branch 'fixes' of ↵Linus Torvalds7-7/+6
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm * 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: ARM: PXA: fix includes in pxa2xx_cm_x2xx PCMCIA driver ARM: PXA: fix gpio-pxa.h build errors ARM: 7142/1: davinci: mark GPIO implementation complex ARM: 7134/1: Revert "EXYNOS4: Fix routing timer interrupt to offline CPU" ARM: PXA: eseries: fix eseries_register_clks section mismatch warning ARM: PXA: fix lubbock PCMCIA driver build error
2011-11-06ACPI: use kstrdup()Thomas Meyer1-2/+1
Use kstrdup rather than duplicating its implementation The semantic patch that makes this output is available in scripts/coccinelle/api/kstrdup.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Len Brown <[email protected]>
2011-11-06Btrfs: check for a null fs root when writing to the backup root logChris Mason1-3/+10
During log replay, can commit the transaction before the fs_root pointers are setup, so we have to make sure they are not null before trying to use them. Signed-off-by: Chris Mason <[email protected]>
2011-11-06mrst pmu: update commentLen Brown1-1/+1
referenced MeeGo, in particular, but really means Linux, in general. Signed-off-by: Len Brown <[email protected]>
2011-11-07module,bug: Add TAINT_OOT_MODULE flag for modules not built in-treeBen Hutchings5-0/+17
Use of the GPL or a compatible licence doesn't necessarily make the code any good. We already consider staging modules to be suspect, and this should also be true for out-of-tree modules which may receive very little review. Signed-off-by: Ben Hutchings <[email protected]> Reviewed-by: Dave Jones <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Rusty Russell <[email protected]> (patched oops-tracing.txt)
2011-11-07module: Enable dynamic debugging regardless of taintBen Hutchings1-4/+2
Dynamic debugging is currently disabled for tainted modules, except for TAINT_CRAP. This prevents use of dynamic debugging for out-of-tree modules once the next patch is applied. This condition was apparently intended to avoid a crash if a force- loaded module has an incompatible definition of dynamic debug structures. However, a administrator that forces us to load a module is claiming that it *is* compatible even though it fails our version checks. If they are mistaken, there are any number of ways the module could crash the system. As a side-effect, proprietary and other tainted modules can now use dynamic_debug. Signed-off-by: Ben Hutchings <[email protected]> Acked-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
2011-11-06Merge branch 'next/move' of git://git.linaro.org/people/arnd/arm-socLinus Torvalds78-94/+141
* 'next/move' of git://git.linaro.org/people/arnd/arm-soc: ARM: EXYNOS: Add ARCH_EXYNOS and reorganize arch/arm/mach-exynos ARM: EXYNOS4: convert MCT to percpu interrupt API ARM: SAMSUNG: Add clk enable/disable of pwm ARM: SAMSUNG: Fix compile error due to kfree
2011-11-06Merge branch 'hwmon-for-linus' of ↵Linus Torvalds2-5/+7
git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (w83627ehf) Fix broken driver init hwmon: (coretemp) Fix for non-SMP builds
2011-11-06Merge branch 'for-linus' of ↵Linus Torvalds5-13/+36
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Revert the check of NO_PRESENCE pincfg default bit ALSA: hda - Fix a regression for DMA-position check with CA0110 ALSA: hda - Fix silent output regression with ALC861 ALSA: control: remove compilation warning on 32-bit ALSA: ua101: fix crash when unplugging
2011-11-06hwmon: (w83627ehf) Fix broken driver initGuenter Roeck1-3/+6
Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types) results in kernel panic if data->temp_label was not initialized. The problem was found with chip W83627DHG-P. Add check if data->temp->label was set before use. Based on incomplete patch by Alexander Beregalov. Reported-by: Alexander Beregalov <[email protected]> Tested-by: Alexander Beregalov <[email protected]> Cc: [email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2011-11-06hwmon: (coretemp) Fix for non-SMP buildsJean Delvare1-2/+1
The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases. Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0. Signed-off-by: Jean Delvare <[email protected]> Tested-by: Phil Sutter <[email protected]> Cc: [email protected] Acked-by: Durgadoss R <[email protected]> Acked-by: Guenter Roeck <[email protected]>
2011-11-06ALSA: hda - Revert the check of NO_PRESENCE pincfg default bitTakashi Iwai1-2/+5
The implementation on commit [08a1f5eb: ALSA: hda - Check NO_PRESENCE pincfg default bit] seems like a mis-interpretation of specification. The spec gives the reversed bit definition. But, following the spec also causes to change so many existing device configurations, thus we can't change it so easily for now. For 3.2-rc1, it's safer to revert this check (actually this patch comments out the code). We may re-introduced the fixed version once after the wider test-case coverages are done. Signed-off-by: Takashi Iwai <[email protected]>
2011-11-06ALSA: hda - Fix a regression for DMA-position check with CA0110Takashi Iwai1-2/+2
The regression-fix in 3.1 for the check of DMA-position validity caused yet another regression for CA0110. As usual, this hardware seems working only with LPIB properly. Adding the appropriate driver-caps bit to force LPIB fixes the problem. Reported-and-tested-by: Andres Freund <[email protected]> Cc: <[email protected]> [v3.1] Signed-off-by: Takashi Iwai <[email protected]>
2011-11-06ALSA: hda - Fix silent output regression with ALC861Takashi Iwai1-0/+6
The 3.1 kernel has a regression for ALC861 codec where no sound output is heard with the default setup. It's because the amps in DACs aren't properly unmuted while the output mixers are assigned only to pins. This patch fixes the missing initialization of DACs when no mixer is assigned to them. Tested-by: Andrea Iob <[email protected]> Cc: <[email protected]> [v3.1+] Signed-off-by: Takashi Iwai <[email protected]>
2011-11-06ALSA: control: remove compilation warning on 32-bitOlof Johansson1-2/+2
This was introduced by 'ALSA: control: add support for ENUMERATED user space controls' which adds a u64 variable that gets cast to a pointer: sound/core/control.c: In function 'snd_ctl_elem_init_enum_names': sound/core/control.c:1089: warning: cast to pointer from integer of different size Cast to uintptr_t before casting to pointer to avoid the warning. Signed-off-by: Olof Johansson <[email protected]> [cl: replace long with uintptr_t] Signed-off-by: Clemens Ladisch <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2011-11-06ALSA: ua101: fix crash when unpluggingClemens Ladisch1-7/+21
If the device is unplugged while running, it is possible for a PCM device to be closed after the disconnect callback has returned. This means that kill_stream_urb() and disable_iso_interface() would try to access already-invalid or freed USB data structures. The function free_usb_related_resources() was intended to prevent this, but forgot to clear the affected variables. Reported-and-tested-by: Olivier Courtay <[email protected]> Signed-off-by: Clemens Ladisch <[email protected]> Cc: 2.6.33+ <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2011-11-06Btrfs: fix race during transaction joinsChris Mason1-5/+8
While we're allocating ram for a new transaction, we drop our spinlock. When we get the lock back, we do check to see if a transaction started while we slept, but we don't check to make sure it isn't blocked because a commit has already started. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: fix a potential btrfs_bio leak on scrub fixupsIlya Dryomov1-0/+1
In case we were able to map less than we wanted (length < PAGE_SIZE clause is true) btrfs_bio is still allocated and we have to free it. Signed-off-by: Ilya Dryomov <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: rename btrfs_bio multi -> bbio for consistencyIlya Dryomov1-15/+15
Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: stop leaking btrfs_bios on readaheadIlya Dryomov1-0/+2
Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: stop the readahead threads on failed mountChris Mason1-0/+1
If we don't stop them, they linger around corrupting memory by using pointers to freed things. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: fix extent_buffer leak in the metadata IO error handlingChris Mason1-0/+1
The scrub readahead branch brought in a new error handling hook, but it was leaking extent_buffer references. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: fix the new inspection ioctls for 32 bit compatChris Mason4-16/+15
The new ioctls to follow backrefs are not clean for 32/64 bit compat. This reworks them for u64s everywhere. They are brand new, so there are no problems with changing the interface now. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Merge git://git.jan-o-sch.net/btrfs-unstable into integrationChris Mason14-280/+1930
Conflicts: fs/btrfs/Makefile fs/btrfs/extent_io.c fs/btrfs/extent_io.h fs/btrfs/scrub.c Signed-off-by: Chris Mason <[email protected]>
2011-11-06Merge branch 'for-chris' of git://github.com/sensille/linux into integrationChris Mason10-70/+1130
Conflicts: fs/btrfs/ctree.h Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: fix delayed insertion reservationJosef Bacik3-8/+49
We all keep getting those stupid warnings from use_block_rsv when running stress.sh, and it's because the delayed insertion stuff is being stupid. It's not the delayed insertion stuffs fault, it's all just stupid. When marking an inode dirty for oh say updating the time on it, we just do a btrfs_join_transaction, which doesn't reserve any space. This is stupid because we're going to have to have space reserve to make this change, but we do it because it's fast because chances are we're going to call it over and over again and it doesn't matter. Well thanks to the delayed insertion stuff this is mostly the case, so we do actually need to make this reservation. So if trans->bytes_reserved is 0 then try to do a normal reservation. If not return ENOSPC which will make the btrfs_dirty_inode start a proper transaction which will let it do the whole ENOSPC dance and reserve enough space for the delayed insertion to steal the reservation from the transaction. The other stupid thing we do is not reserve space for the inode when writing to the thing. Usually this is ok since we have to update the time so we'd have already done all this work before we get to the endio stuff, so it doesn't matter. But this is stupid because we could write the data after the transaction commits where we changed the mtime of the inode so we have to cow all the way down to the inode anyway. This used to be masked by the delalloc reservation stuff, but because we delay the update it doesn't get masked in this case. So again the delayed insertion stuff bites us in the ass. So if our trans->block_rsv is delalloc, just steal the reservation from the delalloc reserve. Hopefully this won't bite us in the ass, but I've said that before. With this patch stress.sh no longer spits out those stupid warnings (famous last words). Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: ClearPageError during writepage and clean_tree_blockChris Mason2-1/+10
Failure testing was tripping up over stale PageError bits in metadata pages. If we have an io error on a block, and later on end up reusing it, nobody ever clears PageError on those pages. During commit, we'll find PageError and think we had trouble writing the block, which will lead to aborts and other problems. This changes clean_tree_block and the btrfs writepage code to clear the PageError bit. In both cases we're either completely done with the page or the page has good stuff and the error bit is no longer valid. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: be smarter about committing the transaction in reserve_metadata_bytesJosef Bacik1-19/+67
Because of the overcommit stuff I had to make it so that we committed the transaction all the time in reserve_metadata_bytes in case we had overcommitted because of delayed items. This was because previously we had no way of knowing how much space was reserved for delayed items. Now that we have the delayed_block_rsv we can check it to see if committing the transaction would get us anywhere. This patch breaks out the committing logic into a helper function that will check to see if committing the transaction would free enough space for us to get anything done. With this patch xfstests 83 goes from taking 445 seconds to taking 28 seconds on my box. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: make a delayed_block_rsv for the delayed item insertionJosef Bacik4-7/+13
I've been hitting warnings in use_block_rsv when running the delayed insertion stuff. It's because we will readjust global block rsv based on what is in use, which means we could end up discarding reservations that are for the delayed insertion stuff. So instead create a seperate block rsv for the delayed insertion stuff. This will also make it easier to debug problems with the delayed insertion reservations since we will know that only the delayed insertion code touches this block_rsv. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: add a log of past tree rootsChris Mason3-24/+369
This takes some of the free space in the btrfs super block to record information about most of the roots in the last four commits. It also adds a -o recovery to use the root history log when we're not able to read the tree of tree roots, the extent tree root, the device tree root or the csum root. Signed-off-by: Chris Mason <[email protected]>
2011-11-06btrfs: separate superblock items out of fs_infoDavid Sterba12-76/+78
fs_info has now ~9kb, more than fits into one page. This will cause mount failure when memory is too fragmented. Top space consumers are super block structures super_copy and super_for_commit, ~2.8kb each. Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64) Add a wrapper for freeing fs_info and all of it's dynamically allocated members. Signed-off-by: David Sterba <[email protected]>
2011-11-06Btrfs: use the global reserve when truncating the free space cache inodeJosef Bacik1-5/+17
We no longer use the orphan block rsv for holding the reservation for truncating the inode, so instead use the global block rsv and check to make sure it has enough space for us to truncate the space. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: release metadata from global reserve if we have to fallback for unlinkJosef Bacik1-1/+4
I fixed a problem where we weren't reserving space for an orphan item when we had to fallback to using the global reserve for an unlink, but I introduced another problem. I was migrating the bytes from the transaction reserve to the global reserve and then releasing from the global reserve in btrfs_end_transaction(). The problem with this is that a migrate will jack up the size for the destination, but leave the size alone for the source, with the idea that you can do a release normally on the source and it all washes out, and then you can do a release again on the destination and it works out right. My way was skipping the release on the trans_block_rsv which still had the jacked up size from our original reservation. So instead release manually from the global reserve if this transaction was using it, and then set the trans->block_rsv back to the trans_block_rsv so that btrfs_end_transaction cleans everything up properly. With this patch xfstest 83 doesn't emit warnings about leaking space. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: make sure to flush queued bios if write_cache_pages waitsChris Mason4-10/+22
write_cache_pages tries to build up a large bio to stuff down the pipe. But if it needs to wait for a page lock, it needs to make sure and send down any pending writes so we don't deadlock with anyone who has the page lock and is waiting for writeback of things inside the bio. Dave Sterba triggered this as a deadlock between the autodefrag code and the extent write_cache_pages Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: fix extent pinning bugs in the tree logChris Mason3-8/+59
The tree log had two important bugs that could cause corruptions after a crash. Sometimes we were allowing tree log blocks to be reused after the tree log was committed but before the transaction commit was done. This allowed a future metadata write to overwrite the tree log data. It is fixed by adding a new variant of freeing reserved extents that always pins them. Credit goes to Stefan Behrens and Arne Jansen for many many hours spent tracking this bug down. During tree log replay, we do a pass through the tree log and pin all the extents we find. This makes sure the replay code won't go in and use any of those blocks for new allocations during replay. The problem is the free space cache isn't honoring these pinned extents. So the allocator can end up handing them out, leading to all kinds of problems during replay. The fix here is to force any free space cache to load while we pin the extents, and then to make sure we remove the pinned extents from the free space rbtree. Signed-off-by: Chris Mason <[email protected]> Reported-by: Stefan Behrens <[email protected]>
2011-11-06Btrfs: make sure btrfs_remove_free_space doesn't leak EAGAINChris Mason1-1/+3
btrfs_remove_free_space needs to make sure to set ret back to a valid return value after setting it to EAGAIN, otherwise we return it to the callers. Signed-off-by: Chris Mason <[email protected]>
2011-11-06Btrfs: don't wait as long for more batches during SSD log commitChris Mason1-2/+2
When we're doing log commits, we try to wait for more writers to come in and make the commit bigger. This helps improve performance on rotating disks, but on SSDs it adds latencies. Signed-off-by: Chris Mason <[email protected]>
2011-11-06ARM: EXYNOS: Add ARCH_EXYNOS and reorganize arch/arm/mach-exynosKukjin Kim76-81/+106
The arch/arm/mach-exynos4 directory (CONFIG_ARCH_EXYNOS4) has made for plaforms based on EXYNOS4 SoCs. But since upcoming Samsung's SoCs such as EXYNOS5 (ARM Cortex A15) can reuse most codes in current mach-exynos4, one mach-exynos directory will be used for them. This patch changes to CONFIG_ARCH_EXYNOS (arch/arm/mach-exynos) but keeps original CONFIG_ARCH_EXYNOS4 in mach-exynos/Kconfig to avoid changing in driver side. Cc: Arnd Bergmann <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>