btrfs: use min() to replace open-code in btrfs_invalidatepage()
In btrfs_invalidatepage() we introduce a temporary variable, new_len, to update ordered->truncated_len. But we can use min() to replace it completely and no need for the variable. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Родитель
fc57ad8d33
Коммит
ac5804eb85
|
@ -8414,15 +8414,13 @@ again:
|
|||
*/
|
||||
if (TestClearPagePrivate2(page)) {
|
||||
struct btrfs_ordered_inode_tree *tree;
|
||||
u64 new_len;
|
||||
|
||||
tree = &inode->ordered_tree;
|
||||
|
||||
spin_lock_irq(&tree->lock);
|
||||
set_bit(BTRFS_ORDERED_TRUNCATED, &ordered->flags);
|
||||
new_len = start - ordered->file_offset;
|
||||
if (new_len < ordered->truncated_len)
|
||||
ordered->truncated_len = new_len;
|
||||
ordered->truncated_len = min(ordered->truncated_len,
|
||||
start - ordered->file_offset);
|
||||
spin_unlock_irq(&tree->lock);
|
||||
|
||||
if (btrfs_dec_test_ordered_pending(inode, &ordered,
|
||||
|
|
Загрузка…
Ссылка в новой задаче