1 ext4: Use ext4_discard_reservations instead of mballoc-specific call
3 In ext4_ext_truncate(), we should use the more generic
4 ext4_discard_reservations() call so we do the right thing when the
5 filesystem is mounted with the nomballoc option.
7 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
8 Reviewed-by: Mingming Cao <cmm@us.ibm.com>
10 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
11 index 3c82ab1..30a59b8 100644
12 --- a/fs/ext4/extents.c
13 +++ b/fs/ext4/extents.c
14 @@ -2963,7 +2963,7 @@ void ext4_ext_truncate(struct inode *inode)
15 down_write(&EXT4_I(inode)->i_data_sem);
16 ext4_ext_invalidate_cache(inode);
18 - ext4_mb_discard_inode_preallocations(inode);
19 + ext4_discard_reservation(inode);
22 * TODO: optimization is possible here.