xfs: new truncate sequence

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>
unify fs/inode.c callers of clear_inode()

For now, just a straightforward merge
New method - evict_inode()

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>
switch hugetlbfs to ->evict_inode()

The first spoils - hugetlb can use default ->drop_inode() now.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
generic_detach_inode() can be static now

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Take ->i_bdev/->i_cdev handling out of clear_inode()

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>
new helper: end_writeback()

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>
simplify get_cramfs_inode()

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 procfs to ->evict_inode()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
switch sysfs to ->evict_inode()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
switch minix to ->evict_inode(), fix write_inode/delete_inode race

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>
ext2: switch to dquot_free_block_nodirty()

brute-force conversion

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Take dirtying the inode to callers of ext2_free_blocks()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Don't dirty the victim in ext2_xattr_delete_inode()

... 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>