aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs
AgeCommit message (Collapse)AuthorFilesLines
2009-09-01xfs: actually enable the swapext compat handlerChristoph Hellwig1-1/+1
Fix a small typo in the compat ioctl handler that cause the swapext compat handler to never be called. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Torsten Kaiser <[email protected]> Tested-by: Torsten Kaiser <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: actually enable the swapext compat handlerChristoph Hellwig1-1/+1
Fix a small typo in the compat ioctl handler that cause the swapext compat handler to never be called. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Torsten Kaiser <[email protected]> Tested-by: Torsten Kaiser <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: simplify xfs_trans_igetChristoph Hellwig5-113/+5
xfs_trans_iget is a wrapper for xfs_iget that adds the inode to the transaction after it is read. Except when the inode already is in the inode cache, in which case it returns the existing locked inode with increment lock recursion counts. Now, no one in the tree every decrements these lock recursion counts, so any user of this gets a potential double unlock when both the original owner of the inode and the xfs_trans_iget caller unlock it. When looking back in a git bisect in the historic XFS tree there was only one place that decremented these counts, xfs_trans_iput. Introduced in commit ca25df7a840f426eb566d52667b6950b92bb84b5 by Adam Sweeney in 1993, and removed in commit 19f899a3ab155ff6a49c0c79b06f2f61059afaf3 by Steve Lord in 2003. And as long as it didn't slip through git bisects cracks never actually used in that time frame. A quick audit of the callers of xfs_trans_iget shows that no caller really relies on this behaviour fortunately - xfs_ialloc allows this inode from disk so it must not be there before, and all the RT allocator routines only every add each RT bitmap inode once. In addition to removing lots of code and reducing the size of the inode item this patch also avoids the double inode cache lookup in each create/mkdir/mknod transaction. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: merge fsync and O_SYNC handlingChristoph Hellwig10-112/+23
The guarantees for O_SYNC are exactly the same as the ones we need to make for an fsync call (and given that Linux O_SYNC is O_DSYNC the equivalent is fdadatasync, but we treat both the same in XFS), except with a range data writeout. Jan Kara has started unifying these two path for filesystems using the generic helpers, and I've started to look at XFS. The actual transaction commited by xfs_fsync and xfs_write_sync_logforce has a different transaction number, but actually is exactly the same. We'll only use the fsync transaction going forward. One major difference is that xfs_write_sync_logforce never issues a cache flush unless we commit a transaction causing that as a side-effect, which is an obvious bug in the O_SYNC handling. Second all the locking and i_update_size vs i_update_core changes from 978b7237123d007b9fa983af6e0e2fa8f97f9934 never made it to xfs_write_sync_logforce, so we add them back. To make xfs_fsync easily usable from the O_SYNC path, the filemap_fdatawait call is moved up to xfs_file_fsync, so that we don't wait on the whole file after we already waited for our portion in xfs_write. We'll also use a plain call to filemap_write_and_wait_range instead of the previous sync_page_rang which did it in two steps including an half-hearted inode write out that doesn't help us. Once we're done with this also remove the now useless i_update_size tracking. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: speed up free inode searchDave Chinner2-27/+115
Don't search too far - abort if it is outside a certain radius and simply do a linear search for the first free inode. In AGs with a million inodes this can speed up allocation speed by 3-4x. [hch: ported to the new xfs_ialloc.c world order] Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: rationalize xfs_inobt_lookup*Christoph Hellwig3-71/+32
Currenly we have a xfs_inobt_lookup* variant for each comparism direction, and all these get all three fields of the inobt records passed, while the common case is just looking for the inode number and we have only marginally more callers than xfs_inobt_lookup* variants. So opencode a direct call to xfs_btree_lookup for the single case where we need all fields, and replace xfs_inobt_lookup* with a xfs_inobt_looku that just takes the inode number and the direction for all other callers. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: untangle xfs_diallocChristoph Hellwig1-153/+138
Clarify the control flow in xfs_dialloc. Factor out a helper to go to the next node from the current one and improve the control flow by expanding composite if statements and using gotos. The xfs_ialloc_next_rec helper is borrowed from Dave Chinners dynamic allocation policy patches. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: factor out debug checks from xfs_dialloc and xfs_difreeDave Chinner1-75/+56
Factor out a common helper from repeated debug checks in xfs_dialloc and xfs_difree. [hch: split out from Dave's dynamic allocation policy patches] Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: improve xfs_inobt_update prototypeChristoph Hellwig1-12/+11
Both callers of xfs_inobt_update have the record in form of a xfs_inobt_rec_incore_t, so just pass a pointer to it instead of the individual variables. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: improve xfs_inobt_get_rec prototypeChristoph Hellwig3-92/+77
Most callers of xfs_inobt_get_rec need to fill a xfs_inobt_rec_incore_t, and those who don't yet are fine with a xfs_inobt_rec_incore_t, instead of the three individual variables, too. So just change xfs_inobt_get_rec to write the output into a xfs_inobt_rec_incore_t directly. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-09-01xfs: factor out inode initialisationDave Chinner1-80/+95
Factor out code to initialize new inode clusters into a function of it's own. This keeps xfs_ialloc_ag_alloc smaller and better structured and enables a future inode cluster initialization transaction. Also initialize the agno variable earlier in xfs_ialloc_ag_alloc to avoid repeated byte swaps. [hch: The original patch is from Dave from his unpublished inode create transaction patch series, with some modifcations by me to apply stand-alone] Signed-off-by: Dave Chinner <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-31fs/xfs: Correct redundant testJulia Lawall1-2/+2
bp was tested for NULL a few lines before, followed by a return, and there is no intervening modification of its value. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; expression E; position p1,p2; @@ if (x == NULL || ...) { ... when forall return ...; } ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) ( *x == NULL | *x != NULL ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Acked-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-31xfs: remove XFS_INO64_OFFSETEric Sandeen1-1/+0
Commit a19d9f887d81106d52cacbc9930207b487e07e0e removed the ino64 option but left the XFS_INO64_OFFSET define it used in place - just remove it. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-31un-static xfs_read_agfEric Sandeen2-1/+4
CONFIG_XFS_DEBUG builds still need xfs_read_agf to be non-static, oops. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-31xfs: add more statics & drop some unused functionsEric Sandeen23-159/+22
A lot more functions could be made static, but they need forward declarations; this does some easy ones, and also found a few unused functions in the process. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-17xfs: fix locking in xfs_iget_cache_hitChristoph Hellwig3-57/+70
The locking in xfs_iget_cache_hit currently has numerous problems: - we clear the reclaim tag without i_flags_lock which protects modifications to it - we call inode_init_always which can sleep with pag_ici_lock held (this is oss.sgi.com BZ #819) - we acquire and drop i_flags_lock a lot and thus provide no consistency between the various flags we set/clear under it This patch fixes all that with a major revamp of the locking in the function. The new version acquires i_flags_lock early and only drops it once we need to call into inode_init_always or before calling xfs_ilock. This patch fixes a bug seen in the wild where we race modifying the reclaim tag. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds10-19/+41
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: fix spin_is_locked assert on uni-processor builds xfs: check for dinode realtime flag corruption use XFS_CORRUPTION_ERROR in xfs_btree_check_sblock xfs: switch to NOFS allocation under i_lock in xfs_attr_rmtval_get xfs: switch to NOFS allocation under i_lock in xfs_readlink_bmap xfs: switch to NOFS allocation under i_lock in xfs_attr_rmtval_set xfs: switch to NOFS allocation under i_lock in xfs_buf_associate_memory xfs: switch to NOFS allocation under i_lock in xfs_dir_cilookup_result xfs: switch to NOFS allocation under i_lock in xfs_da_buf_make xfs: switch to NOFS allocation under i_lock in xfs_da_state_alloc xfs: switch to NOFS allocation under i_lock in xfs_getbmap xfs: avoid memory allocation under m_peraglock in growfs code
2009-08-12xfs: fix spin_is_locked assert on uni-processor buildsChristoph Hellwig1-1/+1
Without SMP or preemption spin_is_locked always returns false, so we can't do an assert with it. Instead use assert_spin_locked, which does the right thing on all builds. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reported-by: Johannes Engel <[email protected]> Tested-by: Johannes Engel <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: check for dinode realtime flag corruptionChristoph Hellwig1-0/+10
Ramon tested XFS with a modified version of fsfuzzer and hit a NULL pointer dereference in __xfs_get_blocks due to the RT device target pointer being NULL. To fix this reject inode with the realtime bit set on a a filesystem without an RT subvolume during inode read. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Reported-by: Ramon de Carvalho Valle <[email protected]> Tested-by: Ramon de Carvalho Valle <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12use XFS_CORRUPTION_ERROR in xfs_btree_check_sblockEric Sandeen1-2/+2
In Red Hat Bug 512552 - Can't write to XFS mount during raid5 resync a user ran into corruption while resyncing a raid, and we failed a consistency test, but didn't get much more info; it'd be nice to call XFS_CORRUPTION_ERROR here so we can see the buffer contents. Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_attr_rmtval_getChristoph Hellwig1-1/+3
xfs_attr_rmtval_get is always called with i_lock held, but i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_readlink_bmapChristoph Hellwig1-1/+3
xfs_readlink_bmap is called with i_lock held, but i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_attr_rmtval_setChristoph Hellwig1-2/+2
xfs_attr_rmtval_set is always called with i_lock held, and i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_buf_associate_memoryChristoph Hellwig1-1/+1
xfs_buf_associate_memory is used for setting up the spare buffer for the log wrap case in xlog_sync which can happen under i_lock when called from xfs_fsync. The i_lock mutex is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. There are a couple more uses of xfs_buf_associate_memory in the log recovery code that are also affected by this, but I'd rather keep the code simple than passing on a gfp_mask argument. Longer term we should just stop requiring the memoery allocation in xlog_sync by some smaller rework of the buffer layer. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_dir_cilookup_resultChristoph Hellwig1-1/+1
xfs_dir_cilookup_result is always called with i_lock held, but i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_da_buf_makeChristoph Hellwig1-2/+2
i_lock is taken in the reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_da_state_allocChristoph Hellwig1-1/+1
xfs_da_state_alloc is always called with i_lock held, but i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: switch to NOFS allocation under i_lock in xfs_getbmapChristoph Hellwig1-1/+1
xfs_getbmap allocates memory with i_lock held, but i_lock is taken in reclaim context so all allocations under it must avoid recursions into the filesystem. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-12xfs: avoid memory allocation under m_peraglock in growfs codeChristoph Hellwig1-6/+14
Allocate the memory for the larger m_perag array before taking the per-AG lock as the per-AG lock can be taken under the i_lock which can be taken from reclaim context. Reported by the new reclaim context tracing in lockdep. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-08-07xfs: fix freeing of inodes not yet added to the inode cacheChristoph Hellwig2-74/+68
When freeing an inode that lost race getting added to the inode cache we must not call into ->destroy_inode, because that would delete the inode that won the race from the inode cache radix tree. This patch uses splits a new xfs_inode_free helper out of xfs_ireclaim and uses that plus __destroy_inode to make sure we really only free the memory allocted for the inode that lost the race, and not mess with the inode cache state. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reported-by: Alex Samad <[email protected]> Reported-by: Andrew Randrianasulu <[email protected]> Reported-by: Stephane <[email protected]> Reported-by: Tommy <[email protected]> Reported-by: Miah Gregory <[email protected]> Reported-by: Gabriel Barazer <[email protected]> Reported-by: Leandro Lucarella <[email protected]> Reported-by: Daniel Burr <[email protected]> Reported-by: Nickolay <[email protected]> Reported-by: Michael Guntsche <[email protected]> Reported-by: Dan Carley <[email protected]> Reported-by: Michael Ole Olsen <[email protected]> Reported-by: Michael Weissenbacher <[email protected]> Reported-by: Martin Spott <[email protected]> Reported-by: Christian Kujau <[email protected]> Tested-by: Michael Guntsche <[email protected]> Tested-by: Dan Carley <[email protected]> Tested-by: Christian Kujau <[email protected]>
2009-08-07vfs: fix inode_init_always calling conventionChristoph Hellwig1-12/+5
Currently inode_init_always calls into ->destroy_inode if the additional initialization fails. That's not only counter-intuitive because inode_init_always did not allocate the inode structure, but in case of XFS it's actively harmful as ->destroy_inode might delete the inode from a radix-tree that has never been added. This in turn might end up deleting the inode for the same inum that has been instanciated by another process and cause lots of cause subtile problems. Also in the case of re-initializing a reclaimable inode in XFS it would free an inode we still want to keep alive. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
2009-07-31Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds2-2/+10
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: bump up nr_to_write in xfs_vm_writepage xfs: reduce bmv_count in xfs_vn_fiemap
2009-07-31xfs: bump up nr_to_write in xfs_vm_writepageEric Sandeen1-0/+8
VM calculation for nr_to_write seems off. Bump it way up, this gets simple streaming writes zippy again. To be reviewed again after Jens' writeback changes. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Eric Sandeen <[email protected]> Cc: Chris Mason <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-07-31xfs: reduce bmv_count in xfs_vn_fiemapEric Sandeen1-2/+2
commit 6321e3ed2acf3ee9643cdd403e1c88605d7944ba caused the full bmv_count's worth of getbmapx structures to get allocated; telling it to do MAXEXTNUM was a bit insane, resulting in ENOMEM every time. Chop it down to something reasonable, the number of slots in the caller's input buffer. If this is too large the caller may get ENOMEM but the reason should not be a mystery, and they can try again with something smaller. We add 1 to the value because in the normal getbmap world, bmv_count includes the header and xfs_getbmap does: nex = bmv->bmv_count - 1; if (nex <= 0) return XFS_ERROR(EINVAL); Signed-off-by: Eric Sandeen <[email protected]> Reviewed-by: Olaf Weber <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan1-1/+0
* Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-07-10Fix congestion_wait() sync/async vs read/write confusionJens Axboe2-3/+3
Commit 1faa16d22877f4839bd433547d770c676d1d964c accidentally broke the bdi congestion wait queue logic, causing us to wait on congestion for WRITE (== 1) when we really wanted BLK_RW_ASYNC (== 0) instead. Signed-off-by: Jens Axboe <[email protected]>
2009-06-24switch xfs to generic acl caching helpersAl Viro4-75/+9
Signed-off-by: Al Viro <[email protected]>
2009-06-19block: rename CONFIG_LBD to CONFIG_LBDAFBartlomiej Zolnierkiewicz2-2/+2
Follow-up to "block: enable by default support for large devices and files on 32-bit archs". Rename CONFIG_LBD to CONFIG_LBDAF to: - allow update of existing [def]configs for "default y" change - reflect that it is used also for large files support nowadays Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2009-06-12Merge branch 'master' of git://oss.sgi.com/xfs/xfs into for-linusFelix Blyakher44-2083/+1341
2009-06-12xfs: fix small mismerge in xfs_vn_mknodChristoph Hellwig1-2/+2
Identation got messed up when merging the current_umask changes with the generic ACL support. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-06-12xfs: fix warnings with CONFIG_XFS_QUOTA disabledChristoph Hellwig1-1/+8
Fix warnings about unitialized dquot variables by making sure xfs_qm_vop_dqalloc touches it even when quotas are disabled. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]> Signed-off-by: Felix Blyakher <[email protected]>
2009-06-12xfs: fix freeing memory in xfs_getbmap()Felix Blyakher1-0/+1
Regression from commit 28e211700a81b0a934b6c7a4b8e7dda843634d2f. Need to free temporary buffer allocated in xfs_getbmap(). Signed-off-by: Felix Blyakher <[email protected]> Signed-off-by: Hedi Berriche <[email protected]> Reported-by: Justin Piszcz <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
2009-06-11xfs: remove ->write_super and stop maintaining ->s_dirtChristoph Hellwig2-14/+0
the write_super method is used for (1) writing back the superblock periodically from pdflush (2) called just before ->sync_fs for data integerity syncs We don't need (1) because we have our own peridoc writeout through xfssyncd, and we don't need (2) because xfs_fs_sync_fs performs a proper synchronous superblock writeout after all other data and metadata has been written out. Also remove ->s_dirt tracking as it's only used to decide when too call ->write_super. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Signed-off-by: Al Viro <[email protected]>
2009-06-11Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfsFelix Blyakher44-2082/+1332
2009-06-11Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds1-1/+1
* 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block: (153 commits) block: add request clone interface (v2) floppy: fix hibernation ramdisk: remove long-deprecated "ramdisk=" boot-time parameter fs/bio.c: add missing __user annotation block: prevent possible io_context->refcount overflow Add serial number support for virtio_blk, V4a block: Add missing bounce_pfn stacking and fix comments Revert "block: Fix bounce limit setting in DM" cciss: decode unit attention in SCSI error handling code cciss: Remove no longer needed sendcmd reject processing code cciss: change SCSI error handling routines to work with interrupts enabled. cciss: separate error processing and command retrying code in sendcmd_withirq_core() cciss: factor out fix target status processing code from sendcmd functions cciss: simplify interface of sendcmd() and sendcmd_withirq() cciss: factor out core of sendcmd_withirq() for use by SCSI error handling code cciss: Use schedule_timeout_uninterruptible in SCSI error handling code block: needs to set the residual length of a bidi request Revert "block: implement blkdev_readpages" block: Fix bounce limit setting in DM Removed reference to non-existing file Documentation/PCI/PCI-DMA-mapping.txt ... Manually fix conflicts with tracing updates in: block/blk-sysfs.c drivers/ide/ide-atapi.c drivers/ide/ide-cd.c drivers/ide/ide-floppy.c drivers/ide/ide-tape.c include/trace/events/block.h kernel/trace/blktrace.c
2009-06-10xfs: use generic Posix ACL codeChristoph Hellwig26-1103/+598
This patch rips out the XFS ACL handling code and uses the generic fs/posix_acl.c code instead. The ondisk format is of course left unchanged. This also introduces the same ACL caching all other Linux filesystems do by adding pointers to the acl and default acl in struct xfs_inode. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
2009-06-08xfs: remove SYNC_BDFLUSHChristoph Hellwig3-30/+11
SYNC_BDFLUSH is a leftover from IRIX and rather misnamed for todays code. Make xfs_sync_fsdata and xfs_dq_sync use the SYNC_TRYLOCK flag for not blocking on logs just as the inode sync code already does. For xfs_sync_fsdata it's a trivial 1:1 replacement, but for xfs_qm_sync I use the opportunity to decouple the non-blocking lock case from the different flushing modes, similar to the inode sync code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
2009-06-08xfs: remove SYNC_IOWAITChristoph Hellwig2-5/+4
We want to wait for all I/O to finish when we do data integrity syncs. So there is no reason to keep SYNC_WAIT separate from SYNC_IOWAIT. This causes a little change in behaviour for the ENOSPC flushing code which now does a second submission and wait of buffered I/O, but that should finish ASAP as we already did an asynchronous writeout earlier. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Josef 'Jeff' Sipek <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
2009-06-08xfs: split xfs_sync_inodesChristoph Hellwig5-30/+53
xfs_sync_inodes is used to write back either file data or inode metadata. In general we always do these separately, except for one fishy case in xfs_fs_put_super that does both. So separate xfs_sync_inodes into separate xfs_sync_data and xfs_sync_attr functions. In xfs_fs_put_super we first call the data sync and then the attr sync as that was the previous order. The moved log force in that path doesn't make a difference because we will force the log again as part of the real unmount process. The filesystem readonly checks are not performed by the new function but instead moved into the callers, given that most callers alredy have it further up in the stack. Also add debug checks that we do not pass in incorrect flags in the new xfs_sync_data and xfs_sync_attr function and fix the one place that did pass in a wrong flag. Also remove a comment mentioning xfs_sync_inodes that has been incorrect for a while because we always take either the iolock or ilock in the sync path these days. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>
2009-06-08xfs: use generic inode iterator in xfs_qm_dqrele_all_inodesChristoph Hellwig3-83/+39
Use xfs_inode_ag_iterator instead of opencoding the inode walk in the quota code. Mark xfs_inode_ag_iterator and xfs_sync_inode_valid non-static to allow using them from the quota code. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Josef 'Jeff' Sipek <[email protected]> Reviewed-by: Eric Sandeen <[email protected]>