aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* xfs: convert dirnameops to unsigned char namesDave Chinner2010-01-19
| | | | | | | | To be consistent across the codebase, convert the dirnameops to pass the directory names by unsigned char strings. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* xfs: convert DM ops to use unsigned char namesDave Chinner2010-01-19
| | | | | | | | | dmops uses a signed char for it's namespace event. To be consistent with the rest of the code, convert them to unsigned char for the namespace string. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* xfs: directory names are unsignedDave Chinner2010-01-19
| | | | | | | | | Convert the struct xfs_name to use unsigned chars for the name strings to match both what is stored on disk (__uint8_t) and what the VFS expects (unsigned char). Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* xfs: move more buffer helpers into xfs_buf.cChristoph Hellwig2010-01-15
| | | | | | | | | Move xfsbdstrat and xfs_bdstrat_cb from xfs_lrw.c and xfs_bioerror and xfs_bioerror_relse from xfs_rw.c into xfs_buf.c. This also means xfs_bioerror and xfs_bioerror_relse can be marked static now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: clean up xfs_bwriteChristoph Hellwig2010-01-15
| | | | | | | | Fold XFS_bwrite into it's only caller, xfs_bwrite and move it into xfs_buf.c instead of leaving it as a fairly large inline function. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: clean up log buffer writesChristoph Hellwig2010-01-15
| | | | | | | | | Don't bother using XFS_bwrite as it doesn't provide much code for our use case. Instead opencode it and fold xlog_bdstrat_cb into the new xlog_bdstrat helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: embed the pagb_list array in the perag structureDave Chinner2010-01-15
| | | | | | | | | | | Now that the perag structure is allocated memory rather than held in an array, we don't need to have the busy extent array external to the structure. Embed it into the perag structure to avoid needing an extra allocation when setting up. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: handle ENOMEM correctly during initialisation of perag structuresDave Chinner2010-01-15
| | | | | | | | | | | Add proper error handling in case an error occurs while initializing new perag structures for a mount point. The mount structure is restored to its previous state by deleting and freeing any perag structures added during the call. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Kill filestreams cache flushDave Chinner2010-01-15
| | | | | | | | | | The filestreams cache flush is not needed in the sync code as it does not affect data writeback, and it is now not used by the growfs code, either, so kill it. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Add trace points for per-ag refcount debugging.Dave Chinner2010-01-15
| | | | | | | | | Uninline xfs_perag_{get,put} so that tracepoints can be inserted into them to speed debugging of reference count problems. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Reference count per-ag structuresDave Chinner2010-01-15
| | | | | | | | | | | | Reference count the per-ag structures to ensure that we keep get/put pairs balanced. Assert that the reference counts are zero at unmount time to catch leaks. In future, reference counts will enable us to safely remove perag structures by allowing us to detect when they are no longer in use. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Replace per-ag array with a radix treeDave Chinner2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of an array for the per-ag structures requires reallocation of the array when growing the filesystem. This requires locking access to the array to avoid use after free situations, and the locking is difficult to get right. To avoid needing to reallocate an array, change the per-ag structures to an allocated object per ag and index them using a tree structure. The AGs are always densely indexed (hence the use of an array), but the number supported is 2^32 and lookups tend to be random and hence indexing needs to scale. A simple choice is a radix tree - it works well with this sort of index. This change also removes another large contiguous allocation from the mount/growfs path in XFS. The growing process now needs to change to only initialise the new AGs required for the extra space, and as such only needs to exclusively lock the tree for inserts. The rest of the code only needs to lock the tree while doing lookups, and hence this will remove all the deadlocks that currently occur on the m_perag_lock as it is now an innermost lock. The lock is also changed to a spinlock from a read/write lock as the hold time is now extremely short. To complete the picture, the per-ag structures will need to be reference counted to ensure that we don't free/modify them while they are still in use. This will be done in subsequent patch. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: convert remaining direct references to m_peragDave Chinner2010-01-15
| | | | | | | | | | Convert the remaining direct lookups of the per ag structures to use get/put accesses. Ensure that the loops across AGs and prior users of the interface balance gets and puts correctly. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Convert filestreams code to use per-ag get/put routinesDave Chinner2010-01-15
| | | | | | | | Use xfs_perag_get() and xfs_perag_put() in the filestreams code. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Don't directly reference m_perag in allocation codeDave Chinner2010-01-15
| | | | | | | | | | | | Start abstracting the perag references so that the indexing of the structures is not directly coded into all the places that uses the perag structures. This will allow us to separate the use of the perag structure and the way it is indexed and hence avoid the known deadlocks related to growing a busy filesystem. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: rename xfs_get_peragDave Chinner2010-01-15
| | | | | | | | | | | | xfs_get_perag is really getting the perag that an inode belongs to based on it's inode number. Convert the use of this function to just get the perag from a provided ag number. Use this new function to obtain the per-ag structure when traversing the per AG inode trees for sync and reclaim. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Don't wake xfsbufd when idleDave Chinner2010-01-15
| | | | | | | | | | | | The xfsbufd wakes every xfsbufd_centisecs (once per second by default) for each filesystem even when the filesystem is idle. If the xfsbufd has nothing to do, put it into a long term sleep and only wake it up when there is work pending (i.e. dirty buffers to flush soon). This will make laptop power misers happy. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Don't wake the aild once per secondDave Chinner2010-01-15
| | | | | | | | | | | | Now that the AIL push algorithm is traversal safe, we don't need a watchdog function in the xfsaild to catch pushes that fail to make progress. Remove the watchdog timeout and make pushes purely driven by demand. This will remove the once-per-second wakeup that is seen when the filesystem is idle and make laptop power misers happy. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Use list_heads for log recovery item listsDave Chinner2010-01-15
| | | | | | | | Remove the roll-your-own linked list operations. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: make several more functions staticEric Sandeen2010-01-15
| | | | | | | | Just minor housekeeping, a lot more functions can be trivially made static; others could if we reordered things a bit... Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: clean up inconsistent variable naming in xfs_swap_extentDave Chinner2010-01-15
| | | | | | | | | | | | | | The swap extent ioctl passes in a target inode and a temporary inode which are clearly named in the ioctl structure. The code then assigns temp to target and vice versa, making it extremely difficult to work out which inode is which later in the code. Make this consistent throughout the code. Also make xfs_swap_extent static as there are no external users of the function. Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: add tracing to xfs_swap_extentsDave Chinner2010-01-15
| | | | | | | | | | To be able to diagnose whether the swap extents function is detecting compatible inode data fork configurations for swapping extents, add tracing points to the code to allow us to see the format of the inode forks before and after the swap. Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: xfs_swap_extents needs to handle dynamic fork offsetsDave Chinner2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When swapping extents, we can corrupt inodes by swapping data forks that are in incompatible formats. This is caused by the two indoes having different fork offsets due to the presence of an attribute fork on an attr2 filesystem. xfs_fsr tries to be smart about setting the fork offset, but the trick it plays only works on attr1 (old fixed format attribute fork) filesystems. Changing the way xfs_fsr sets up the attribute fork will prevent this situation from ever occurring, so in the kernel code we can get by with a preventative fix - check that the data fork in the defragmented inode is in a format valid for the inode it is being swapped into. This will lead to files that will silently and potentially repeatedly fail defragmentation, so issue a warning to the log when this particular failure occurs to let us know that xfs_fsr needs updating/fixing. To help identify how to improve xfs_fsr to avoid this issue, add trace points for the inodes being swapped so that we can determine why the swap was rejected and to confirm that the code is making the right decisions and modifications when swapping forks. A further complication is even when the swap is allowed to proceed when the fork offset is different between the two inodes then value for the maximum number of extents the data fork can hold can be wrong. Make sure these are also set correctly after the swap occurs. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: fix missing error check in xfs_rtfree_rangeDave Chinner2010-01-15
| | | | | | | | | | | | | | | | When xfs_rtfind_forw() returns an error, the block is returned uninitialised. xfs_rtfree_range() is not checking the error return, so could be using an uninitialised block number for modifying bitmap summary info. The problem was found by gcc when compiling the *userspace* libxfs code - it is an copy of the kernel code with the exact same bug. gcc gives an uninitialised variable warning on the userspace code but not on the kernel code. You gotta love the consistency (Mmmm, slightly chewy today!). Signed-off-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: fix stale inode flush avoidanceDave Chinner2010-01-15
| | | | | | | | | | | When reclaiming stale inodes, we need to guarantee that inodes are unpinned before returning with a "clean" status. If we don't we can reclaim inodes that are pinned, leading to use after free in the transaction subsystem as transactions complete. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Remove inode iolock held check during allocationDave Chinner2010-01-15
| | | | | | | | | | | | | lockdep complains about a the lock not being initialised as we do an ASSERT based check that the lock is not held before we initialise it to catch inodes freed with the lock held. lockdep does this check for us in the lock initialisation code, so remove the ASSERT to stop the lockdep warning. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: reclaim all inodes by background tree walksDave Chinner2010-01-15
| | | | | | | | | | | | | | | | | | | | | | | | We cannot do direct inode reclaim without taking the flush lock to ensure that we do not reclaim an inode under IO. We check the inode is clean before doing direct reclaim, but this is not good enough because the inode flush code marks the inode clean once it has copied the in-core dirty state to the backing buffer. It is the flush lock that determines whether the inode is still under IO, even though it is marked clean, and the inode is still required at IO completion so we can't reclaim it even though it is clean in core. Hence the requirement that we need to take the flush lock even on clean inodes because this guarantees that the inode writeback IO has completed and it is safe to reclaim the inode. With delayed write inode flushing, we coul dend up waiting a long time on the flush lock even for a clean inode. The background reclaim already handles this efficiently, so avoid all the problems by killing the direct reclaim path altogether. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: Avoid inodes in reclaim when flushing from inode cacheDave Chinner2010-01-15
| | | | | | | | | | | The reclaim code will handle flushing of dirty inodes before reclaim occurs, so avoid them when determining whether an inode is a candidate for flushing to disk when walking the radix trees. This is based on a test patch from Christoph Hellwig. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* xfs: reclaim inodes under a write lockDave Chinner2010-01-15
| | | | | | | | | | Make the inode tree reclaim walk exclusive to avoid races with concurrent sync walkers and lookups. This is a version of a patch posted by Christoph Hellwig that avoids all the code duplication. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
* Linux 2.6.33-rc4v2.6.33-rc4Linus Torvalds2010-01-13
|
* Merge git://git.infradead.org/battery-2.6Linus Torvalds2010-01-13
|\ | | | | | | | | * git://git.infradead.org/battery-2.6: pmu_battery: Fix battery full reporting
| * pmu_battery: Fix battery full reportingThomas Champagne2009-12-17
| | | | | | | | | | | | | | | | | | | | | | Prior to this patch, pmu_battery was unable to report battery full status. This patch fixes the issue by adding a proper handling code into pmu_bat_get_property(): if we're on AC and the battery isn't charging, then the battery is considered full. Signed-off-by: Thomas Champagne <lafeuil@gmail.com> Acked-By: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
* | [SCSI] megaraid_sas: remove sysfs poll_mode_io world writeable permissionsBryn M. Reeves2010-01-13
| | | | | | | | | | | | | | | | | | | | | | | | /sys/bus/pci/drivers/megaraid_sas/poll_mode_io defaults to being world-writable, which seems bad (letting any user affect kernel driver behavior). This turns off group and user write permissions, so that on typical production systems only root can write to it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linuxLinus Torvalds2010-01-13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://gitorious.org/linux-omap-dss2/linux: OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded OMAP: DSS2: Reject scaling settings when they cannot be supported OMAP: DSS2: Make check-delay-loops consistent OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem() video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c OMAP: DSS2: Fix compile warning MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry MAINTAINERS: change omapfb maintainer OMAP: OMAPFB: add dummy release function for omapdss OMAP: OMAPFB: fix clk_get for RFBI OMAP: DSS2: RFBI: convert to new kfifo API OMAP: DSS2: Fix crash when panel doesn't define enable_te() OMAP: DSS2: Collect interrupt statistics OMAP: DSS2: DSI: print debug DCS cmd in hex OMAP: DSS2: DSI: fix VC channels in send_short and send_null
| * | OMAP: DSS2: OMAPFB: fix crash when panel driver was not loadedTomi Valkeinen2010-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the panel's probe had failed, omapfb would still go on, eventually crashing. A better fix would be to handle each display properly, and leaving just the failed display out. But that is a bigger change. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: Reject scaling settings when they cannot be supportedVille Syrjälä2010-01-12
| | | | | | | | | | | | | | | | | | | | | | | | If the scaling ratio is below 0.5 video output width can't be identical to the display width. Reject such settings. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: Make check-delay-loops consistentTomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | | | | | | | Loops checking for certain condition were rather inconsistent. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>
| * | OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem()Tomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | | | | | | | Fixes bug causing VRFB memory area to be released twice. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Reported-by: Eino-Ville Talvala <talvala@stanford.edu>
| * | video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.cPeter Huewe2010-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trivial patch which adds the __init/__exit macros to the module_init/ module_exit functions of drivers/video/omap/lcd_htcherald.c Please have a look at the small patch and either pull it through your tree, or please ack' it so Jiri can pull it through the trivial tree. Patch against linux-next-tree, 22. Dez 08:38:18 CET 2009 but also present in linus tree. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Tony Lindgren <tony@atomide.com>
| * | OMAP: DSS2: Fix compile warningVaibhav Hiremath2010-01-11
| | | | | | | | | | | | | | | Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | MAINTAINERS: Combine DSS2 and OMAPFB2 into one entryTomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | | | | There isn't really any reason to divide those. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | MAINTAINERS: change omapfb maintainerTomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Acked-by: Imre Deak <imre.deak@nokia.com>
| * | OMAP: OMAPFB: add dummy release function for omapdssTomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This should fix: WARNING: at drivers/base/core.c:131 device_release+0x68/0x7c() Device 'omapdss' does not have a release() function, it is broken and must be fixed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: OMAPFB: fix clk_get for RFBITomi Valkeinen2010-01-11
| | | | | | | | | | | | | | | | | | | | | omapfb platform device was still used to get clocks inside rfbi.c Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> Tested-by: Sergey Lapin <slapin@ossfans.org>
| * | OMAP: DSS2: RFBI: convert to new kfifo APITomi Valkeinen2010-01-11
| | | | | | | | | | | | Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: Fix crash when panel doesn't define enable_te()Tomi Valkeinen2010-01-08
| | | | | | | | | | | | | | | | | | | | | DSI driver didn't check if the panel driver actually implements enable_te(). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: Collect interrupt statisticsTomi Valkeinen2010-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collect interrupt statistics, printable via debugfs: debugfs/omapdss/dispc_irq debugfs/omapdss/dsi_irq The counters are reset when printed. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: DSI: print debug DCS cmd in hexTomi Valkeinen2010-01-08
| | | | | | | | | | | | Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| * | OMAP: DSS2: DSI: fix VC channels in send_short and send_nullTomi Valkeinen2010-01-08
| | | | | | | | | | | | | | | | | | | | | - dsi_vc_send_short() needs to use dest_per for the peripheral id - dsi_vc_send_null() was always using channel id 0 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
* | | lib: Introduce generic list_sort functionDave Chinner2010-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two copies of list_sort() in the tree already, one in the DRM code, another in ubifs. Now XFS needs this as well. Create a generic list_sort() function from the ubifs version and convert existing users to it so we don't end up with yet another copy in the tree. Signed-off-by: Dave Chinner <david@fromorbit.com> Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Artem Bityutskiy <dedekind@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>