1 ext4: no need to truncate pagecache twice in collapse range
3 From: Lukas Czerner <lczerner@redhat.com>
5 We're already calling truncate_pagecache() before we attempt to do any
6 actual job so there is not need to truncate pagecache once more using
7 truncate_setsize() after we're finished.
9 Remove truncate_setsize() and replace it just with i_size_write() note
10 that we're holding appropriate locks.
12 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
13 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 fs/ext4/extents.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
18 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
19 index 25ed60f..9cd762c 100644
20 --- a/fs/ext4/extents.c
21 +++ b/fs/ext4/extents.c
22 @@ -5442,7 +5442,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
25 new_size = i_size_read(inode) - len;
26 - truncate_setsize(inode, new_size);
27 + i_size_write(inode, new_size);
28 EXT4_I(inode)->i_disksize = new_size;
30 ext4_discard_preallocations(inode);
35 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
36 the body of a message to majordomo@vger.kernel.org
37 More majordomo info at http://vger.kernel.org/majordomo-info.html