Add patch fix-flex_bg-ialloc
[ext4-patch-queue.git] / ext4-use-generic-discard-reservations-call
blob0e0a038f987977876c878378ab82b7fc5357ed13
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>
9 ---
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);
21         /*
22          * TODO: optimization is possible here.