Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88aa3cff authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ext4: Use ext4_discard_reservations instead of mballoc-specific call



In ext4_ext_truncate(), we should use the more generic
ext4_discard_reservations() call so we do the right thing when the
filesystem is mounted with the nomballoc option.

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarMingming Cao <cmm@us.ibm.com>
parent d0156417
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2819,7 +2819,7 @@ void ext4_ext_truncate(struct inode *inode)
	down_write(&EXT4_I(inode)->i_data_sem);
	ext4_ext_invalidate_cache(inode);

	ext4_mb_discard_inode_preallocations(inode);
	ext4_discard_reservation(inode);

	/*
	 * TODO: optimization is possible here.