Skip to content

Commit

Permalink
ext4: Use ext4_discard_reservations instead of mballoc-specific call
Browse files Browse the repository at this point in the history
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: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Mingming Cao <cmm@us.ibm.com>
  • Loading branch information
Theodore Ts'o committed Aug 16, 2008
1 parent d015641 commit 88aa3cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 88aa3cf

Please sign in to comment.