summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* merge ext2 delete_inode and clear_inode, switch to ->evict_inode()Al Viro2010-08-094-37/+36Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Don't dirty the victim in ext2_xattr_delete_inode()Al Viro2010-08-091-2/+0Star
| | | | | | | ... it's beyond fs-writeback reach already - writeback won't be started at that point. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Take dirtying the inode to callers of ext2_free_blocks()Al Viro2010-08-093-3/+7
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ext2: switch to dquot_free_block_nodirty()Al Viro2010-08-092-8/+16
| | | | | | brute-force conversion Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch minix to ->evict_inode(), fix write_inode/delete_inode raceAl Viro2010-08-092-9/+12
| | | | | | | We need to wait for completion of possible writeback in progress before we clear on-disk inode during deletion. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch sysfs to ->evict_inode()Al Viro2010-08-093-5/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch procfs to ->evict_inode()Al Viro2010-08-091-3/+3
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* simplify get_cramfs_inode()Al Viro2010-08-091-50/+38Star
| | | | | | | | simply don't hash the inodes that don't have real inumber instead of skipping them during iget5_locked(); as the result, simple iget_locked() would do and we can get rid of cramfs ->drop_inode() as well. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch hypfs to ->evict_inode()Al Viro2010-08-091-3/+3
| | | | | | | ... and since we never hash its inodes, default ->drop_inode() will work just fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* new helper: end_writeback()Al Viro2010-08-093-1/+14
| | | | | | | | | | | Essentially, the minimal variant of ->evict_inode(). It's a trimmed-down clear_inode(), sans any fs callbacks. Once it returns we know that no async writeback will be happening; every ->evict_inode() instance should do that once and do that before doing anything ->write_inode() could interfere with (e.g. freeing the on-disk inode). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Take ->i_bdev/->i_cdev handling out of clear_inode()Al Viro2010-08-091-4/+4
| | | | | | | | All call chains to clear_inode() pass through evict_inode() and clear_inode() should be called by evict_inode() exactly once. So we can pull i_bdev/i_cdev detaching up to evict_inode() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* generic_detach_inode() can be static nowAl Viro2010-08-092-3/+1Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch hugetlbfs to ->evict_inode()Al Viro2010-08-091-20/+2Star
| | | | | | The first spoils - hugetlb can use default ->drop_inode() now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* New method - evict_inode()Al Viro2010-08-092-1/+4
| | | | | | | | Hybrid of ->clear_inode() and ->delete_inode(); if present, does all fs work to be done when in-core inode is about to be gone, for whatever reason. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* unify fs/inode.c callers of clear_inode()Al Viro2010-08-091-19/+17Star
| | | | | | For now, just a straightforward merge Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* simplify checks for I_CLEAR/I_FREEINGAl Viro2010-08-0911-28/+27Star
| | | | | | | | | | | | | | add I_CLEAR instead of replacing I_FREEING with it. I_CLEAR is equivalent to I_FREEING for almost all code looking at either; it's there to keep track of having called clear_inode() exactly once per inode lifetime, at some point after having set I_FREEING. I_CLEAR and I_FREEING never get set at the same time with the current code, so we can switch to setting i_flags to I_FREEING | I_CLEAR instead of I_CLEAR without loss of information. As the result of such change, checks become simpler and the amount of code that needs to know about I_CLEAR shrinks a lot. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of file_fsync()Al Viro2010-08-096-29/+53
| | | | | | Copy and simplify in the only two users remaining. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* xfs: new truncate sequenceChristoph Hellwig2010-08-094-42/+56
| | | | | | | | | | | | | | | | | | | | | | | Convert XFS to the new truncate sequence. We still can have errors after updating the file size in xfs_setattr, but these are real I/O errors and lead to a transaction abort and filesystem shutdown, so they are not an issue. Errors from ->write_begin and write_end can now be handled correctly because we can actually get rid of the delalloc extents while previous the buffer state was stipped in block_invalidatepage. There is still no error handling for ->direct_IO, because doing so will need some major restructuring given that we only have the iolock shared and do not hold i_mutex at all. Fortunately leaving the normally allocated blocks behind there is not a major issue and this will get cleaned up by xfs_free_eofblock later. Note: the patch is against Al's vfs.git tree as that contains the nessecary preparations. I'd prefer to get it applied there so that we can get some testing in linux-next. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* exofs: New truncate sequenceBoaz Harrosh2010-08-093-75/+42Star
| | | | | | | | | | | | | | | | | | | | | | | | | | These changes are crafted based on the similar conversion done to ext2 by Nick Piggin. * Remove the deprecated ->truncate vector. Let exofs_setattr take care of on-disk size updates. * Call truncate_pagecache on the unused pages if write_begin/end fails. * Cleanup exofs_delete_inode that did stupid inode writes and updates on an inode that will be removed. * And finally get rid of exofs_get_block. We never had any blocks it was all for calling nobh_truncate_page. nobh_truncate_page is not actually needed in exofs since the last page is complete and gone, just like all the other pages. There is no partial blocks in exofs. I've tested with this patch, and there are no apparent failures, so far. CC: Nick Piggin <npiggin@suse.de> CC: Christoph Hellwig <hch@lst.de> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* jffs2: don't open-code iget_failed()Al Viro2010-08-091-12/+4Star
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* update documentation for the new truncate sequenceChristoph Hellwig2010-08-091-0/+18
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* check ATTR_SIZE contraints in inode_change_okChristoph Hellwig2010-08-0921-156/+108Star
| | | | | | | | | | | | | | | | | | | | | Make sure we check the truncate constraints early on in ->setattr by adding those checks to inode_change_ok. Also clean up and document inode_change_ok to make this obvious. As a fallout we don't have to call inode_newsize_ok from simple_setsize and simplify it down to a truncate_setsize which doesn't return an error. This simplifies a lot of setattr implementations and means we use truncate_setsize almost everywhere. Get rid of fat_setsize now that it's trivial and mark ext2_setsize static to make the calling convention obvious. Keep the inode_newsize_ok in vmtruncate for now as all callers need an audit for its removal anyway. Note: setattr code in ecryptfs doesn't call inode_change_ok at all and needs a deeper audit, but that is left for later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* always call inode_change_ok early in ->setattrChristoph Hellwig2010-08-096-48/+48
| | | | | | | | | Make sure we call inode_change_ok before doing any changes in ->setattr, and make sure to call it even if our fs wants to ignore normal UNIX permissions, but use the ATTR_FORCE to skip those. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* remove inode_setattrChristoph Hellwig2010-08-0935-194/+416
| | | | | | | | | | | | | | | | | | | Replace inode_setattr with opencoded variants of it in all callers. This moves the remaining call to vmtruncate into the filesystem methods where it can be replaced with the proper truncate sequence. In a few cases it was obvious that we would never end up calling vmtruncate so it was left out in the opencoded variant: spufs: explicitly checks for ATTR_SIZE earlier btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above In addition to that ncpfs called inode_setattr with handcrafted iattrs, which allowed to trim down the opencoded variant. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* default to simple_setattrChristoph Hellwig2010-08-092-11/+14
| | | | | | | | | | | | | | | | With the new truncate sequence every filesystem that wants to support file size changes on disk needs to implement its own ->setattr. So instead of calling inode_setattr which supports size changes call into a simple method that doesn't support this. simple_setattr is almost what we want except that it does not mark the inode dirty after changes. Given that marking the inode dirty is a no-op for the simple in-memory filesystems that use simple_setattr currently just add the mark_inode_dirty call. Also add a WARN_ON for the presence of a truncate method to simple_setattr to catch new instances of it during the transition period. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* rename generic_setattrChristoph Hellwig2010-08-098-15/+14Star
| | | | | | | | | Despite its name it's now a generic implementation of ->setattr, but rather a helper to copy attributes from a struct iattr to the inode. Rename it to setattr_copy to reflect this fact. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* add missing setattr methodsChristoph Hellwig2010-08-095-0/+60
| | | | | | | | | For the new truncate sequence every filesystem that wants to truncate on-disk state needs a seattr method. Convert the remaining filesystems that implement the truncate inode operation to have its own setattr method. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of block_write_begin_newtruncChristoph Hellwig2010-08-0913-91/+103
| | | | | | | | | | | Move the call to vmtruncate to get rid of accessive blocks to the callers in preparation of the new truncate sequence and rename the non-truncating version to block_write_begin. While we're at it also remove several unused arguments to block_write_begin. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* introduce __block_write_beginChristoph Hellwig2010-08-0910-64/+39Star
| | | | | | | | | | | | Split up the block_write_begin implementation - __block_write_begin is a new trivial wrapper for block_prepare_write that always takes an already allocated page and can be either called from block_write_begin or filesystem code that already has a page allocated. Remove the handling of already allocated pages from block_write_begin after switching all callers that do it to __block_write_begin. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* clean up write_begin usage for directories in pagecacheChristoph Hellwig2010-08-0913-107/+57Star
| | | | | | | | | | | | | | | | | | | For filesystem that implement directories in pagecache we call block_write_begin with an already allocated page for this code, while the normal regular file write path uses the default block_write_begin behaviour. Get rid of the __foofs_write_begin helper and opencode the normal write_begin call in foofs_write_begin, while adding a new foofs_prepare_chunk helper for the directory code. The added benefit is that foofs_prepare_chunk has a much saner calling convention. Note that the interruptible flag passed into block_write_begin is always ignored if we already pass in a page (see next patch for details), and we never were doing truncations of exessive blocks for this case either so we can switch directly to block_write_begin_newtrunc. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of cont_write_begin_newtruncChristoph Hellwig2010-08-099-30/+62
| | | | | | | | | Move the call to vmtruncate to get rid of accessive blocks to the callers in preparation of the new truncate sequence and rename the non-truncating version to cont_write_begin. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* get rid of nobh_write_begin_newtruncChristoph Hellwig2010-08-094-46/+17Star
| | | | | | | | | | Move the call to vmtruncate to get rid of accessive blocks to the only remaining caller and rename the non-truncating version to nobh_write_begin. Get rid of the superflous file argument to it while we're at it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* sort out blockdev_direct_IO variantsChristoph Hellwig2010-08-0915-119/+146
| | | | | | | | | | | | Move the call to vmtruncate to get rid of accessive blocks to the callers in prepearation of the new truncate calling sequence. This was only done for DIO_LOCKING filesystems, so the __blockdev_direct_IO_newtrunc variant was not needed anyway. Get rid of blockdev_direct_IO_no_locking and its _newtrunc variant while at it as just opencoding the two additional paramters is shorted than the name suffix. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fix leak in __logfs_create()Al Viro2010-08-091-1/+4
| | | | | | | if kmalloc fails, we still need to drop the inode, as we do on other failure exits. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Fix reiserfs_file_release()Al Viro2010-08-094-26/+32
| | | | | | | | | a) count file openers correctly; i_count use was completely wrong b) use new mutex for exclusion between final close/open/truncate, to protect tailpacking logics. i_mutex use was wrong and resulted in deadlocks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* missing include in hppfsAl Viro2010-08-091-0/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Deal with missing exports for hostfsAl Viro2010-08-095-3/+28
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds2010-08-0391-4018/+1621Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://oss.sgi.com/xfs/xfs: (49 commits) xfs simplify and speed up direct I/O completions xfs: move aio completion after unwritten extent conversion direct-io: move aio_complete into ->end_io xfs: fix big endian build xfs: clean up xfs_bmap_get_bp xfs: simplify xfs_truncate_file xfs: kill the b_strat callback in xfs_buf xfs: remove obsolete osyncisosync mount option xfs: clean up filestreams helpers xfs: fix gcc 4.6 set but not read and unused statement warnings xfs: Fix build when CONFIG_XFS_POSIX_ACL=n xfs: fix unsigned underflow in xfs_free_eofblocks xfs: use GFP_NOFS for page cache allocation xfs: fix memory reclaim recursion deadlock on locked inode buffer xfs: fix xfs_trans_add_item() lockdep warnings xfs: simplify and remove xfs_ireclaim xfs: don't block on buffer read errors xfs: move inode shrinker unregister even earlier xfs: remove a dmapi leftover xfs: writepage always has buffers ...
| * Merge branch 'v2.6.35'Alex Elder2010-08-02188-633/+1399
| |\
| * | xfs simplify and speed up direct I/O completionsChristoph Hellwig2010-07-261-82/+76Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our current handling of direct I/O completions is rather suboptimal, because we defer it to a workqueue more often than needed, and we perform a much to aggressive flush of the workqueue in case unwritten extent conversions happen. This patch changes the direct I/O reads to not even use a completion handler, as we don't bother to use it at all, and to perform the unwritten extent conversions in caller context for synchronous direct I/O. For a small I/O size direct I/O workload on a consumer grade SSD, such as the untar of a kernel tree inside qemu this patch gives speedups of about 5%. Getting us much closer to the speed of a native block device, or a fully allocated XFS file. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
| * | xfs: move aio completion after unwritten extent conversionChristoph Hellwig2010-07-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we write into an unwritten extent using AIO we need to complete the AIO request after the extent conversion has finished. Without that a read could race to see see the extent still unwritten and return zeros. For synchronous I/O we already take care of that by flushing the xfsconvertd workqueue (which might be a bit of overkill). To do that add iocb and result fields to struct xfs_ioend, so that we can call aio_complete from xfs_end_io after the extent conversion has happened. Note that we need a new result field as io_error is used for positive errno values, while the AIO code can return negative error values and positive transfer sizes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
| * | direct-io: move aio_complete into ->end_ioChristoph Hellwig2010-07-266-18/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filesystems with unwritten extent support must not complete an AIO request until the transaction to convert the extent has been commited. That means the aio_complete calls needs to be moved into the ->end_io callback so that the filesystem can control when to call it exactly. This makes a bit of a mess out of dio_complete and the ->end_io callback prototype even more complicated. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Alex Elder <aelder@sgi.com>
| * | xfs: fix big endian buildDave Chinner2010-07-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0fd7275cc42ab734eaa1a2c747e65479bd1e42af ("xfs: fix gcc 4.6 set but not read and unused statement warnings") failed to convert some code inside XFS_NATIVE_HOST (big endian host code only) and hence fails to build on such machines. Fix it. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
| * | xfs: clean up xfs_bmap_get_bpChristoph Hellwig2010-07-261-25/+18Star
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: simplify xfs_truncate_fileChristoph Hellwig2010-07-263-102/+52Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xfs_truncate_file is only used for truncating quota files. Move it to xfs_qm_syscalls.c so it can be marked static and take advatange of the fact by removing the unused page cache validation and taking the iget into the helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: kill the b_strat callback in xfs_bufChristoph Hellwig2010-07-264-17/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The b_strat callback is used by xfs_buf_iostrategy to perform additional checks before submitting a buffer. It is used in xfs_bwrite and when writing out delayed buffers. In xfs_bwrite it we can de-virtualize the call easily as b_strat is set a few lines above the call to xfs_buf_iostrategy. For the delayed buffers the rationale is a bit more complicated: - there are three callers of xfs_buf_delwri_queue, which places buffers on the delwri list: (1) xfs_bdwrite - this sets up b_strat, so it's fine (2) xfs_buf_iorequest. None of the callers can have XBF_DELWRI set: - xlog_bdstrat is only used for log buffers, which are never delwri - _xfs_buf_read explicitly clears the delwri flag - xfs_buf_iodone_work retries log buffers only - xfsbdstrat - only used for reads, superblock writes without the delwri flag, log I/O and file zeroing with explicitly allocated buffers. - xfs_buf_iostrategy - only calls xfs_buf_iorequest if b_strat is not set (3) xfs_buf_unlock - only puts the buffer on the delwri list if the DELWRI flag is already set. The DELWRI flag is only ever set in xfs_bwrite, xfs_buf_iodone_callbacks, or xfs_trans_log_buf. For xfs_buf_iodone_callbacks and xfs_trans_log_buf we require an initialized buf item, which means b_strat was set to xfs_bdstrat_cb in xfs_buf_item_init. Conclusion: we can just get rid of the callback and replace it with explicit calls to xfs_bdstrat_cb. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: remove obsolete osyncisosync mount optionChristoph Hellwig2010-07-263-19/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Linux 2.6.33 the kernel has support for real O_SYNC, which made the osyncisosync option a no-op. Warn the users about this and remove the mount flag for it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: clean up filestreams helpersChristoph Hellwig2010-07-262-85/+77Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move xfs_filestream_peek_ag, xxfs_filestream_get_ag and xfs_filestream_put_ag from xfs_filestream.h to xfs_filestream.c where it's only callers are, and remove the inline marker while we're at it to let the compiler decide on the inlining. Also don't return a value from xfs_filestream_put_ag because we don't need it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: fix gcc 4.6 set but not read and unused statement warningsChristoph Hellwig2010-07-267-34/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | [hch: dropped a few hunks that need structural changes instead] Signed-off-by: Andi Kleen <ak@linux.intel.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
| * | xfs: Fix build when CONFIG_XFS_POSIX_ACL=nTony Luck2010-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_XFS_POSIX_ACL is not set "xfs_check_acl" is #defined to NULL - which breaks the code attempting to add a tracepoint on this function. Only define the tracepoint when the function exists. Signed-off-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>