aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2011-05-25 17:39:48 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-25 17:39:48 -0400
commitae24f28d39610a4810c78185cf599a771cf6ee1f (patch)
treea4969875b6345f6ee3eb8bdf3a0af823cab33e3f /fs/ext4/inode.c
parent556b27abf73833923d5cd4be80006292e1b31662 (diff)
downloadkernel_samsung_crespo-ae24f28d39610a4810c78185cf599a771cf6ee1f.zip
kernel_samsung_crespo-ae24f28d39610a4810c78185cf599a771cf6ee1f.tar.gz
kernel_samsung_crespo-ae24f28d39610a4810c78185cf599a771cf6ee1f.tar.bz2
ext4: Convert ext4 to new truncate calling convention
Trivial conversion. Fixup one error handling case calling vmtruncate() and remove ->truncate callback. We also fix a bug that IS_IMMUTABLE and IS_APPEND files could not be truncated during failed writes. In fact, the test can be completely removed as upper layers do necessary permission checks for truncate in do_sys_[f]truncate() and may_open() anyway. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 65576c0..50d0e9c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3511,7 +3511,7 @@ retry:
loff_t end = offset + iov_length(iov, nr_segs);
if (end > isize)
- vmtruncate(inode, isize);
+ ext4_truncate_failed_write(inode);
}
}
if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
@@ -4407,8 +4407,6 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
int ext4_can_truncate(struct inode *inode)
{
- if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
- return 0;
if (S_ISREG(inode->i_mode))
return 1;
if (S_ISDIR(inode->i_mode))